The generated code should gather variables pub_keys and master_key to sit together under the Immutable Storage Section (which is enforced to be at index #0 - see) and variables to be under Storage Section #1.
The Data Section should always include the Immutable Storage under Section #0 and the Mutable Storage under Section #1 (both will be of type Fixed-Layout)
Here is an example of how it could look like:
The
Var
undersvm-sdk-macros
crate should haveis_mutable: bool
field added: https://github.com/spacemeshos/svm/blob/master/crates/sdk-macros/src/struct/var.rsThis piecse of code should determine for each
var
whether it's mutable or not: https://github.com/spacemeshos/svm/blob/9b6b8f89e25f605e686d43dc46d73c7fe49d3e1d/crates/sdk-macros/src/struct/storage.rs#L33https://github.com/spacemeshos/svm/blob/9b6b8f89e25f605e686d43dc46d73c7fe49d3e1d/crates/sdk-macros/src/struct/storage.rs#L33
The generated code should gather variables
pub_keys
andmaster_key
to sit together under theImmutable Storage Section
(which is enforced to be atindex #0
- see) and variables to be underStorage Section #1
.The emitted
Storage Schema
should reflect that and then the CLI should be updated as well: https://github.com/spacemeshos/svm/blob/22fb1cf627d5c82d20c285744dd9ee708e9c7c08/crates/cli/src/subcmd_craft_deploy/meta.rsThe
Data Section
should always include theImmutable Storage
underSection #0
and theMutable Storage
underSection #1
(both will be of typeFixed-Layout
)