Skip to content
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

Merged
merged 16 commits into from
Apr 8, 2024

Conversation

smiasojed
Copy link
Collaborator

@smiasojed smiasojed commented Mar 26, 2024

Summary

Closes #1563

  • y/n | Does it introduce breaking changes?
  • y/n | Is it dependent on the specific version of ink or pallet-contracts?

Description

Fix instantiate command
Add cargo contract storage --version command

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have added an entry to CHANGELOG.md
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@smiasojed smiasojed changed the title Fix instantiate command for substrate 0.9.42 based chains Fix the instantiate command for Substrate 0.9.42-based chains Mar 26, 2024
@smiasojed smiasojed marked this pull request as ready for review March 26, 2024 15:44
@@ -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>>,
Copy link
Collaborator

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?

Copy link
Collaborator Author

@smiasojed smiasojed Mar 27, 2024

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.

Copy link
Collaborator

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?

Copy link
Collaborator Author

@smiasojed smiasojed Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGELOG.md Show resolved Hide resolved
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)
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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)

CHANGELOG.md Outdated Show resolved Hide resolved
);
if self.version {
println!("{}", storage_layout.version().await?);
Ok(())
Copy link
Collaborator

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.

smiasojed and others added 4 commits April 8, 2024 10:16
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>
@smiasojed smiasojed merged commit 2ca6db0 into master Apr 8, 2024
11 checks passed
@smiasojed smiasojed deleted the sm/fix-1563 branch April 8, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure when interacting with chains that use older pallet-contracts versions
2 participants