Remove accounts magic from tests

This commit is contained in:
Leonid Logvinov
2018-01-30 14:06:43 +01:00
parent 6205209fbb
commit 5a4c0bff6a
3 changed files with 4 additions and 8 deletions

View File

@@ -54,9 +54,7 @@ describe('Exchange', () => {
before(async () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
maker = accounts[0];
tokenOwner = accounts[0];
taker = accounts[1] || accounts[accounts.length - 1];
feeRecipient = accounts[2] || accounts[accounts.length - 1];
[tokenOwner, taker, feeRecipient] = accounts;
[rep, dgd, zrx] = await Promise.all([
deployer.deployAsync(ContractName.DummyToken),
deployer.deployAsync(ContractName.DummyToken),

View File

@@ -30,8 +30,7 @@ describe('Exchange', () => {
before(async () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
maker = accounts[0];
feeRecipient = accounts[1] || accounts[accounts.length - 1];
[maker, feeRecipient] = accounts;
const tokenRegistry = await deployer.deployAsync(ContractName.TokenRegistry);
const tokenTransferProxy = await deployer.deployAsync(ContractName.TokenTransferProxy);
const [rep, dgd, zrx] = await Promise.all([

View File

@@ -45,9 +45,8 @@ describe('Exchange', () => {
before(async () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
tokenOwner = maker = accounts[0];
taker = accounts[1] || accounts[accounts.length - 1];
feeRecipient = accounts[2] || accounts[accounts.length - 1];
tokenOwner = accounts[0];
[maker, taker, feeRecipient] = accounts;
[rep, dgd, zrx] = await Promise.all([
deployer.deployAsync(ContractName.DummyToken),
deployer.deployAsync(ContractName.DummyToken),