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(suite-native): token definitions redux logic #11318

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

PeKne
Copy link
Contributor

@PeKne PeKne commented Feb 23, 2024

Description

  • token definitions reducer + middleware used in suite-native
  • on creating new account the token definitions are downloaded first before trying to fetch fiat rates
  • if is account with tokens discovered, the definitions are fetched from the middleware

Related Issue

Closes #8434
Closes #11308

Screenshots:

Token definitions are correctly handled in the redux state, app works as expected:
Screenshot 2024-02-22 at 14 52 09

@PeKne PeKne added the mobile Suite Lite issues and PRs label Feb 23, 2024
@PeKne PeKne requested review from a team, tomasklim and matejkriz as code owners February 23, 2024 14:53
action.payload.tokens?.forEach(token => {
const contractAddress = token.contract;

const tokenDefinition = selectSpecificTokenDefinition(
Copy link
Contributor

Choose a reason for hiding this comment

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

What about creating selector selectShouldFetchTokenDefinion?

Copy link
Contributor Author

@PeKne PeKne Feb 26, 2024

Choose a reason for hiding this comment

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

fixed by cd98e01

@PeKne PeKne requested a review from marekrjpolak as a code owner February 26, 2024 10:15
@PeKne PeKne force-pushed the feat/suite-native-token-definitions branch from 6cf5d4c to cd98e01 Compare February 26, 2024 10:39
Copy link
Contributor

@vytick vytick left a comment

Choose a reason for hiding this comment

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

🚀

@PeKne PeKne force-pushed the feat/suite-native-token-definitions branch from a017a0f to ed01969 Compare February 26, 2024 16:18
@trezor trezor deleted a comment from socket-security bot Feb 26, 2024
@trezor trezor deleted a comment from socket-security bot Feb 26, 2024
@PeKne
Copy link
Contributor Author

PeKne commented Feb 27, 2024

/rebase

Copy link

@trezor-ci trezor-ci force-pushed the feat/suite-native-token-definitions branch from ed01969 to 7b523ea Compare February 27, 2024 08:20
@PeKne PeKne merged commit 7e77f60 into develop Feb 27, 2024
32 checks passed
@PeKne PeKne deleted the feat/suite-native-token-definitions branch February 27, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Suite Lite issues and PRs
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Do not report unrecognized tokens Address poisoning attack: Label unverified token transactions in TX detail
4 participants