From 518efa8ad2765b3664ad1b5433c56a82cc7c50be Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Feb 2018 17:29:10 -0800 Subject: Move isTestNetwork into utils and also check it from showing ZRX request button --- packages/website/ts/utils/utils.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 7e69b1c5f..a7865d41b 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -282,4 +282,15 @@ export const utils = { isTestRpc(nodeVersion: string): boolean { return _.includes(nodeVersion, 'TestRPC'); }, + isTestNetwork(networkId: number): boolean { + const isTestNetwork = _.includes( + [ + constants.NETWORK_ID_BY_NAME[Networks.Kovan], + constants.NETWORK_ID_BY_NAME[Networks.Rinkeby], + constants.NETWORK_ID_BY_NAME[Networks.Ropsten], + ], + networkId, + ); + return isTestNetwork; + }, }; -- cgit