You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since I was working on #1564 I decided to check out this related issue and I believe I have found the cause of the problem.
Firstly, I see from your linked schema validator errors that you are trying to validate your complete contract metadata file. There's a schema called outer-schema.json found here to validate that (and your file is valid!). If you want to validate against ink-v3-schema.json, you will need to remove the source and contract objects in the metadata and only leave the V3 object.
That leads us to the next problem 😄
The ink-v3-schema.json is expecting an object for LayoutKey in the storage layout even though the metadata output is a string. I published an updated version of the V3 schema here with the updated LayoutKey schema. Using this schema your contract metadata is valid 🎉
On why the LayoutKey was expecting an object but metadata output is a string:
In this file we can see that LayoutKey is indeed defined as a struct. If we read on further we see that there is a custom serde::Serialize that serailizes the key to a hex string. However in the generation of the schema this was not taken into account so the schema expected the same struct layout.
I've already reported this issue here: https://substrate.stackexchange.com/questions/4449/validation-error-during-ink-contract-metadata-validation
Link to the contract - https://github.com/Supercolony-net/openbrush-contracts/tree/e366f6ff1e5892c6a624833dd337a6da16a06baa/examples/psp22_extensions/metadata
Version of cargo-contract:
cargo-contract 1.5.0-unknown-x86_64-unknown-linux-gnu
@HCastano
The text was updated successfully, but these errors were encountered: