-
Notifications
You must be signed in to change notification settings - Fork 710
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
Hide nonce implementation details in metadata #6562
Conversation
All GitHub workflows were cancelled due to failure one of the required jobs. |
@@ -565,5 +577,11 @@ mod tests { | |||
} | |||
type U128WithDefault = TypeWithDefault<u128, Getu128>; | |||
impl WrapAtLeast32Bit for U128WithDefault {} | |||
|
|||
assert_eq!(U8WithDefault::type_info(), <u8 as TypeInfo>::type_info()); |
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.
To be clear, this was not passing before this PR, right
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.
Exactly, I just double-checked: it does not pass with the derived TypeInfo
@@ -40,7 +40,7 @@ use serde::{Deserialize, Serialize}; | |||
/// A type that wraps another type and provides a default value. | |||
/// | |||
/// Passes through arithmetical and many other operations to the inner value. | |||
#[derive(Encode, Decode, TypeInfo, Debug, MaxEncodedLen)] | |||
#[derive(Encode, Decode, Debug, MaxEncodedLen)] |
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.
Should update the doc of the type to specify this nuance.
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.
Added in 06212c9
The only minor downside of this is that now we would have to wait for the next release, and then update the fellowship repo as well Set your reminders @re-gius :) |
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.
LGTM!
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6562-to-stable2407
git worktree add --checkout .worktree/backport-6562-to-stable2407 backport-6562-to-stable2407
cd .worktree/backport-6562-to-stable2407
git reset --hard HEAD^
git cherry-pick -x fc315ac5979e9bf1cc56b58ab6f364b6b2689635
git push --force-with-lease |
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6562-to-stable2409
git worktree add --checkout .worktree/backport-6562-to-stable2409 backport-6562-to-stable2409
cd .worktree/backport-6562-to-stable2409
git reset --hard HEAD^
git cherry-pick -x fc315ac5979e9bf1cc56b58ab6f364b6b2689635
git push --force-with-lease |
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6562-to-stable2412
git worktree add --checkout .worktree/backport-6562-to-stable2412 backport-6562-to-stable2412
cd .worktree/backport-6562-to-stable2412
git reset --hard HEAD^
git cherry-pick -x fc315ac5979e9bf1cc56b58ab6f364b6b2689635
git push --force-with-lease |
See polkadot-fellows/runtimes#248 : using
TypeWithDefault
having derivedTypeInfo
forNonce
causes a breaking change in metadata for nonce type because it's no longeru64
.Adding a default implementation of
TypeInfo
forTypeWithDefault
to restore the original type info in metadata.