Support `Option<T>` in Extrinsic signed payload
See original GitHub issueI’m using an Option<MyType>
in a custom extrinsic signed payload.
The expected behavior is unclear for the None
case.
The rust side expects a 0
to be encoded for the signature to verify.
This implementation encodes nothing for None
when isBare = true
Option
is an implementation detail so it seems that polkadot-js/api is taking the correct approach here but the change will be much harder to implement on the substrate side.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Tx.addSignature emiting error · Issue #4446 · polkadot-js/api
The extrinsic payload is signed, not the transaction. You are serializing the transaction and signing that. The payload has all transaction ...
Read more >offchain.rs.html -- source - Docs.rs
Submit an unsigned transaction with a signed payload //! //! Initially, a payload ... signature: Option<<T::Extrinsic as ExtrinsicT>::SignaturePayload>, ...
Read more >Why unsigned extrinsics? [closed] - Substrate Stack Exchange
In this case, we used an unsigned extrinsic for a few reasons: To support a secp256k1 Ethereum signature, instead of the sr25519 /...
Read more >Make offchain transactions | Substrate_ Docs
Use unsigned transactions with signed payload if you want to record the associated ... index: Index, ) -> Option<(RuntimeCall, <UncheckedExtrinsic as ...
Read more >Transactions in Off-chain Workers - Substrate Recipes
Unsigned Transactions with Signed Payloads. With this type of transaction, we first specify a signer, sign the transaction, and then send it back...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There is another approach we can take when we convert the payload for signing that will not strip all. As it stands it works for defaults but not all, like here.
So yes - can be done and should be done for overall correctness by adjusting where we serialize the payload.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.