added examples
This commit is contained in:
@ -1,8 +0,0 @@
|
||||
import utils from 'ethereumjs-util';
|
||||
|
||||
// Hash and add same prefix to the hash that testrpc use.
|
||||
module.exports = function (message) {
|
||||
const messageHex = Buffer.from(utils.sha3(message).toString('hex'), 'hex');
|
||||
const prefix = utils.toBuffer('\u0019Ethereum Signed Message:\n' + messageHex.length.toString());
|
||||
return utils.bufferToHex(utils.sha3(Buffer.concat([prefix, messageHex])));
|
||||
};
|
||||
@ -22,17 +22,17 @@ contract('SafeERC20', function () {
|
||||
await shouldFail.reverting(this.helper.doFailingApprove());
|
||||
});
|
||||
|
||||
it('should throw on failed increaseAllowance', async function () {
|
||||
await shouldFail.reverting(this.helper.doFailingIncreaseAllowance());
|
||||
});
|
||||
it('should throw on failed increaseAllowance', async function () {
|
||||
await shouldFail.reverting(this.helper.doFailingIncreaseAllowance());
|
||||
});
|
||||
|
||||
it('should throw on failed decreaseAllowance', async function () {
|
||||
await shouldFail.reverting(this.helper.doFailingDecreaseAllowance());
|
||||
});
|
||||
it('should throw on failed decreaseAllowance', async function () {
|
||||
await shouldFail.reverting(this.helper.doFailingDecreaseAllowance());
|
||||
});
|
||||
|
||||
it('should not throw on succeeding transfer', async function () {
|
||||
await this.helper.doSucceedingTransfer();
|
||||
});
|
||||
it('should not throw on succeeding transfer', async function () {
|
||||
await this.helper.doSucceedingTransfer();
|
||||
});
|
||||
|
||||
it('reverts on decreaseAllowance', async function () {
|
||||
await shouldFail.reverting(this.helper.doFailingDecreaseAllowance());
|
||||
|
||||
Reference in New Issue
Block a user