-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add schema generation and verification #1404
Conversation
@@ -142,6 +144,12 @@ enum Command { | |||
/// workspace. | |||
#[clap(name = "verify")] | |||
Verify(VerifyCommand), | |||
/// Generates schema from the current metadata specification. | |||
#[clap(name = "generate-schema")] |
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.
I think it would be better to have a 'schema' command and use '-generate' and '-verify' as its arguments.
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.
Too many subcommands IMO: cargo contract schema ...
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.
I think info
and call
have more arguments, but it's up to you whether to leave them as they are or make changes.
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.
LGTM
Summary
Closes #1090 and use-ink/ink#1564
ink
orpallet-contracts
? - 5.0.0-alphaIntroudeces schema generation and verfication commands.
Description
This PR automated proces for metadata schema generation.
Whenever there are changes to the schema, if
cargo-contract
targets the latest version ofink_metadata
the scheme can be generated withcargo contract schema-generate inner/outer
. This will print json to STDOUT.And here is the sample of how to verify the metadata against specified schema file:
Bundle:
Metadata file:
Checklist before requesting a review
CHANGELOG.md