-
Notifications
You must be signed in to change notification settings - Fork 478
Description
In use-ink/cargo-contract#347 I am extracting the version of the ink_metadata crate to specify the version of the metadata.
This assumes that metadata version == ink_metadata crate version, which would be a safe assumption if we are following semver for wire-format compatibility.
However, at the moment we are just bumping ink_metadata along with the other ink! crates. If that will be our policy moving forwards, then we will need to encode the version in the metadata itself, instead of using the crate version.
We could do that using an enum e.g. enum Metadata { V1(Vec<u8>), V2(V2Metadata) } like with frame_metadata, which allows supporting multiple metadata versions. Or we can just add a version field to the contract metadata struct and populate it with a constant value.
It would be good to provide some mapping of crate versions to metadata versions, possibly in the README e.g.
| ink_metadata | metadata version |
|---|---|
| 3.0.0 | V1 |
| 4.0.0 | V1 |
| 5.0.0 | V2 |