Skip to content
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
emostov merged 2 commits intomasterfrom
zeke-pdjs-1-34-1
Sep 29, 2020
Merged

chore(deps): Bump polkadot-js/api from 1.31.2 to 1.34.1#253
emostov merged 2 commits intomasterfrom
zeke-pdjs-1-34-1

Conversation

@emostov
Copy link
Contributor

@emostov emostov commented Sep 24, 2020

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 createDecorated we create Metadata and then use that to create Decorated. However, anytime Decorated is used, the user must be careful to registry.setMetadata first. The only place Decorated is used is within createMethod so this isn't a big issue, but to ease future maintenance it may be worth discussing moving registry.setMetadata to within createDecorated.

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 fetch to 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.

*/ /** */

import { TRANSACTION_VERSION } from '@polkadot/types/extrinsic/v4/Extrinsic';
import fetch from 'node-fetch';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does this get imported in this PR but not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

@emostov emostov merged commit 3cb44d0 into master Sep 29, 2020
@emostov emostov deleted the zeke-pdjs-1-34-1 branch September 29, 2020 21:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants