Draft EIP 1820 (#1677)
* Add barebones EIP1820 support. * Update openzeppelin-test-helpers dependency to have ERC1820 support. * Add tests for ERC1820. * Improve inline documentation. * Add changelog entry. * Update test-helpers, refactor tests to use new helpers. * Rename ERC1820 to ERC1820Implementer. * Improve implementer docstring. * Remove _implementsInterfaceForAddress. * update openzeppelin-test-helpers to 0.2.0 * Update contracts/drafts/ERC1820Implementer.sol Co-Authored-By: nventuro <nicolas.venturo@gmail.com> * Fix how solidity coverage is run to allow for free events. * Fix coverage testing script.
This commit is contained in:
@ -72,21 +72,23 @@ contract('SampleCrowdsale', function ([_, deployer, owner, wallet, investor]) {
|
||||
await time.increaseTo(this.openingTime);
|
||||
await this.crowdsale.send(GOAL);
|
||||
|
||||
(await balance.difference(wallet, async () => {
|
||||
await time.increaseTo(this.afterClosingTime);
|
||||
await this.crowdsale.finalize({ from: owner });
|
||||
})).should.be.bignumber.equal(GOAL);
|
||||
const balanceTracker = await balance.tracker(wallet);
|
||||
await time.increaseTo(this.afterClosingTime);
|
||||
await this.crowdsale.finalize({ from: owner });
|
||||
(await balanceTracker.delta()).should.be.bignumber.equal(GOAL);
|
||||
});
|
||||
|
||||
it('should allow refunds if the goal is not reached', async function () {
|
||||
(await balance.difference(investor, async () => {
|
||||
await time.increaseTo(this.openingTime);
|
||||
await this.crowdsale.sendTransaction({ value: ether('1'), from: investor, gasPrice: 0 });
|
||||
await time.increaseTo(this.afterClosingTime);
|
||||
const balanceTracker = await balance.tracker(investor);
|
||||
|
||||
await this.crowdsale.finalize({ from: owner });
|
||||
await this.crowdsale.claimRefund(investor, { gasPrice: 0 });
|
||||
})).should.be.bignumber.equal('0');
|
||||
await time.increaseTo(this.openingTime);
|
||||
await this.crowdsale.sendTransaction({ value: ether('1'), from: investor, gasPrice: 0 });
|
||||
await time.increaseTo(this.afterClosingTime);
|
||||
|
||||
await this.crowdsale.finalize({ from: owner });
|
||||
await this.crowdsale.claimRefund(investor, { gasPrice: 0 });
|
||||
|
||||
(await balanceTracker.delta()).should.be.bignumber.equal('0');
|
||||
});
|
||||
|
||||
describe('when goal > cap', function () {
|
||||
|
||||
Reference in New Issue
Block a user