Skip to content

Commit

Permalink
fix: issue with multiple currencies
Browse files Browse the repository at this point in the history
  • Loading branch information
agent-dominatrix committed Aug 22, 2023
1 parent c651828 commit 6864e26
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/background/src/updater/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ export class ChainUpdaterService {
})(),
currencies: (() => {
const currencies = chainInfo.currencies ?? [];
const currencyMinimalDenoms = currencies.map(
(c) => c.coinMinimalDenom
);

for (const f of updatedChainInfo.currencies ?? []) {
if (!currencies.includes(f)) {
if (!currencyMinimalDenoms.includes(f.coinMinimalDenom)) {
currencies.push(f);
}
}
Expand Down Expand Up @@ -90,9 +93,13 @@ export class ChainUpdaterService {
}

const currencies = chainInfo.currencies ?? [];
for (const add of local.currencies) {
if (!currencies.includes(add)) {
currencies.push(add);
const currencyMinimalDenoms = currencies.map(
(c) => c.coinMinimalDenom
);

for (const curr of local.currencies) {
if (!currencyMinimalDenoms.includes(curr.coinMinimalDenom)) {
currencies.push(curr);
}
}

Expand Down

0 comments on commit 6864e26

Please sign in to comment.