fix(tokenService): ensure token address map is properly initialized

Nim didn't complain, but the data was being "swallowed" resulting in
a broken asset list in the permissions view.
This commit is contained in:
Pascal Precht 2023-03-22 17:29:05 +01:00 committed by Follow the white rabbit
parent 7e9e3ee252
commit 858b53979a
1 changed files with 3 additions and 1 deletions

View File

@ -126,7 +126,9 @@ QtObject:
for token in default_tokens:
if not self.tokensToAddressesMap.hasKey(token.symbol):
self.tokenList.add(token)
self.tokensToAddressesMap[token.symbol].addresses = initTable[int, string]()
self.tokensToAddressesMap[token.symbol] = TokenData(
addresses: initTable[int, string](),
)
if not self.tokensToAddressesMap[token.symbol].addresses.hasKey(token.chainId):
self.tokensToAddressesMap[token.symbol].addresses[token.chainId] = $token.address