Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): remove duplicated ICRC tokens with different index canisters #4411

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AntonioVentilii
Copy link
Collaborator

Motivation

There was an issue #4164 , that ICRC tokens that have different index canister (one undefined), before being added to the codebase, would appear twice after.

image-20250114-081421

Since we do not use the index canister ID as way to identify an ICRC token (it can be optional) anymore, we adapt all the checks in the derived stores to compare an ICRC to another ONLY via ledger canister ID.

@@ -42,12 +43,9 @@ export const icrcChainFusionDefaultTokens: Readable<IcToken[]> = derived(
/**
* A flatten list of the default Icrc Ledger and Index canister Ids.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update this comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, done!

@@ -67,8 +65,7 @@ const icrcDefaultTokensToggleable: Readable<IcTokenToggleable[]> = derived(
([$icrcDefaultTokens, $icrcUserTokens]) =>
$icrcDefaultTokens.map(({ ledgerCanisterId, indexCanisterId, ...rest }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need to destruct the indexCanisterId?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we don't eheh! changed

Copy link
Member

@peterpeterparker peterpeterparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx

As discussed offline, tests will be provided later on in separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants