Skip to content

Generate metadata for sub-contracts in multi contract workspace #60

@ascjones

Description

@ascjones

Following on from #58, we should support generating of metadata for the non-root contract in a multi contract workspace.

For example, the delegator example hosts multiple contracts which are dependencies of the main contract.

Proposal

  • All metadata files will be written to the target directory of the workspace root, with the file name the same as the contract module name e.g. delegator.json, incrementer.json etc.
  • cargo contract generate-metadata in the root workspace dir generates just the metadata for the root contract (in this case the delegator
  • Sub contracts: e.g cd adder && cargo contract generate-metadata generates just the metadata for that sub contract.
  • Alternatively cargo contract generate-metadata -p adder from the root does the same, mirroring cargo functionality.
  • cargo contract generate-metadata --all will generate metadata files for all contracts in the workspace, e.g. delegator.json, adder.json, subber.json

Implementation notes

  • Need to auto remove the ink-as-dependency feature in the root workspace manifest for the sub contracts

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions