fix: code review
This commit is contained in:
parent
bba08d87b8
commit
3e4e2dae0d
|
@ -81,10 +81,9 @@ QtObject:
|
||||||
TokenRoles.Decimals.int:"decimals",
|
TokenRoles.Decimals.int:"decimals",
|
||||||
TokenRoles.IsCustom.int:"isCustom"}.toTable
|
TokenRoles.IsCustom.int:"isCustom"}.toTable
|
||||||
|
|
||||||
# Resolving a ENS name
|
|
||||||
proc getTokenDetails*(self: TokenList, address: string) {.slot.} =
|
proc getTokenDetails*(self: TokenList, address: string) {.slot.} =
|
||||||
spawnAndSend(self, "tokenDetailsResolved") do:
|
spawnAndSend(self, "tokenDetailsResolved") do:
|
||||||
let tkn = newErc20Contract("", getCurrentNetwork(), address.parseAddress, "", 18, false)
|
let tkn = newErc20Contract(getCurrentNetwork(), address.parseAddress)
|
||||||
|
|
||||||
let decimals = tkn.tokenDecimals()
|
let decimals = tkn.tokenDecimals()
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,9 @@ type
|
||||||
proc newErc20Contract*(name: string, network: Network, address: Address, symbol: string, decimals: int, hasIcon: bool): Erc20Contract =
|
proc newErc20Contract*(name: string, network: Network, address: Address, symbol: string, decimals: int, hasIcon: bool): Erc20Contract =
|
||||||
Erc20Contract(name: name, network: network, address: address, methods: ERC20_METHODS.toTable, symbol: symbol, decimals: decimals, hasIcon: hasIcon)
|
Erc20Contract(name: name, network: network, address: address, methods: ERC20_METHODS.toTable, symbol: symbol, decimals: decimals, hasIcon: hasIcon)
|
||||||
|
|
||||||
|
proc newErc20Contract*(network: Network, address: Address): Erc20Contract =
|
||||||
|
Erc20Contract(name: "", network: network, address: address, methods: ERC20_METHODS.toTable, symbol: "", decimals: 0, hasIcon: false)
|
||||||
|
|
||||||
proc newErc721Contract(name: string, network: Network, address: Address, symbol: string, hasIcon: bool, addlMethods: seq[tuple[name: string, meth: Method]] = @[]): Erc721Contract =
|
proc newErc721Contract(name: string, network: Network, address: Address, symbol: string, hasIcon: bool, addlMethods: seq[tuple[name: string, meth: Method]] = @[]): Erc721Contract =
|
||||||
Erc721Contract(name: name, network: network, address: address, symbol: symbol, hasIcon: hasIcon, methods: ERC721_ENUMERABLE_METHODS.concat(addlMethods).toTable)
|
Erc721Contract(name: name, network: network, address: address, symbol: symbol, hasIcon: hasIcon, methods: ERC721_ENUMERABLE_METHODS.concat(addlMethods).toTable)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue