This repository was archived by the owner on Sep 30, 2021. It is now read-only.
chore(deps): Bump polkadot-js/api from 1.31.2 to 1.34.1#253
Merged
Conversation
joepetrowski
approved these changes
Sep 28, 2020
| */ /** */ | ||
|
|
||
| import { TRANSACTION_VERSION } from '@polkadot/types/extrinsic/v4/Extrinsic'; | ||
| import fetch from 'node-fetch'; |
Collaborator
There was a problem hiding this comment.
Why does this get imported in this PR but not used?
Contributor
Author
There was a problem hiding this comment.
It is used on line 22. I can't figure out exactly why it did not need to be imported before, but while trying out the example it was failing after bumping deps. In modern web browsers fetch is automatically included in the global scope while node does not include it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
overview
In polkadot-js/api v1.34.1 there is a major breaking change and an update to accommodate metadata v12.
breaking change recap
The breaking change is that metadata creation now does not default to returning decorated metadata. Instead the user must explicitly create the metadata, set in on the registry, and then use that registry to create to create metadata.
In the workflow for
createDecoratedwe createMetadataand then use that to createDecorated. However, anytimeDecoratedis used, the user must be careful toregistry.setMetadatafirst. The only place Decorated is used is withincreateMethodso this isn't a big issue, but to ease future maintenance it may be worth discussing movingregistry.setMetadatato withincreateDecorated.In sum, after evaluation I have concluded the breaking change does not impact
txwrapper. In an abundance of caution I have also tested this branch with several different transactions against and a dev node and had zero issues. It may be worth having someone else pull down this branch and do the same.update to accommodate metadata v12
From what I understand, due to this substrate pr, polkadot-js is bumping the metadata to v12. It is not totally clear to me if this interacts with any of txwraper's use cases, but under the hood polkadot-js is already using this new metadata version and since I tested some transactions I think we are ok.
other
I needed to add an explicit import for
fetchto the utils file in the example directory since it was complaining. Not sure why this was not an issue before, but it is fixed now. Likely some dependency got auto updated and since there are no tests for the example folder it did not get caught.