-
Notifications
You must be signed in to change notification settings - Fork 119
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
Extrinsics: allow specifying contract artifact directly #893
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ascjones
changed the title
Extrinsics: allow specifying contract artifacts directly
Extrinsics: allow specifying contract artifact directly
Jan 11, 2023
cmichi
approved these changes
Jan 12, 2023
Co-authored-by: Michael Müller <[email protected]>
Co-authored-by: Michael Müller <[email protected]>
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 2.0.7 to 2.0.8. - [Release notes](https://github.com/assert-rs/assert_cmd/releases) - [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md) - [Commits](assert-rs/assert_cmd@v2.0.7...v2.0.8) --- updated-dependencies: - dependency-name: assert_cmd dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.0 to 1.7.1. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](rust-lang/regex@1.7.0...1.7.1) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
* dependabot: ignore substrate deps * Move ignore section and use pattern * Fix update-types
This was referenced Jan 12, 2023
Merged
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Extrinsic commands need to locate contract artifacts: for
upload
we require the contract Wasm and forinstantiate
andcall
the contract metadata. Currently this is designed to be similar to othercargo
commands: providing a--manifest-path
argument to point to theCargo.toml
of the contract project, if not present assuming the working directory is the project root. From there it can locate the artifacts in the./target/ink/
directory. This is good for a development workflow from inside a project dir like:cargo contract build --release
cargo contract upload --suri //Alice
cargo contract instantiate ...
Or from a different directory relative to the contract project directory:
cargo contract build --manifest-path ../my-contract/Cargo.toml --release
cargo contract upload --manifest-path ../my-contract/Cargo.toml --suri //Alice
cargo contract instantiate --manifest-path ../my-contract/Cargo.toml ...
However, this workflow is designed for a developer who is working with the contract source locally.
This PR adds the ability to provide the path to a contract artifact file directly, for use cases where a user does not have the contract source project locally.
For all extrinsics, there is now an optional positional argument for the path to an artifact file. This can be one of
.wasm
(code only),.json
(metadata only) or.contract
(metadata + wasm). e.g.cargo upload ../path/to/mycontract.wasm
cargo instantiate ../path/to/mycontract.contract
cargo call ..path/to/metadata.json
When specified, it will use that artifact file. When not specified it will fall back to the existing
--manifest-path
method.Note: The existing
instantiate
command has a--wasm-path
argument. This has been replaced by this new positional argument for consistency across the extrinsic commands.Closes #892