-
Notifications
You must be signed in to change notification settings - Fork 1.1k
UncheckedExtrinsic: Ensure that encoding leads to same bytes an ext was decoded from #10390
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
base: master
Are you sure you want to change the base?
Conversation
…as decoded from This pull request ensures that when decoding an `UncheckedExtrinsic` from a certain byte string, it also encodes to the same byte string. This is achieved by keeping the original bytes used to decode the `call` around and then directly encode these.
|
/cmd prdoc --bump major --audience runtime_dev |
…-audience runtime_dev'
substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs
Outdated
Show resolved
Hide resolved
substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs
Outdated
Show resolved
Hide resolved
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
|
/cmd fmt |
substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs
Outdated
Show resolved
Hide resolved
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
| } | ||
|
|
||
| /// Something which holds the actual call and maybe its encoded form. | ||
| pub struct CallAndMaybeEncoded<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as comment: We have a DoubleEncoded type that does this, but it in the XCM crate... it is also the other way around by always carrying the encoded version and only sometimes the decoded one.
| } | ||
|
|
||
| impl<T> From<T> for CallAndMaybeEncoded<T> { | ||
| fn from(value: T) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to make it a bit backwards compatible since any Call type can be converted to a CallAndMaybeEncoded?
This pull request ensures that when decoding an
UncheckedExtrinsicfrom a certain byte string, it also encodes to the same byte string. This is achieved by keeping the original bytes used to decode thecallaround and then directly encode these.