From 255da32d290cbf6258ddfc49d875abcf32322673 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Thu, 4 Oct 2018 16:56:01 -0700 Subject: Update testnet-faucets and website to work with new artifacts and abi-gen wrappers --- packages/testnet-faucets/src/ts/handler.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'packages/testnet-faucets/src/ts') diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index be42ebde8..b2d2226f4 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -65,7 +65,21 @@ export class Handler { const web3Wrapper = new Web3Wrapper(providerObj); // tslint:disable-next-line:custom-no-magic-numbers const networkId = parseInt(networkIdString, 10); - const contractWrappers = new ContractWrappers(providerObj, { networkId }); + const contractWrappersConfig = { + networkId, + // TODO(albrow): Load in real contract addresses here. + contractAddresses: { + erc20Proxy: '', + erc721Proxy: '', + zrxToken: '', + etherToken: '', + exchange: '', + assetProxyOwner: '', + forwarder: '', + orderValidator: '', + }, + }; + const contractWrappers = new ContractWrappers(providerObj, contractWrappersConfig); const dispatchQueue = new DispatchQueue(); this._networkConfigByNetworkId[networkId] = { dispatchQueue, @@ -172,7 +186,7 @@ export class Handler { makerAssetData, takerAssetData, salt: generatePseudoRandomSalt(), - exchangeAddress: networkConfig.contractWrappers.exchange.getContractAddress(), + exchangeAddress: networkConfig.contractWrappers.exchange.address, feeRecipientAddress: NULL_ADDRESS, senderAddress: NULL_ADDRESS, // tslint:disable-next-line:custom-no-magic-numbers -- cgit v1.2.3 From 1e9ea09f087c7b3120e758d931a88812b655da08 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 9 Oct 2018 23:10:33 -0700 Subject: Introduce new contract-addresses package and use it everywhere --- packages/testnet-faucets/src/ts/handler.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'packages/testnet-faucets/src/ts') diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index b2d2226f4..262f6d889 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -11,6 +11,7 @@ import { SignedOrder, Web3ProviderEngine, } from '0x.js'; +import { getContractAddressesForNetwork } from '@0xproject/contract-addresses'; import { NonceTrackerSubprovider, PrivateKeyWalletSubprovider } from '@0xproject/subproviders'; import { logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -67,17 +68,7 @@ export class Handler { const networkId = parseInt(networkIdString, 10); const contractWrappersConfig = { networkId, - // TODO(albrow): Load in real contract addresses here. - contractAddresses: { - erc20Proxy: '', - erc721Proxy: '', - zrxToken: '', - etherToken: '', - exchange: '', - assetProxyOwner: '', - forwarder: '', - orderValidator: '', - }, + contractAddresses: getContractAddressesForNetwork(networkId), }; const contractWrappers = new ContractWrappers(providerObj, contractWrappersConfig); const dispatchQueue = new DispatchQueue(); -- cgit v1.2.3 From 974ec23ecd2a445523e0550c0a7f69329d6959f1 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 10 Oct 2018 16:04:37 -0700 Subject: Apply various PR feedback --- packages/testnet-faucets/src/ts/handler.ts | 2 -- 1 file changed, 2 deletions(-) (limited to 'packages/testnet-faucets/src/ts') diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index 262f6d889..5cc52e489 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -11,7 +11,6 @@ import { SignedOrder, Web3ProviderEngine, } from '0x.js'; -import { getContractAddressesForNetwork } from '@0xproject/contract-addresses'; import { NonceTrackerSubprovider, PrivateKeyWalletSubprovider } from '@0xproject/subproviders'; import { logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; @@ -68,7 +67,6 @@ export class Handler { const networkId = parseInt(networkIdString, 10); const contractWrappersConfig = { networkId, - contractAddresses: getContractAddressesForNetwork(networkId), }; const contractWrappers = new ContractWrappers(providerObj, contractWrappersConfig); const dispatchQueue = new DispatchQueue(); -- cgit v1.2.3