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

Migrations: ensure native currency names & symbols #1468

Merged

Conversation

goosewobbler
Copy link
Contributor

@goosewobbler goosewobbler commented Mar 1, 2023

TODO:

  • verify that we don't have missing symbol values

@goosewobbler goosewobbler added bug Something isn't working store migration labels Mar 1, 2023
@goosewobbler goosewobbler added this to the v0.6.2 milestone Mar 1, 2023
@goosewobbler goosewobbler added the WIP PRs that are still in progress and not ready for review or merging label Mar 3, 2023
mholtzman
mholtzman previously approved these changes Mar 3, 2023
@goosewobbler goosewobbler removed the WIP PRs that are still in progress and not ready for review or merging label Mar 3, 2023
Copy link
Contributor Author

@goosewobbler goosewobbler left a comment

Choose a reason for hiding this comment

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

Nice, saves some space in this test file

@goosewobbler goosewobbler requested review from Jamchello, mholtzman and floating and removed request for mholtzman March 3, 2023 14:20

initial.main.networksMeta.ethereum[id].nativeCurrency = {
...nativeCurrency,
name: nativeCurrency.name || name,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Using the spread should assign the name from nativeCurrency if it exists, couldn't we set the default data first and then spread on top?

Copy link
Contributor Author

@goosewobbler goosewobbler Mar 3, 2023

Choose a reason for hiding this comment

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

Actually not sure this works - tests fail

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this would assign the name to what was in nativeCurrency even if it were falsy, for example overwriting the new value with empty string, for example

@goosewobbler goosewobbler changed the title Migrations: add more native currency names Migrations: ensure native currency names & symbols Mar 3, 2023
@goosewobbler goosewobbler merged commit 8b6b841 into develop Mar 3, 2023
@goosewobbler goosewobbler deleted the sam/eng-62-send-dapp-black-screen-when-searching branch March 3, 2023 14:48
const { name = '', symbol = '' } = nativeCurrencyMap[id] || {}
const nativeCurrency = initial.main.networksMeta.ethereum[id].nativeCurrency

initial.main.networksMeta.ethereum[id].nativeCurrency = {
Copy link
Owner

Choose a reason for hiding this comment

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

can we assume that this chain exists in networksMeta?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working store migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants