-
Notifications
You must be signed in to change notification settings - Fork 431
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
Bugfix ink_metadata
: RootLayout
must work for PortableForm
#1989
Bugfix ink_metadata
: RootLayout
must work for PortableForm
#1989
Conversation
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑These are the results when building the
Link to the run | Last update: Mon Nov 13 19:59:15 CET 2023 |
crates/storage/src/lazy/mapping.rs
Outdated
@@ -369,9 +369,10 @@ const _: () = { | |||
KeyType: StorageKey + scale_info::TypeInfo + 'static, | |||
{ | |||
fn layout(_: &Key) -> Layout { | |||
Layout::Root(RootLayout::new::<Self, _>( | |||
Layout::Root(RootLayout::new::<_>( |
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.
Layout::Root(RootLayout::new::<_>( | |
Layout::Root(RootLayout::new( |
I believe for a single inferred generic parameter you just omit the <_>
. Also in other places.
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.
lol yeah certainly, thanks!
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.
Apart from the nit, LGTM
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Summary
#1784 changed
RootLayout::new()
to no longer be generic. Which breaks re-using the metadata for project relying on working withPortableForm
exclusively (such as Solang).This should go into the next release or it will stuck Solang to an older version of
ink_metadata
.Description
Changed the
RootLayout::new()
function to be generic again. I think theType
crafted inside the constructor is pure convenience that can be done by the caller anyways. However this cosmetic trade-off makesRootLayout
usable in purely portable contexts again.Also added a test that would break without the bugfix.
Checklist before requesting a review
CHANGELOG.md