|
@@ -250,7 +250,7 @@ contract('ERC20', function (accounts) {
|
|
|
describe('for a non zero account', function () {
|
|
|
it('rejects burning more than balance', async function () {
|
|
|
await expectRevert(this.token.burn(
|
|
|
- initialHolder, initialSupply.addn(1)), 'ERC20: burn amount exceeds balance',
|
|
|
+ initialHolder, initialSupply.addn(1)), 'ERC20: transfer amount exceeds balance',
|
|
|
);
|
|
|
});
|
|
|
|
|
@@ -287,6 +287,49 @@ contract('ERC20', function (accounts) {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ describe('_update', function () {
|
|
|
+ const amount = new BN(1);
|
|
|
+
|
|
|
+ it('from is the zero address', async function () {
|
|
|
+ const balanceBefore = await this.token.balanceOf(initialHolder);
|
|
|
+ const totalSupply = await this.token.totalSupply();
|
|
|
+
|
|
|
+ expectEvent(
|
|
|
+ await this.token.update(ZERO_ADDRESS, initialHolder, amount),
|
|
|
+ 'Transfer',
|
|
|
+ { from: ZERO_ADDRESS, to: initialHolder, value: amount },
|
|
|
+ );
|
|
|
+ expect(await this.token.totalSupply()).to.be.bignumber.equal(totalSupply.add(amount));
|
|
|
+ expect(await this.token.balanceOf(initialHolder)).to.be.bignumber.equal(balanceBefore.add(amount));
|
|
|
+ });
|
|
|
+
|
|
|
+ it('to is the zero address', async function () {
|
|
|
+ const balanceBefore = await this.token.balanceOf(initialHolder);
|
|
|
+ const totalSupply = await this.token.totalSupply();
|
|
|
+
|
|
|
+ expectEvent(
|
|
|
+ await this.token.update(initialHolder, ZERO_ADDRESS, amount),
|
|
|
+ 'Transfer',
|
|
|
+ { from: initialHolder, to: ZERO_ADDRESS, value: amount },
|
|
|
+ );
|
|
|
+ expect(await this.token.totalSupply()).to.be.bignumber.equal(totalSupply.sub(amount));
|
|
|
+ expect(await this.token.balanceOf(initialHolder)).to.be.bignumber.equal(balanceBefore.sub(amount));
|
|
|
+ });
|
|
|
+
|
|
|
+ it('from and to are the zero address', async function () {
|
|
|
+ const totalSupply = await this.token.totalSupply();
|
|
|
+
|
|
|
+ await this.token.update(ZERO_ADDRESS, ZERO_ADDRESS, amount);
|
|
|
+
|
|
|
+ expect(await this.token.totalSupply()).to.be.bignumber.equal(totalSupply);
|
|
|
+ expectEvent(
|
|
|
+ await this.token.update(ZERO_ADDRESS, ZERO_ADDRESS, amount),
|
|
|
+ 'Transfer',
|
|
|
+ { from: ZERO_ADDRESS, to: ZERO_ADDRESS, value: amount },
|
|
|
+ );
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
describe('_transfer', function () {
|
|
|
shouldBehaveLikeERC20Transfer('ERC20', initialHolder, recipient, initialSupply, function (from, to, amount) {
|
|
|
return this.token.transferInternal(from, to, amount);
|