Conversation
dvdplm
left a comment
There was a problem hiding this comment.
Approving this, but I don't really know how to prove to myself that it's complete/correct. It looks like v14.rs is the old v13.rs + NMap but yeah, hard to tell for sure without some serious study.
| prefix: self.prefix.into_portable(registry), | ||
| entries: registry.map_into_portable(self.entries), |
There was a problem hiding this comment.
Do you think a macro to implement these IntoPortable impls could work? They're pretty repetitive.
There was a problem hiding this comment.
Yes it would be nice if possible.
Co-authored-by: David <dvdplm@gmail.com>
| key2_hasher: StorageHasher, | ||
| }, | ||
| NMap { | ||
| keys: T::Type, |
There was a problem hiding this comment.
Sorry to comment on a merged PR, but is this intended? keys here is a Vec<&'static str> on substrate master: https://github.com/paritytech/substrate/blob/90cfb952f2e11bc6d327faf04b30dc5f4cf89df8/frame/metadata/src/lib.rs#L304, it would seem to me that this should be Vec<T::Type> instead?
There was a problem hiding this comment.
I had it like that originally, but the new metadata types are generated statically (not by the macro) here: https://github.com/paritytech/substrate/blob/25bf1ebe87af73e9cb318f0a9633ed8c9c1cf5b1/frame/support/src/storage/types/nmap.rs#L374.
So for multiple keys where Key::Key is a tuple, the type will point to a tuple type definition which contains all the constituent key types.
New
v13just been introduced in paritytech/substrate#8635 so we need move the newscale-infostuff tov14and add the StorageNMapvariant.todo:
v14v14