refactor: mailserver_cycle (base_bc)

This commit is contained in:
Sale Djenic 2022-02-01 10:57:20 +01:00 committed by saledjenic
parent ad280888e0
commit cea9a81863
2 changed files with 8 additions and 19 deletions

View File

@ -155,6 +155,12 @@ var NODE_CONFIG* = %* {
"VerifyTransactionChainID": 1,
"VerifyTransactionURL": "https://mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED
},
"Web3ProviderConfig": {
"Enabled": true
},
"EnsConfig": {
"Enabled": true
},
"StatusAccountsConfig": {
"Enabled": true
},

View File

@ -202,7 +202,7 @@ proc saveAccountAndLogin*(hashedPassword: string, account, subaccounts, settings
error "error doing rpc request", methodName = "saveAccountAndLogin", exception=e.msg
raise newException(RpcException, e.msg)
proc login*(name, keyUid, hashedPassword, identicon, thumbnail, large: string):
proc login*(name, keyUid, hashedPassword, identicon, thumbnail, large: string, nodeCfgObj: string):
RpcResponse[JsonNode]
{.raises: [Exception].} =
try:
@ -216,24 +216,7 @@ proc login*(name, keyUid, hashedPassword, identicon, thumbnail, large: string):
if(thumbnail.len>0 and large.len > 0):
payload["identityImage"] = %* {"thumbnail": thumbnail, "large": large}
# TODO:
# If you added a new value in the nodeconfig in status-go, old accounts will not have this value, since the node config
# is stored in the database, and it's not easy to migrate using .sql
# While this is fixed, you can add here any missing attribute on the node config, and it will be merged with whatever
# the account has in the db
var nodeCfg = %* {
"ShhextConfig": %* {
"EnableMailserverCycle": true
},
"Web3ProviderConfig": %* {
"Enabled": true
},
"EnsConfig": %* {
"Enabled": true
},
}
let response = status_go.loginWithConfig($payload, hashedPassword, $nodeCfg)
let response = status_go.loginWithConfig($payload, hashedPassword, nodeCfgObj)
result.result = Json.decode(response, JsonNode)
except RpcException as e: