Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a JSON schema which describes the contract
metadata. There are two schemas, the outer metadata (generated by
cargo-contract
) andthe versioned ink! metadata.
(This distinction only exists because
cargo-contract
is technically agnostic to thelanguage metadata, although in practice it's really only using the ink! metadata. In the
future we should be able to merge these into a single schema.)
The schemas provide a source of truth about what key-value pairs are supported and what
types they expect. This is useful for developers as well as external tooling. One use
case here is tooling which needs to verify that a given piece of metadata is valid.
Note that the generated process for the schemas is currently using some hacked branches
across
scale-info
,ink
, andcargo-contract
(the generation process is described inthe metadata crate's
README
). My goal is that in the future we'll be able to properlyupstream these changes across our repos and have an easy way to generate the schemas from
cargo-contract
. At that point we'll be able to get rid of these hardcoded schema files.Related issue: #940