From 73099b38d632df82b82d7aa25abf7b5e83d13e61 Mon Sep 17 00:00:00 2001 From: apanizo Date: Thu, 16 Aug 2018 13:43:35 +0200 Subject: [PATCH] WA-521 Adding a feature flag for kwnowing when modules are accepted in TX-history service --- src/config/development.js | 3 ++- src/config/index.js | 8 +++++++- src/config/names.js | 1 + src/config/production.js | 3 ++- src/config/testing.js | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/config/development.js b/src/config/development.js index 8bb33afc..b1207463 100644 --- a/src/config/development.js +++ b/src/config/development.js @@ -1,8 +1,9 @@ // @flow -import { TX_SERVICE_HOST } from '~/config/names' +import { TX_SERVICE_HOST, ENABLED_TX_SERVICE_MODULES } from '~/config/names' const devConfig = { [TX_SERVICE_HOST]: 'https://safe-transaction-history.dev.gnosisdev.com/api/v1/', + [ENABLED_TX_SERVICE_MODULES]: false, } export default devConfig diff --git a/src/config/index.js b/src/config/index.js index 66afd2c3..aa480a2a 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -1,6 +1,6 @@ // @flow import { ensureOnce } from '~/utils/singleton' -import { TX_SERVICE_HOST } from '~/config/names' +import { TX_SERVICE_HOST, ENABLED_TX_SERVICE_MODULES } from '~/config/names' import devConfig from './development' import testConfig from './testing' import prodConfig from './production' @@ -26,3 +26,9 @@ export const getTxServiceHost = () => { } export const getTxServiceUriFrom = (safeAddress: string) => `safes/${safeAddress}/transactions/` + +export const allowedModulesInTxHistoryService = () => { + const config = getConfig() + + return config[ENABLED_TX_SERVICE_MODULES] +} diff --git a/src/config/names.js b/src/config/names.js index 5e00aa0d..2063af10 100644 --- a/src/config/names.js +++ b/src/config/names.js @@ -1,3 +1,4 @@ // @flow export const TX_SERVICE_HOST = 'tsh' +export const ENABLED_TX_SERVICE_MODULES = 'tsm' diff --git a/src/config/production.js b/src/config/production.js index 7fcb5556..840fd0bb 100644 --- a/src/config/production.js +++ b/src/config/production.js @@ -1,8 +1,9 @@ // @flow -import { TX_SERVICE_HOST } from '~/config/names' +import { TX_SERVICE_HOST, ENABLED_TX_SERVICE_MODULES } from '~/config/names' const prodConfig = { [TX_SERVICE_HOST]: 'https://safe-transaction-history.dev.gnosisdev.com/api/v1/', + [ENABLED_TX_SERVICE_MODULES]: false, } export default prodConfig diff --git a/src/config/testing.js b/src/config/testing.js index b1b55759..4e8f1a4a 100644 --- a/src/config/testing.js +++ b/src/config/testing.js @@ -1,8 +1,9 @@ // @flow -import { TX_SERVICE_HOST } from '~/config/names' +import { TX_SERVICE_HOST, ENABLED_TX_SERVICE_MODULES } from '~/config/names' const testConfig = { [TX_SERVICE_HOST]: 'http://localhost:8000/api/v1/', + [ENABLED_TX_SERVICE_MODULES]: false, } export default testConfig