Instantly share code, notes, and snippets.

@kolya-t /erc20.js Secret
Created Apr 13, 2018

Embed
What would you like to do?
it('transfer with disabled lock') with async/await
it('transfer with disabled lock', async () => {
const instance = await ERC20.new(
1000000,
"TEST",
18,
"TEST",
true,
false
);
await Utils.balanceShouldEqualTo(instance, accounts[0], 1000000);
await Utils.balanceShouldEqualTo(instance, instance.address, 0);
let receipt = await instance.transfer(accounts[1], 1000);
await Utils.receiptShouldSucceed(receipt);
await Utils.balanceShouldEqualTo(instance, accounts[0], 999000);
await Utils.balanceShouldEqualTo(instance, accounts[1], 1000);
receipt = await instance.transfer(accounts[1], 1000);
await Utils.receiptShouldSucceed(receipt);
receipt = await instance.transfer(accounts[1], 1000);
await Utils.receiptShouldSucceed(receipt);
receipt = await instance.transfer(accounts[1], 1000);
await Utils.receiptShouldSucceed(receipt);
await Utils.balanceShouldEqualTo(instance, accounts[0], 996000);
await Utils.balanceShouldEqualTo(instance, accounts[1], 4000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment