From 6c90034b6b69ca481aa7ef00fcd99c6e91e2ec33 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Thu, 20 Oct 2022 13:25:16 +0200 Subject: [PATCH] fix(@test): token override --- src/app_service/common/network_constants.nim | 71 ++++++++++++-------- vendor/status-go | 2 +- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/app_service/common/network_constants.nim b/src/app_service/common/network_constants.nim index e16a7b6a00..e222546161 100644 --- a/src/app_service/common/network_constants.nim +++ b/src/app_service/common/network_constants.nim @@ -13,23 +13,52 @@ let INFURA_TOKEN_RESOLVED = INFURA_TOKEN const GOERLI_NETWORK_RPC_URL = $getEnv("GOERLI_NETWORK_RPC_URL") -let OVERRIDE_TOKENS = - if GOERLI_NETWORK_RPC_URL != "": - @[ - { - "symbol": "STT", - "address": "0x8571Ddc46b10d31EF963aF49b6C7799Ea7eff818" - } - ] - else: - @[] - let GOERLI_RPC_URL_RESOLVED = if GOERLI_NETWORK_RPC_URL != "": GOERLI_NETWORK_RPC_URL else: "https://goerli.infura.io/v3/" & INFURA_TOKEN_RESOLVED +let GOERLI_CONFIG = + if GOERLI_NETWORK_RPC_URL != "": + %* { + "chainId": 5, + "chainName": "Goerli", + "rpcUrl": GOERLI_RPC_URL_RESOLVED, + "blockExplorerUrl": "https://goerli.etherscan.io/", + "iconUrl": "network/Network=Testnet", + "chainColor": "#939BA1", + "shortName": "goeEth", + "nativeCurrencyName": "Ether", + "nativeCurrencySymbol": "ETH", + "nativeCurrencyDecimals": 18, + "isTest": true, + "layer": 1, + "enabled": true, + "tokenOverrides": [ + { + "symbol": "STT", + "address": "0x8571Ddc46b10d31EF963aF49b6C7799Ea7eff818" + } + ] + } + else: + %* { + "chainId": 5, + "chainName": "Goerli", + "rpcUrl": GOERLI_RPC_URL_RESOLVED, + "blockExplorerUrl": "https://goerli.etherscan.io/", + "iconUrl": "network/Network=Testnet", + "chainColor": "#939BA1", + "shortName": "goeEth", + "nativeCurrencyName": "Ether", + "nativeCurrencySymbol": "ETH", + "nativeCurrencyDecimals": 18, + "isTest": true, + "layer": 1, + "enabled": true, + } + const OPENSEA_API_KEY {.strdefine.} = "" # allow runtime override via environment variable; core contributors can set a # an opensea API key in this way for local development @@ -61,22 +90,6 @@ let NETWORKS* = %* [ "layer": 1, "enabled": true, }, - { - "chainId": 5, - "chainName": "Goerli", - "rpcUrl": GOERLI_RPC_URL_RESOLVED, - "blockExplorerUrl": "https://goerli.etherscan.io/", - "iconUrl": "network/Network=Testnet", - "chainColor": "#939BA1", - "shortName": "goeEth", - "nativeCurrencyName": "Ether", - "nativeCurrencySymbol": "ETH", - "nativeCurrencyDecimals": 18, - "isTest": true, - "layer": 1, - "enabled": true, - "overrideTokens": OVERRIDE_TOKENS.toJson - }, { "chainId": 10, "chainName": "Optimism", @@ -139,6 +152,8 @@ let NETWORKS* = %* [ } ] +NETWORKS.elems.add(GOERLI_CONFIG) + var NODE_CONFIG* = %* { "BrowsersConfig": { "Enabled": true @@ -227,4 +242,4 @@ var NODE_CONFIG* = %* { "DataDir": DEFAULT_TORRENT_CONFIG_DATADIR, "TorrentDir": DEFAULT_TORRENT_CONFIG_TORRENTDIR } -} +} \ No newline at end of file diff --git a/vendor/status-go b/vendor/status-go index 616a58f5c9..37c9eb1a9d 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit 616a58f5c9a82073ac7911a307515c071d59ea43 +Subproject commit 37c9eb1a9d3f539a0beec7ed7fa371012318cbdd