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

feat(frontend): add burn icrc token from json #3523

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

Conversation

loki344
Copy link
Collaborator

@loki344 loki344 commented Nov 13, 2024

Motivation

We add the additional icrc token "BURN".

Changes

  • adjust type reference
  • add token to json
  • merge data into icrc tokens

Tests

In discussion with @AntonioVentilii-DFINITY I aimed for manual testing because testing this functionality in a unit test would include multiple stores and a deeper knowledge of how they work together.

Acceptance criteria:
User w/o the token: user does not see the token in the list, and sees the token in the list settings and can enable it

2650331

Bildschirmaufnahme.2024-11-14.um.16.04.46.mov

User w/ the token, a balance, active: User still sees the token and the balance in the list. and only once in “manage list” and can enable it

2650332

Bildschirmaufnahme.2024-11-14.um.16.06.46.mov

image

User w/ the token, a balance, inactive: User does not see the token in the list. and only once in “manage list” and can enable it

2650334

Bildschirmaufnahme.2024-11-14.um.16.08.16.mov

@loki344 loki344 changed the title feat(frontend)/add burn icrc token from json feat(frontend): add burn icrc token from json Nov 13, 2024
@loki344 loki344 marked this pull request as ready for review November 14, 2024 15:14
@loki344 loki344 requested a review from a team as a code owner November 14, 2024 15:14
Object.entries(icrcTokens).reduce(
(acc, [key, value]) => ({
...acc,
...((STAGING || BETA || PROD) &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not really sure I understand this condition: why only these envs? and why do you use the function for only the production tokens if STAGING is acceptable too? should it be only BETA and PROD?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why only these env vars?
Because it somehow seems to matter here:

const mapCkErc20Data = ({

So i thought it might also matter for this mapping

Why I only use it for the production tokens?
I could add a line like this:
const ADDITIONAL_ICRC_STAGING_DATA = mapIcrcData(additionalIcrcTokensStaging);

but because there is no staging token that we want to read right now, this variable will be unused. So i think is better to introduce it when it's needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah understood! thank you for the explanation! then, shouldn't the check be only for BETA and PROD?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't feel strongly about this as I just replicated the existing pattern, i'll remove the staging for now

@loki344
Copy link
Collaborator Author

loki344 commented Nov 15, 2024

@AntonioVentilii can you take another look so that we get this in today?

src/frontend/src/env/map-icrc-data.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

good one! however, the tests should be for each env, so that if at some point we change something, they fail

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.

2 participants