Get networkId from web3Wrapper

This commit is contained in:
Fabio Berger
2018-05-11 15:23:50 +02:00
parent 461e74d8be
commit 657dc785ea
2 changed files with 3 additions and 3 deletions

View File

@@ -1,4 +1,3 @@
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
TEST_RPC_NETWORK_ID: 50,
};

View File

@@ -234,9 +234,10 @@ export class FillScenarios {
this._web3Wrapper.getProvider(),
this._web3Wrapper.getContractDefaults(),
);
const networkArtifactsIfExists = artifacts.TokenTransferProxy.networks[constants.TEST_RPC_NETWORK_ID];
const networkId = await this._web3Wrapper.getNetworkIdAsync();
const networkArtifactsIfExists = artifacts.TokenTransferProxy.networks[networkId];
if (_.isUndefined(networkArtifactsIfExists)) {
throw new Error(`Did not find network artifacts for networkId: ${constants.TEST_RPC_NETWORK_ID}`);
throw new Error(`Did not find network artifacts for networkId: ${networkId}`);
}
const proxyAddress = networkArtifactsIfExists.address;
const oldMakerAllowance = await tokenInstance.allowance.callAsync(address, proxyAddress);