Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@hq20/girino
Advanced tools
Girino is a chai module to improve truffle test development.
yarn add girino -D
# or
npm install girino --save-dev
const SimpleToken = artifacts.require('SimpleToken');
const BigNumber = require('bignumber.js');
const chai = require('chai');
const girino = require('girino');
const { expect } = chai;
chai.use(girino);
contract('SimpleToken', (accounts) => {
let simpleToken;
const aToken = new BigNumber('1');
const mainAccount = accounts[0];
const userAccount = accounts[1];
const receiverAccount = accounts[2];
before(async () => {
simpleToken = await SimpleToken.deployed();
});
it('should revert', () => expect(
simpleToken.transfer(receiverAccount, aToken, { from: userAccount }),
).to.revert);
it('should revertWith', () => expect(
simpleToken.transfer(receiverAccount, aToken, { from: userAccount }),
).to.revertWith('SafeMath: subtraction overflow'));
it('to emit', () => expect(
simpleToken.transfer(receiverAccount, aToken, { from: mainAccount }),
).to.emit('Transfer'));
it('withArgs success', () => expect(
simpleToken.transfer(receiverAccount, aToken, { from: mainAccount }),
).to.emit('Transfer').withArgs(mainAccount, receiverAccount, aToken));
});
And then just run tests as you are used to, with truffle test
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
FAQs
A truffle test helper to use with chai.
We found that @hq20/girino demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.