Rename networkId to networkIdIfExists

This commit is contained in:
Leonid Logvinov
2017-07-06 15:43:35 -07:00
parent 0f3f557e0b
commit 90ddfe58a9

View File

@@ -13,13 +13,13 @@ describe('Web3Wrapper', () => {
it('caches network id requests', async () => { it('caches network id requests', async () => {
const web3Wrapper = (new ZeroEx(web3Provider) as any)._web3Wrapper as Web3Wrapper; const web3Wrapper = (new ZeroEx(web3Provider) as any)._web3Wrapper as Web3Wrapper;
expect((web3Wrapper as any).networkIdIfExists).to.be.undefined(); expect((web3Wrapper as any).networkIdIfExists).to.be.undefined();
const networkId = await web3Wrapper.getNetworkIdIfExistsAsync(); const networkIdIfExists = await web3Wrapper.getNetworkIdIfExistsAsync();
expect((web3Wrapper as any).networkIdIfExists).to.be.equal(constants.TESTRPC_NETWORK_ID); expect((web3Wrapper as any).networkIdIfExists).to.be.equal(constants.TESTRPC_NETWORK_ID);
}); });
it('invalidates network id cache on setProvider call', async () => { it('invalidates network id cache on setProvider call', async () => {
const web3Wrapper = (new ZeroEx(web3Provider) as any)._web3Wrapper as Web3Wrapper; const web3Wrapper = (new ZeroEx(web3Provider) as any)._web3Wrapper as Web3Wrapper;
expect((web3Wrapper as any).networkIdIfExists).to.be.undefined(); expect((web3Wrapper as any).networkIdIfExists).to.be.undefined();
const networkId = await web3Wrapper.getNetworkIdIfExistsAsync(); const networkIdIfExists = await web3Wrapper.getNetworkIdIfExistsAsync();
expect((web3Wrapper as any).networkIdIfExists).to.be.equal(constants.TESTRPC_NETWORK_ID); expect((web3Wrapper as any).networkIdIfExists).to.be.equal(constants.TESTRPC_NETWORK_ID);
const newProvider = web3Factory.create().currentProvider; const newProvider = web3Factory.create().currentProvider;
web3Wrapper.setProvider(newProvider); web3Wrapper.setProvider(newProvider);