From efd641226648d6773785342e08627a23d3bdf06d Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 18 Apr 2022 11:08:17 +0200 Subject: [PATCH] fix(@wallet): Token not displayed after upgrade fixes #5563 --- src/app_service/common/network_constants.nim | 136 ++++++++++--------- src/app_service/service/accounts/service.nim | 3 +- 2 files changed, 71 insertions(+), 68 deletions(-) diff --git a/src/app_service/common/network_constants.nim b/src/app_service/common/network_constants.nim index 05e0e7960c..cc6a00d05e 100644 --- a/src/app_service/common/network_constants.nim +++ b/src/app_service/common/network_constants.nim @@ -109,6 +109,74 @@ let DEFAULT_NETWORKS* = %* [ } ] +let NETWORKS* = %* [ + { + "chainId": 1, + "chainName": "Ethereum Mainnet", + "rpcUrl": "https://mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED, + "blockExplorerUrl": "https://etherscan.io/", + "iconUrl": "", + "nativeCurrencyName": "Ether", + "nativeCurrencySymbol": "ETH", + "nativeCurrencyDecimals": 18, + "isTest": false, + "layer": 1, + "enabled": true, + }, + { + "chainId": 3, + "chainName": "Ethereum Ropsten", + "rpcUrl": "https://ropsten.infura.io/v3/" & INFURA_TOKEN_RESOLVED, + "blockExplorerUrl": "https://ropsten.etherscan.io/", + "iconUrl": "", + "nativeCurrencyName": "Ether", + "nativeCurrencySymbol": "ETH", + "nativeCurrencyDecimals": 18, + "isTest": true, + "layer": 1, + "enabled": false, + }, + { + "chainId": 4, + "chainName": "Ethereum Rinkeby", + "rpcUrl": "https://rinkeby.infura.io/v3/" & INFURA_TOKEN_RESOLVED, + "blockExplorerUrl": "https://rinkeby.etherscan.io/", + "iconUrl": "", + "nativeCurrencyName": "Ether", + "nativeCurrencySymbol": "ETH", + "nativeCurrencyDecimals": 18, + "isTest": true, + "layer": 1, + "enabled": false, + }, + { + "chainId": 5, + "chainName": "Ethereum Goerli", + "rpcUrl": "http://goerli.blockscout.com/", + "blockExplorerUrl": "https://goerli.etherscan.io/", + "iconUrl": "", + "nativeCurrencyName": "Ether", + "nativeCurrencySymbol": "ETH", + "nativeCurrencyDecimals": 18, + "isTest": true, + "layer": 1, + "enabled": false, + }, + { + "chainId": 10, + "chainName": "Optimistic Ethereum", + "rpcUrl": "https://optimism-mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED, + "blockExplorerUrl": "https://optimistic.etherscan.io", + "iconUrl": "", + "nativeCurrencyName": "Ether", + "nativeCurrencySymbol": "ETH", + "nativeCurrencyDecimals": 18, + "isTest": false, + "layer": 2, + "enabled": true, + } +] + var NODE_CONFIG* = %* { "BrowsersConfig": { "Enabled": true @@ -191,73 +259,7 @@ var NODE_CONFIG* = %* { "EnsConfig": { "Enabled": true }, - "Networks": [ - { - "chainId": 1, - "chainName": "Ethereum Mainnet", - "rpcUrl": "https://mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED, - "blockExplorerUrl": "https://etherscan.io/", - "iconUrl": "", - "nativeCurrencyName": "Ether", - "nativeCurrencySymbol": "ETH", - "nativeCurrencyDecimals": 18, - "isTest": false, - "layer": 1, - "enabled": true, - }, - { - "chainId": 3, - "chainName": "Ethereum Ropsten", - "rpcUrl": "https://ropsten.infura.io/v3/" & INFURA_TOKEN_RESOLVED, - "blockExplorerUrl": "https://ropsten.etherscan.io/", - "iconUrl": "", - "nativeCurrencyName": "Ether", - "nativeCurrencySymbol": "ETH", - "nativeCurrencyDecimals": 18, - "isTest": true, - "layer": 1, - "enabled": false, - }, - { - "chainId": 4, - "chainName": "Ethereum Rinkeby", - "rpcUrl": "https://rinkeby.infura.io/v3/" & INFURA_TOKEN_RESOLVED, - "blockExplorerUrl": "https://rinkeby.etherscan.io/", - "iconUrl": "", - "nativeCurrencyName": "Ether", - "nativeCurrencySymbol": "ETH", - "nativeCurrencyDecimals": 18, - "isTest": true, - "layer": 1, - "enabled": false, - }, - { - "chainId": 5, - "chainName": "Ethereum Goerli", - "rpcUrl": "http://goerli.blockscout.com/", - "blockExplorerUrl": "https://goerli.etherscan.io/", - "iconUrl": "", - "nativeCurrencyName": "Ether", - "nativeCurrencySymbol": "ETH", - "nativeCurrencyDecimals": 18, - "isTest": true, - "layer": 1, - "enabled": false, - }, - { - "chainId": 10, - "chainName": "Optimistic Ethereum", - "rpcUrl": "https://optimism-mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED, - "blockExplorerUrl": "https://optimistic.etherscan.io", - "iconUrl": "", - "nativeCurrencyName": "Ether", - "nativeCurrencySymbol": "ETH", - "nativeCurrencyDecimals": 18, - "isTest": false, - "layer": 2, - "enabled": true, - } - ], + "Networks": Networks, "TorrentConfig": { "Enabled": false, "Port": DEFAULT_TORRENT_CONFIG_PORT, diff --git a/src/app_service/service/accounts/service.nim b/src/app_service/service/accounts/service.nim index b41fa2b490..82bb699605 100644 --- a/src/app_service/service/accounts/service.nim +++ b/src/app_service/service/accounts/service.nim @@ -350,7 +350,8 @@ proc login*(self: Service, account: AccountDto, password: string): string = "DataDir": DEFAULT_TORRENT_CONFIG_DATADIR, "TorrentDir": DEFAULT_TORRENT_CONFIG_TORRENTDIR, "Port": DEFAULT_TORRENT_CONFIG_PORT - } + }, + "Networks": NETWORKS, } let response = status_account.login(account.name, account.keyUid, hashedPassword, thumbnailImage,