From f53472e7170798f56ea4837c310cfd4188326af8 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 26 Oct 2017 12:50:02 +0300 Subject: Add initial mempool watching implememtation --- test/token_wrapper_test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/token_wrapper_test.ts') diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index b35fa43f9..2f6f126c1 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -17,6 +17,7 @@ import { TokenContractEventArgs, LogWithDecodedArgs, LogEvent, + DecodedLogEvent, } from '../src'; import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; import {TokenUtils} from './utils/token_utils'; @@ -358,7 +359,7 @@ describe('TokenWrapper', () => { // Source: https://github.com/mochajs/mocha/issues/2407 it('Should receive the Transfer event when tokens are transfered', (done: DoneCallback) => { (async () => { - const callback = (logEvent: LogEvent) => { + const callback = (logEvent: DecodedLogEvent) => { expect(logEvent).to.not.be.undefined(); const args = logEvent.args; expect(args._from).to.be.equal(coinbase); @@ -373,7 +374,7 @@ describe('TokenWrapper', () => { }); it('Should receive the Approval event when allowance is being set', (done: DoneCallback) => { (async () => { - const callback = (logEvent: LogEvent) => { + const callback = (logEvent: DecodedLogEvent) => { expect(logEvent).to.not.be.undefined(); const args = logEvent.args; expect(args._owner).to.be.equal(coinbase); @@ -388,13 +389,13 @@ describe('TokenWrapper', () => { }); it('Outstanding subscriptions are cancelled when zeroEx.setProviderAsync called', (done: DoneCallback) => { (async () => { - const callbackNeverToBeCalled = (logEvent: LogEvent) => { + const callbackNeverToBeCalled = (logEvent: DecodedLogEvent) => { done(new Error('Expected this subscription to have been cancelled')); }; zeroEx.token.subscribe( tokenAddress, TokenEvents.Transfer, indexFilterValues, callbackNeverToBeCalled, ); - const callbackToBeCalled = (logEvent: LogEvent) => { + const callbackToBeCalled = (logEvent: DecodedLogEvent) => { done(); }; const newProvider = web3Factory.getRpcProvider(); @@ -407,7 +408,7 @@ describe('TokenWrapper', () => { }); it('Should cancel subscription when unsubscribe called', (done: DoneCallback) => { (async () => { - const callbackNeverToBeCalled = (logEvent: LogEvent) => { + const callbackNeverToBeCalled = (logEvent: DecodedLogEvent) => { done(new Error('Expected this subscription to have been cancelled')); }; const subscriptionToken = zeroEx.token.subscribe( -- cgit v1.2.3 From a8585df81bed4a1d4da8b0bb1f50e7f6e39c73ad Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 9 Nov 2017 10:21:38 -0500 Subject: Fix tests by making the expected balance be 2^27 not 2^26 --- test/token_wrapper_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/token_wrapper_test.ts') diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 2f6f126c1..23020c47a 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -162,7 +162,7 @@ describe('TokenWrapper', () => { const token = tokens[0]; const ownerAddress = coinbase; const balance = await zeroEx.token.getBalanceAsync(token.address, ownerAddress); - const expectedBalance = new BigNumber('100000000000000000000000000'); + const expectedBalance = new BigNumber('1000000000000000000000000000'); return expect(balance).to.be.bignumber.equal(expectedBalance); }); it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => { @@ -190,7 +190,7 @@ describe('TokenWrapper', () => { const token = tokens[0]; const ownerAddress = coinbase; const balance = await zeroExWithoutAccounts.token.getBalanceAsync(token.address, ownerAddress); - const expectedBalance = new BigNumber('100000000000000000000000000'); + const expectedBalance = new BigNumber('1000000000000000000000000000'); return expect(balance).to.be.bignumber.equal(expectedBalance); }); }); -- cgit v1.2.3 From cd3c7f1b97471ea8f64a9696d5c4134fff34eb58 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 9 Nov 2017 17:14:01 -0500 Subject: Revert test amount changes --- test/token_wrapper_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/token_wrapper_test.ts') diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 23020c47a..2f6f126c1 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -162,7 +162,7 @@ describe('TokenWrapper', () => { const token = tokens[0]; const ownerAddress = coinbase; const balance = await zeroEx.token.getBalanceAsync(token.address, ownerAddress); - const expectedBalance = new BigNumber('1000000000000000000000000000'); + const expectedBalance = new BigNumber('100000000000000000000000000'); return expect(balance).to.be.bignumber.equal(expectedBalance); }); it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => { @@ -190,7 +190,7 @@ describe('TokenWrapper', () => { const token = tokens[0]; const ownerAddress = coinbase; const balance = await zeroExWithoutAccounts.token.getBalanceAsync(token.address, ownerAddress); - const expectedBalance = new BigNumber('1000000000000000000000000000'); + const expectedBalance = new BigNumber('100000000000000000000000000'); return expect(balance).to.be.bignumber.equal(expectedBalance); }); }); -- cgit v1.2.3 From 4e708c81ca3309e1ac9ac195e3169c09d5358abb Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 11 Nov 2017 09:19:51 -0500 Subject: Fix expected balance --- test/token_wrapper_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/token_wrapper_test.ts') diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 2f6f126c1..23020c47a 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -162,7 +162,7 @@ describe('TokenWrapper', () => { const token = tokens[0]; const ownerAddress = coinbase; const balance = await zeroEx.token.getBalanceAsync(token.address, ownerAddress); - const expectedBalance = new BigNumber('100000000000000000000000000'); + const expectedBalance = new BigNumber('1000000000000000000000000000'); return expect(balance).to.be.bignumber.equal(expectedBalance); }); it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => { @@ -190,7 +190,7 @@ describe('TokenWrapper', () => { const token = tokens[0]; const ownerAddress = coinbase; const balance = await zeroExWithoutAccounts.token.getBalanceAsync(token.address, ownerAddress); - const expectedBalance = new BigNumber('100000000000000000000000000'); + const expectedBalance = new BigNumber('1000000000000000000000000000'); return expect(balance).to.be.bignumber.equal(expectedBalance); }); }); -- cgit v1.2.3