fix all tests for 2.1.2
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
const { constants, expectEvent } = require('openzeppelin-test-helpers');
|
||||
const { ZERO_ADDRESS } = constants;
|
||||
|
||||
const SimpleToken = artifacts.require('SimpleToken');
|
||||
const SimpleToken = artifacts.require('SimpleTokenMock');
|
||||
|
||||
contract('SimpleToken', function ([_, creator]) {
|
||||
beforeEach(async function () {
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
const encodeCall = require('zos-lib/lib/helpers/encodeCall').default;
|
||||
const { shouldBehaveLikeERC20Mintable } = require('../token/ERC20/behaviors/ERC20Mintable.behavior');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
const { BN } = require('openzeppelin-test-helpers');
|
||||
|
||||
const StandardToken = artifacts.require('StandardToken');
|
||||
|
||||
@ -14,9 +10,9 @@ contract('StandardToken', function ([
|
||||
]) {
|
||||
const name = 'StdToken';
|
||||
const symbol = 'STDT';
|
||||
const decimals = 18;
|
||||
const decimals = new BN('18');
|
||||
|
||||
const initialSupply = 300;
|
||||
const initialSupply = new BN('300');
|
||||
|
||||
const minters = [minterA, minterB];
|
||||
const pausers = [pauserA, pauserB];
|
||||
@ -28,10 +24,9 @@ contract('StandardToken', function ([
|
||||
});
|
||||
|
||||
async function initialize (token, name, symbol, decimals, initialSupply, initialHolder, minters, pausers, from) {
|
||||
const callData = encodeCall('initialize',
|
||||
['string', 'string', 'uint8', 'uint256', 'address', 'address[]', 'address[]'],
|
||||
[name, symbol, decimals, initialSupply, initialHolder, minters, pausers]);
|
||||
await token.sendTransaction({ data: callData, from });
|
||||
const signature = 'initialize(string,string,uint8,uint256,address,address[],address[],address)';
|
||||
const arguments = [name, symbol, decimals, initialSupply, initialHolder, minters, pausers, from];
|
||||
await token.methods[signature](...arguments, { from });
|
||||
}
|
||||
|
||||
context('with all arguments', function () {
|
||||
@ -77,8 +72,8 @@ contract('StandardToken', function ([
|
||||
});
|
||||
|
||||
it('can be created with zero initial balance', async function () {
|
||||
await initialize(this.token, name, symbol, decimals, 0, ZERO_ADDRESS, minters, pausers, deployer);
|
||||
(await this.token.balanceOf(initialHolder)).should.be.bignumber.equal(0);
|
||||
await initialize(this.token, name, symbol, decimals, new BN(0), ZERO_ADDRESS, minters, pausers, deployer);
|
||||
(await this.token.balanceOf(initialHolder)).should.be.bignumber.equal('0');
|
||||
});
|
||||
|
||||
it('can be created with no minters', async function () {
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
const encodeCall = require('zos-lib/lib/helpers/encodeCall').default;
|
||||
const { shouldBehaveLikeERC20Mintable } = require('./behaviors/ERC20Mintable.behavior');
|
||||
const shouldFail = require('../../helpers/shouldFail');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
const { shouldFail, BN } = require('openzeppelin-test-helpers');
|
||||
|
||||
const StandaloneERC20 = artifacts.require('StandaloneERC20');
|
||||
|
||||
@ -15,9 +10,9 @@ contract('StandaloneERC20', function ([
|
||||
]) {
|
||||
const name = 'StandaloneERC20';
|
||||
const symbol = 'SAERC20';
|
||||
const decimals = 18;
|
||||
const decimals = new BN(18);
|
||||
|
||||
const initialSupply = 300;
|
||||
const initialSupply = new BN(300);
|
||||
|
||||
const minters = [minterA, minterB];
|
||||
const pausers = [pauserA, pauserB];
|
||||
@ -29,17 +24,15 @@ contract('StandaloneERC20', function ([
|
||||
});
|
||||
|
||||
async function initializeFull (token, name, symbol, decimals, initialSupply, initialHolder, minters, pausers, from) {
|
||||
const callData = encodeCall('initialize',
|
||||
['string', 'string', 'uint8', 'uint256', 'address', 'address[]', 'address[]'],
|
||||
[name, symbol, decimals, initialSupply, initialHolder, minters, pausers]);
|
||||
await token.sendTransaction({ data: callData, from });
|
||||
const signature = 'initialize(string,string,uint8,uint256,address,address[],address[],address)';
|
||||
const arguments = [name, symbol, decimals, initialSupply, initialHolder, minters, pausers, from];
|
||||
await token.methods[signature](...arguments, { from });
|
||||
}
|
||||
|
||||
async function initializePartial (token, name, symbol, decimals, minters, pausers, from) {
|
||||
const callData = encodeCall('initialize',
|
||||
['string', 'string', 'uint8', 'address[]', 'address[]'],
|
||||
[name, symbol, decimals, minters, pausers]);
|
||||
await token.sendTransaction({ data: callData, from });
|
||||
const signature = 'initialize(string,string,uint8,address[],address[],address)';
|
||||
const arguments = [name, symbol, decimals, minters, pausers, from];
|
||||
await token.methods[signature](...arguments, { from });
|
||||
}
|
||||
|
||||
describe('with all arguments', function () {
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
const encodeCall = require('zos-lib/lib/helpers/encodeCall').default;
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
require('openzeppelin-test-helpers');
|
||||
|
||||
const StandaloneERC721 = artifacts.require('StandaloneERC721');
|
||||
|
||||
@ -20,10 +16,9 @@ contract('StandaloneERC721', function ([_, deployer, minterA, minterB, pauserA,
|
||||
});
|
||||
|
||||
async function initialize (token, name, symbol, minters, pausers, from) {
|
||||
const callData = encodeCall('initialize',
|
||||
['string', 'string', 'address[]', 'address[]'],
|
||||
[name, symbol, minters, pausers]);
|
||||
await token.sendTransaction({ data: callData, from });
|
||||
const signature = 'initialize(string,string,address[],address[],address)';
|
||||
const arguments = [name, symbol, minters, pausers, from];
|
||||
await token.methods[signature](...arguments, { from });
|
||||
}
|
||||
|
||||
it('can be created with no minters', async function () {
|
||||
|
||||
Reference in New Issue
Block a user