aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-11-23 03:37:07 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-24 05:13:37 +0800
commita38ef3655b47228c2cc949d917636a19d7e0dddc (patch)
tree5f091e4942e702f714eed23c36adfc2f98c0b003 /packages/0x.js/test
parentc586d3e81d0b03f57924b4dc885bc97d152b09e2 (diff)
downloaddexon-sol-tools-a38ef3655b47228c2cc949d917636a19d7e0dddc.tar
dexon-sol-tools-a38ef3655b47228c2cc949d917636a19d7e0dddc.tar.gz
dexon-sol-tools-a38ef3655b47228c2cc949d917636a19d7e0dddc.tar.bz2
dexon-sol-tools-a38ef3655b47228c2cc949d917636a19d7e0dddc.tar.lz
dexon-sol-tools-a38ef3655b47228c2cc949d917636a19d7e0dddc.tar.xz
dexon-sol-tools-a38ef3655b47228c2cc949d917636a19d7e0dddc.tar.zst
dexon-sol-tools-a38ef3655b47228c2cc949d917636a19d7e0dddc.zip
Remove even more asyncs
Diffstat (limited to 'packages/0x.js/test')
-rw-r--r--packages/0x.js/test/0x.js_test.ts9
-rw-r--r--packages/0x.js/test/ether_token_wrapper_test.ts2
-rw-r--r--packages/0x.js/test/token_wrapper_test.ts4
3 files changed, 7 insertions, 8 deletions
diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts
index 95a8b027d..ba7a92fe4 100644
--- a/packages/0x.js/test/0x.js_test.ts
+++ b/packages/0x.js/test/0x.js_test.ts
@@ -223,7 +223,7 @@ describe('ZeroEx library', () => {
const tokens = await zeroEx.tokenRegistry.getTokensAsync();
const tokenUtils = new TokenUtils(tokens);
const zrxTokenAddress = tokenUtils.getProtocolTokenOrThrow().address;
- const proxyAddress = await zeroEx.proxy.getContractAddressAsync();
+ const proxyAddress = zeroEx.proxy.getContractAddress();
const txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(zrxTokenAddress, coinbase);
const txReceiptWithDecodedLogs = await zeroEx.awaitTransactionMinedAsync(txHash);
const log = txReceiptWithDecodedLogs.logs[0] as LogWithDecodedArgs<ApprovalContractEventArgs>;
@@ -248,8 +248,7 @@ describe('ZeroEx library', () => {
networkId: constants.TESTRPC_NETWORK_ID,
};
const zeroExWithWrongEtherTokenAddress = new ZeroEx(web3.currentProvider, zeroExConfig);
- return expect(zeroExWithWrongEtherTokenAddress.etherToken.getContractAddressAsync())
- .to.be.rejectedWith(ZeroExError.ContractDoesNotExist);
+ expect(zeroExWithWrongEtherTokenAddress.etherToken.getContractAddress()).to.be.equal(ZeroEx.NULL_ADDRESS);
});
it('allows to specify token registry token contract address', async () => {
const zeroExConfig = {
@@ -257,8 +256,8 @@ describe('ZeroEx library', () => {
networkId: constants.TESTRPC_NETWORK_ID,
};
const zeroExWithWrongTokenRegistryAddress = new ZeroEx(web3.currentProvider, zeroExConfig);
- return expect(zeroExWithWrongTokenRegistryAddress.tokenRegistry.getContractAddressAsync())
- .to.be.rejectedWith(ZeroExError.ContractDoesNotExist);
+ expect(zeroExWithWrongTokenRegistryAddress.tokenRegistry.getContractAddress())
+ .to.be.equal(ZeroEx.NULL_ADDRESS);
});
});
});
diff --git a/packages/0x.js/test/ether_token_wrapper_test.ts b/packages/0x.js/test/ether_token_wrapper_test.ts
index d2408938c..b86e79054 100644
--- a/packages/0x.js/test/ether_token_wrapper_test.ts
+++ b/packages/0x.js/test/ether_token_wrapper_test.ts
@@ -36,7 +36,7 @@ describe('EtherTokenWrapper', () => {
zeroEx = new ZeroEx(web3.currentProvider, zeroExConfig);
userAddresses = await zeroEx.getAvailableAddressesAsync();
addressWithETH = userAddresses[0];
- wethContractAddress = await zeroEx.etherToken.getContractAddressAsync();
+ wethContractAddress = zeroEx.etherToken.getContractAddress();
depositWeiAmount = (zeroEx as any)._web3Wrapper.toWei(new BigNumber(5));
decimalPlaces = 7;
});
diff --git a/packages/0x.js/test/token_wrapper_test.ts b/packages/0x.js/test/token_wrapper_test.ts
index 170dae6a6..b07fed045 100644
--- a/packages/0x.js/test/token_wrapper_test.ts
+++ b/packages/0x.js/test/token_wrapper_test.ts
@@ -436,10 +436,10 @@ describe('TokenWrapper', () => {
toBlock: BlockParamLiteral.Latest,
};
let txHash: string;
- before(async () => {
+ before(() => {
const token = tokens[0];
tokenAddress = token.address;
- tokenTransferProxyAddress = await zeroEx.proxy.getContractAddressAsync();
+ tokenTransferProxyAddress = zeroEx.proxy.getContractAddress();
});
it('should get logs with decoded args emitted by Approval', async () => {
txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(tokenAddress, coinbase);