Open IkerAlus opened 2 months ago
If anyone wishes to make a PR for this, you are more than welcome to do so! The changes to the example would basically be adding an extra step to building the transaction:
mode
set to 1
and the metadataHash
to the proof you got in the previous step.This is not as straightforward of a change as it would seem on a first look, since it needs to add the metadata proof building step along with the corresponding PAPI package, but it's interesting to understand how the new SignedExtension works.
Since Polkadot 1.2.5 release, signers can add the metadata hash to a transaction as specified in RFC 78.
Although txwrapper is not a signer, it is supposed to be used in conjunction with signers to construct transactions offline. Hence it will be good to add an example, for example similar to this one, where the metadata hash is added to the transaction before being signed. The open question is how to compute this hash value. My recommendation is not to add extra dependencies to the example and query it from the exposed testing API or similar