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!: Update polkadot-js/api and account for chainProperties updates #402

Merged
merged 8 commits into from
Jan 28, 2021

Conversation

emostov
Copy link
Contributor

@emostov emostov commented Jan 26, 2021

BREAKING CHANGE

  • Document regression (breaking change) in runtime/spec response. tokenSymbol and tokenDecimals now return an Arrary<string> instead of a string. See the diff for src/services/test-helpers/responses/runtime/spec.json to view a concrete example of the change.
  • Bumps dependencies, including polkadot-js
  • Accounts for updates to chainProperties.chainTokens. Formerly, chainProperties.chainToken was just a string; now it is a Array<string>, so it can be extensible for chains that support multiple tokens. In this PR we make the assumption that the token at index 0 will be the native token. We consider a token native because its balance is stored in system::Accounts; opposed to a non-native token which has its balance accessible via the ORML tokens pallets.

@emostov emostov changed the title fix: Update polkadot-js/api and account for chainProperties updates fix!: Update polkadot-js/api and account for chainProperties updates Jan 26, 2021
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

I think the new format merits a test or two?

src/controllers/accounts/AccountsBalanceInfoController.ts Outdated Show resolved Hide resolved
src/services/accounts/AccountsBalanceInfoService.ts Outdated Show resolved Hide resolved
@emostov
Copy link
Contributor Author

emostov commented Jan 27, 2021

@dvdplm @TarikGul I added some tests and very slightly modified the service to make sure when we compare token values they are all uppercase. Previously we forced it to uppercase in the controller but I think this change is more resilient to fat finger changes in the controller.

src/services/accounts/AccountsBalanceInfoService.spec.ts Outdated Show resolved Hide resolved
src/services/accounts/AccountsBalanceInfoService.spec.ts Outdated Show resolved Hide resolved
src/services/test-helpers/mock/index.ts Outdated Show resolved Hide resolved
@emostov emostov merged commit 37acc7e into master Jan 28, 2021
@emostov emostov deleted the zeke-bump-36 branch January 28, 2021 21:00
This pull request was closed.
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