-
Notifications
You must be signed in to change notification settings - Fork 121
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
Fix the instantiate command for Substrate 0.9.42-based chains #1564
Conversation
@@ -78,21 +78,15 @@ pub struct ContractResult<R, Balance, EventRecord> { | |||
pub debug_message: Vec<u8>, | |||
/// The execution result of the wasm code. | |||
pub result: R, | |||
/// The events that were emitted during execution. It is an option as event | |||
/// collection is optional. | |||
pub events: Option<Vec<EventRecord>>, |
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.
What about chains that still have the events
field?
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.
we do not use it in our code, so it is just not decoded from binary data.
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.
Where do the events depicted after calling/instantiating/etc. come from if not the ContractResult
?
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.
They are read from the block, please take a look at subxt function:
wait_for_success
https://github.com/paritytech/subxt/blob/a0cb14aa4f5e60c9c88d7adea08a7dd6f0a6a22e/subxt/src/tx/tx_progress.rs#L264
CHANGELOG.md
Outdated
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
## [Unreleased] | |||
|
|||
### Added | |||
- Add `cargo contract storage --version` command - [#1546](https://github.com/paritytech/cargo-contract/pull/1564) |
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.
There is already an Added
section :).
CHANGELOG.md
Outdated
@@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
## [Unreleased] | |||
|
|||
### Fixed | |||
- Fix the `instantiate` command for Substrate `0.9.42` based chains - [#1546](https://github.com/paritytech/cargo-contract/pull/1564) |
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.
- Fix the `instantiate` command for Substrate `0.9.42` based chains - [#1546](https://github.com/paritytech/cargo-contract/pull/1564) | |
- Fix the `instantiate` command for Substrate `0.9.42` based chains - [#1564](https://github.com/paritytech/cargo-contract/pull/1564) |
); | ||
if self.version { | ||
println!("{}", storage_layout.version().await?); | ||
Ok(()) |
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.
Please return early here to save us from the else indentation.
Co-authored-by: Michael Müller <michi@parity.io>
Co-authored-by: Michael Müller <michi@parity.io>
Co-authored-by: Michael Müller <michi@parity.io>
Summary
Closes #1563
ink
orpallet-contracts
?Description
Fix instantiate command
Add
cargo contract storage --version
commandChecklist before requesting a review
CHANGELOG.md