this is used in tests (#1380)

* signing prefix added

* Minor improvement

* Tests changed

* Successfully tested

* Minor improvements

* Minor improvements

* Revert "Dangling commas are now required. (#1359)"

This reverts commit a6889776f4.

* updates

* fixes #1200

* suggested change
This commit is contained in:
Aniket
2018-10-04 18:27:37 +05:30
committed by Nicolás Venturo
parent fd4de77651
commit b41b125c15
4 changed files with 21 additions and 30 deletions

View File

@ -9,17 +9,14 @@ require('chai')
.should();
contract('ReentrancyGuard', function () {
let reentrancyMock;
beforeEach(async function () {
reentrancyMock = await ReentrancyMock.new();
const initialCounter = await reentrancyMock.counter();
initialCounter.should.be.bignumber.equal(0);
this.reentrancyMock = await ReentrancyMock.new();
(await this.reentrancyMock.counter()).should.be.bignumber.equal(0);
});
it('should not allow remote callback', async function () {
const attacker = await ReentrancyAttack.new();
await expectThrow(reentrancyMock.countAndCall(attacker.address));
await expectThrow(this.reentrancyMock.countAndCall(attacker.address));
});
// The following are more side-effects than intended behavior:
@ -27,10 +24,10 @@ contract('ReentrancyGuard', function () {
// in the side-effects.
it('should not allow local recursion', async function () {
await expectThrow(reentrancyMock.countLocalRecursive(10));
await expectThrow(this.reentrancyMock.countLocalRecursive(10));
});
it('should not allow indirect local recursion', async function () {
await expectThrow(reentrancyMock.countThisRecursive(10));
await expectThrow(this.reentrancyMock.countThisRecursive(10));
});
});