Remove truffle from UnlimitedAllowanceTokenV2 tests
This commit is contained in:
parent
661029f7cc
commit
20c88a46d9
@ -22,7 +22,6 @@ const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
|||||||
|
|
||||||
describe('EtherToken', () => {
|
describe('EtherToken', () => {
|
||||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||||
let accounts: string[];
|
|
||||||
let account: string;
|
let account: string;
|
||||||
const gasPrice = ZeroEx.toBaseUnitAmount(new BigNumber(20), 9);
|
const gasPrice = ZeroEx.toBaseUnitAmount(new BigNumber(20), 9);
|
||||||
let zeroEx: ZeroEx;
|
let zeroEx: ZeroEx;
|
||||||
@ -34,7 +33,7 @@ describe('EtherToken', () => {
|
|||||||
return balance;
|
return balance;
|
||||||
};
|
};
|
||||||
before(async () => {
|
before(async () => {
|
||||||
accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
account = accounts[0];
|
account = accounts[0];
|
||||||
etherTokenAddress = EtherToken.address;
|
etherTokenAddress = EtherToken.address;
|
||||||
zeroEx = new ZeroEx(web3.currentProvider, {
|
zeroEx = new ZeroEx(web3.currentProvider, {
|
||||||
|
@ -23,7 +23,6 @@ const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
|||||||
|
|
||||||
describe('MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', () => {
|
describe('MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', () => {
|
||||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||||
let accounts: string[];
|
|
||||||
let owners: string[];
|
let owners: string[];
|
||||||
const requiredApprovals = 2;
|
const requiredApprovals = 2;
|
||||||
const SECONDS_TIME_LOCKED = 1000000;
|
const SECONDS_TIME_LOCKED = 1000000;
|
||||||
@ -38,7 +37,7 @@ describe('MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', () => {
|
|||||||
|
|
||||||
let validDestination: string;
|
let validDestination: string;
|
||||||
before(async () => {
|
before(async () => {
|
||||||
accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
owners = [accounts[0], accounts[1]];
|
owners = [accounts[0], accounts[1]];
|
||||||
authorizedAddress = `0x${crypto
|
authorizedAddress = `0x${crypto
|
||||||
.solSHA3([accounts[0]])
|
.solSHA3([accounts[0]])
|
||||||
|
@ -23,13 +23,12 @@ const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
|||||||
|
|
||||||
describe('TokenRegistry', () => {
|
describe('TokenRegistry', () => {
|
||||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||||
let accounts: string[];
|
|
||||||
let owner: string;
|
let owner: string;
|
||||||
let notOwner: string;
|
let notOwner: string;
|
||||||
let tokenReg: ContractInstance;
|
let tokenReg: ContractInstance;
|
||||||
let tokenRegWrapper: TokenRegWrapper;
|
let tokenRegWrapper: TokenRegWrapper;
|
||||||
before(async () => {
|
before(async () => {
|
||||||
accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
owner = accounts[0];
|
owner = accounts[0];
|
||||||
notOwner = accounts[1];
|
notOwner = accounts[1];
|
||||||
tokenReg = await TokenRegistry.new();
|
tokenReg = await TokenRegistry.new();
|
||||||
|
@ -17,13 +17,12 @@ const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
|||||||
|
|
||||||
describe('TokenTransferProxy', () => {
|
describe('TokenTransferProxy', () => {
|
||||||
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||||
let accounts: string[];
|
|
||||||
let owner: string;
|
let owner: string;
|
||||||
let notOwner: string;
|
let notOwner: string;
|
||||||
let address: string;
|
let address: string;
|
||||||
let tokenTransferProxy: ContractInstance;
|
let tokenTransferProxy: ContractInstance;
|
||||||
before(async () => {
|
before(async () => {
|
||||||
accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
owner = address = accounts[0];
|
owner = address = accounts[0];
|
||||||
notOwner = accounts[1];
|
notOwner = accounts[1];
|
||||||
tokenTransferProxy = await TokenTransferProxy.deployed();
|
tokenTransferProxy = await TokenTransferProxy.deployed();
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import { ZeroEx } from '0x.js';
|
import { ZeroEx } from '0x.js';
|
||||||
|
import { BlockchainLifecycle } from '@0xproject/dev-utils';
|
||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
|
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as Web3 from 'web3';
|
import * as Web3 from 'web3';
|
||||||
|
|
||||||
@ -10,28 +12,38 @@ import { ContractInstance } from '../util/types';
|
|||||||
import { chaiSetup } from './utils/chai_setup';
|
import { chaiSetup } from './utils/chai_setup';
|
||||||
|
|
||||||
const { DummyTokenV2 } = new Artifacts(artifacts);
|
const { DummyTokenV2 } = new Artifacts(artifacts);
|
||||||
const web3: Web3 = (global as any).web3;
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
const web3: Web3 = (global as any).web3;
|
||||||
|
const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
|
||||||
|
|
||||||
contract('UnlimitedAllowanceTokenV2', (accounts: string[]) => {
|
describe('UnlimitedAllowanceTokenV2', () => {
|
||||||
|
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
|
||||||
const config = {
|
const config = {
|
||||||
networkId: constants.TESTRPC_NETWORK_ID,
|
networkId: constants.TESTRPC_NETWORK_ID,
|
||||||
};
|
};
|
||||||
const zeroEx = new ZeroEx(web3.currentProvider, config);
|
const zeroEx = new ZeroEx(web3.currentProvider, config);
|
||||||
const owner = accounts[0];
|
let owner: string;
|
||||||
const spender = accounts[1];
|
let spender: string;
|
||||||
|
|
||||||
const MAX_MINT_VALUE = new BigNumber(100000000000000000000);
|
const MAX_MINT_VALUE = new BigNumber(100000000000000000000);
|
||||||
let tokenAddress: string;
|
let tokenAddress: string;
|
||||||
let token: ContractInstance;
|
let token: ContractInstance;
|
||||||
|
|
||||||
beforeEach(async () => {
|
before(async () => {
|
||||||
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
|
owner = accounts[0];
|
||||||
|
spender = accounts[1];
|
||||||
token = await DummyTokenV2.new({ from: owner });
|
token = await DummyTokenV2.new({ from: owner });
|
||||||
await token.mint(MAX_MINT_VALUE, { from: owner });
|
await token.mint(MAX_MINT_VALUE, { from: owner });
|
||||||
tokenAddress = token.address;
|
tokenAddress = token.address;
|
||||||
});
|
});
|
||||||
|
beforeEach(async () => {
|
||||||
|
await blockchainLifecycle.startAsync();
|
||||||
|
});
|
||||||
|
afterEach(async () => {
|
||||||
|
await blockchainLifecycle.revertAsync();
|
||||||
|
});
|
||||||
describe('transfer', () => {
|
describe('transfer', () => {
|
||||||
it('should throw if owner has insufficient balance', async () => {
|
it('should throw if owner has insufficient balance', async () => {
|
||||||
const ownerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner);
|
const ownerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user