Skip to content

Commit

Permalink
ERC777 Fix travis CI errors (OpenZeppelin#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertrand Masius committed Mar 21, 2019
1 parent 2582a2a commit 7f7d296
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions test/drafts/ERC777/ERC777.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { BN, constants, should, shouldFail } = require('openzeppelin-test-helpers');
const { shouldFail } = require('openzeppelin-test-helpers');
const expectEvent = require('../../helpers/expectEvent');
const { ERC1820Deploy } = require('../../introspection/ERC1820Deploy');

Expand All @@ -7,23 +7,27 @@ const ERC1820 = artifacts.require('IERC1820');
const ERC777TokensRecipient = artifacts.require('ERC777ReceiverMock');
const ERC777TokensSender = artifacts.require('ERC777SenderMock');

const BigNumber = BN;

contract('ERC777', function ([_, holder, operator, anotherAccount]) {
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
const ERC1820_ADDRESS = '0x1820b744B33945482C17Dc37218C01D858EBc714';
const INITIAL_SUPPLY = '10000';
const USER_DATA = '0xabcd';
const OPERATOR_DATA = '0x0a0b0c0d';
const GRANULARITY = '1';

before('Deploy ERC1820', async function () {
try {
this.ERC1820Registry = await ERC1820.at(ERC1820_ADDRESS);
} catch (error) {
const address = await ERC1820Deploy(holder);
this.ERC1820Registry = await ERC1820.at(address);
}
var ERC1820Registry;

before('Deploy ERC1820', function (done) {
ERC1820.at(ERC1820_ADDRESS).then(
function(contract) {
ERC1820Registry = contract.address;
done();
},
async function(reject) {
const address = await ERC1820Deploy(holder);
ERC1820Registry = (await ERC1820.at(address)).address;
done();
}
);
});

it('Minted event is emitted', async function () {
Expand Down Expand Up @@ -51,7 +55,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) {
describe('ERC1820 Registry', function () {
it('hardcoded address in ERC777 contract is correct', async function () {
const erc1820 = await this.token.getERC1820Registry();
erc1820.should.be.equal(this.ERC1820Registry.address);
erc1820.should.be.equal(ERC1820Registry);
});
});

Expand Down

0 comments on commit 7f7d296

Please sign in to comment.