aboutsummaryrefslogtreecommitdiffstats
path: root/test/0x.js_test.ts
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-09-06 16:35:19 +0800
committerGitHub <noreply@github.com>2017-09-06 16:35:19 +0800
commit35c133caeda613121d7d90f3f1347ebdc8087d66 (patch)
tree6156865472010078a9f27b905bcaec7782f6521c /test/0x.js_test.ts
parent18a52a1ea758ee5640680f1097eba1ce9a9e81fc (diff)
parentf0a5ad2d2063fe8ba4682147ec2f73e2763b0275 (diff)
downloaddexon-0x-contracts-35c133caeda613121d7d90f3f1347ebdc8087d66.tar
dexon-0x-contracts-35c133caeda613121d7d90f3f1347ebdc8087d66.tar.gz
dexon-0x-contracts-35c133caeda613121d7d90f3f1347ebdc8087d66.tar.bz2
dexon-0x-contracts-35c133caeda613121d7d90f3f1347ebdc8087d66.tar.lz
dexon-0x-contracts-35c133caeda613121d7d90f3f1347ebdc8087d66.tar.xz
dexon-0x-contracts-35c133caeda613121d7d90f3f1347ebdc8087d66.tar.zst
dexon-0x-contracts-35c133caeda613121d7d90f3f1347ebdc8087d66.zip
Merge branch 'development' into fix/signature-verification
Diffstat (limited to 'test/0x.js_test.ts')
-rw-r--r--test/0x.js_test.ts28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts
index 2b4e80ea3..c453b8dab 100644
--- a/test/0x.js_test.ts
+++ b/test/0x.js_test.ts
@@ -6,8 +6,11 @@ import * as BigNumber from 'bignumber.js';
import * as Sinon from 'sinon';
import {ZeroEx, Order} from '../src';
import {constants} from './utils/constants';
+import {TokenUtils} from './utils/token_utils';
import {web3Factory} from './utils/web3_factory';
+import {BlockchainLifecycle} from './utils/blockchain_lifecycle';
+const blockchainLifecycle = new BlockchainLifecycle();
chaiSetup.configure();
const expect = chai.expect;
@@ -204,4 +207,29 @@ describe('ZeroEx library', () => {
expect(ecSignature).to.deep.equal(expectedECSignature);
});
});
+ describe('#awaitTransactionMinedAsync', () => {
+ beforeEach(async () => {
+ await blockchainLifecycle.startAsync();
+ });
+ afterEach(async () => {
+ await blockchainLifecycle.revertAsync();
+ });
+ it('returns transaction receipt with decoded logs', async () => {
+ const availableAddresses = await zeroEx.getAvailableAddressesAsync();
+ const coinbase = availableAddresses[0];
+ const tokens = await zeroEx.tokenRegistry.getTokensAsync();
+ const tokenUtils = new TokenUtils(tokens);
+ const zrxTokenAddress = tokenUtils.getProtocolTokenOrThrow().address;
+ const proxyAddress = await zeroEx.proxy.getContractAddressAsync();
+ const txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(zrxTokenAddress, coinbase);
+ const txReceiptWithDecodedLogs = await zeroEx.awaitTransactionMinedAsync(txHash);
+ const log = txReceiptWithDecodedLogs.logs[0];
+ expect(log.event).to.be.equal('Approval');
+ expect(log.args).to.be.deep.equal({
+ _owner: coinbase,
+ _spender: proxyAddress,
+ _value: zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS.toString(),
+ });
+ });
+ });
});