-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Modify doublemap syntax #4576
Modify doublemap syntax #4576
Conversation
Co-Authored-By: Bastian Köcher <[email protected]>
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 extremely sensitive code. Any mistakes will brick Kusama at the next update. What have you done to make absolutely certain that this changes no logic whatsoever?
Indeed:
|
|
can we compare binaries to ensure the code generated is exactly the same? |
|
So, the syntax changed from: to: or more explicit: The first As @thiolliere already said, there are no more changes in the macro, just the parsing. This includes code generation, it is the same as before. |
* modify doublemap syntax * Apply suggestions from code review Co-Authored-By: Bastian Köcher <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
in the past the syntax for specifying the hasher for key1 was different from for key2.
Now key2 is same as key1: an optional
hasher($hash)attribute that default to blake2_256 instead of$hash($MyKey2Type)Maybe we can also rename this attribute with hasher1 and hasher2 if wanted.
Something not good is that the error message for the old syntax is not understandable because of the way decl_storage is parsing. maybe we should fix it before. Also this needs to be made before 2.0 otherwise we need to support both syntax.