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 deps, and fix tests, and types for assets #777

Merged
merged 4 commits into from
Nov 29, 2021

Conversation

TarikGul
Copy link
Member

Updates the following deps:

"@polkadot/api": "^6.10.1",
"@polkadot/util-crypto": "^8.0.2",

Before our type IAssetBalance was representing balance: TAssetBalance (where TAssetBalance is u64). Now that polkadot-js represents the balance in PalletAssetsAssetBalance, the type for balance is u128. This is now reflected in the types, and tests.

Update AssetDetails -> PalletAssetsAssetDetails

@TarikGul TarikGul requested a review from a team November 29, 2021 16:29
Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

LGTM! Shame about the unknowns :)

'10': assetBalanceObjOne as PalletAssetsAssetBalance,
'20': assetBalanceObjTwo as PalletAssetsAssetBalance,
'30': assetBalanceObjThree as PalletAssetsAssetBalance,
'10': assetBalanceObjOne as unknown as PalletAssetsAssetBalance,
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 explain why the unknown type casts are needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea because the typescript compiler doesnt have the ability to cast Obj A as Obj B since their contents are not the exact same type structure. PalletAssetsAssetBalance has a extra field of type Null that we don't add for this specific test because it's not needed.

@TarikGul TarikGul merged commit 51eaa91 into master Nov 29, 2021
@TarikGul TarikGul deleted the tarik-update-deps branch November 29, 2021 21:48
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.

4 participants