use let instead of var

This commit is contained in:
Iuri Matias 2020-06-10 16:21:13 -04:00
parent 19eb7eb520
commit bd8d743385
2 changed files with 3 additions and 3 deletions

View File

@ -37,8 +37,8 @@ proc getTokenBalance*(tokenAddress: string, account: string): string =
let payload = %* [{
"to": tokenAddress, "from": account, "data": fmt"0x70a08231000000000000000000000000{postfixedAccount}"
}, "latest"]
var response = status.callPrivateRPC("eth_call", payload)
var balance = response.parseJson["result"].getStr
let response = status.callPrivateRPC("eth_call", payload)
let balance = response.parseJson["result"].getStr
result = $hex2Eth(balance)
proc addOrRemoveToken*(enable: bool, address: string, name: string, symbol: string, decimals: int, color: string): JsonNode =

View File

@ -19,7 +19,7 @@ proc getPrice(crypto: string, fiat: string): string =
try:
if balanceManager.pricePairs.hasKey(fiat):
return balanceManager.pricePairs[fiat]
var url: string = fmt"https://min-api.cryptocompare.com/data/price?fsym={crypto}&tsyms={fiat}"
let url: string = fmt"https://min-api.cryptocompare.com/data/price?fsym={crypto}&tsyms={fiat}"
let client = newHttpClient()
client.headers = newHttpHeaders({ "Content-Type": "application/json" })