Skip to content

Fix the instantiate command for Substrate 0.9.42-based chains#1564

Merged
smiasojed merged 16 commits intomasterfrom
sm/fix-1563
Apr 8, 2024
Merged

Fix the instantiate command for Substrate 0.9.42-based chains#1564
smiasojed merged 16 commits intomasterfrom
sm/fix-1563

Conversation

@smiasojed
Copy link
Contributor

@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
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
Contributor 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
Contributor 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 Outdated
## [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
## [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)

);
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
@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