From d789aa24aa2c9f4e0d17a382fe9cb8d56ab27957 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Jun 2017 17:05:03 +0200 Subject: Make ZeroEx constructor accept Web3Provider instead of Web3 instance --- test/0x.js_test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/0x.js_test.ts') diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts index 58f5c8533..005b9fa0c 100644 --- a/test/0x.js_test.ts +++ b/test/0x.js_test.ts @@ -15,7 +15,7 @@ describe('ZeroEx library', () => { describe('#setProvider', () => { it('overrides provider in nested web3s and invalidates contractInstances', async () => { const web3 = web3Factory.create(); - const zeroEx = new ZeroEx(web3); + const zeroEx = new ZeroEx(web3.currentProvider); // Instantiate the contract instances with the current provider await (zeroEx.exchange as any)._getExchangeContractAsync(); await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync(); @@ -51,7 +51,7 @@ describe('ZeroEx library', () => { }; const address = '0x5409ed021d9299bf6814279a6a1411a7e866a631'; const web3 = web3Factory.create(); - const zeroEx = new ZeroEx(web3); + const zeroEx = new ZeroEx(web3.currentProvider); it('should return false if the data doesn\'t pertain to the signature & address', async () => { expect(ZeroEx.isValidSignature('0x0', signature, address)).to.be.false(); return expect( @@ -149,7 +149,7 @@ describe('ZeroEx library', () => { }); it('calculates the order hash', async () => { const web3 = web3Factory.create(); - const zeroEx = new ZeroEx(web3); + const zeroEx = new ZeroEx(web3.currentProvider); stubs = [ Sinon.stub((zeroEx as any), '_getExchangeAddressAsync') -- cgit v1.2.3 From 38170a24eda03884c19610bc094d3855568e3704 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Jun 2017 17:34:54 +0200 Subject: Fix bug in 0x.js tests when passing Web3 instead of Web3 Provider --- test/0x.js_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/0x.js_test.ts') diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts index 005b9fa0c..9ec0a0c8e 100644 --- a/test/0x.js_test.ts +++ b/test/0x.js_test.ts @@ -164,7 +164,7 @@ describe('ZeroEx library', () => { let stubs: Sinon.SinonStub[] = []; let makerAddress: string; const web3 = web3Factory.create(); - const zeroEx = new ZeroEx(web3); + const zeroEx = new ZeroEx(web3.currentProvider); before(async () => { const availableAddreses = await zeroEx.getAvailableAddressesAsync(); makerAddress = availableAddreses[0]; -- cgit v1.2.3