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

feat: cosmwasm contract build flow during e2e test execution #782

Merged
merged 20 commits into from
Oct 13, 2023

Conversation

misko9
Copy link
Contributor

@misko9 misko9 commented Sep 14, 2023

Adds a new contract/cosmwasm package to interchaintest. This package add support for compiling contract(s) during test execution. Both cosmwasm/rust-optimizer and cosmwasm/workspace-optimizer are supported.

Single contract / rust-optimizer:

  1. early in test, call cosmwasm.NewContract(relativePathOfContract).Compile(), returns contract object
  2. before StoreContract(), call contract.WaitForCompile(), returns wasm binary path (StoreContract input) or error

Multiple/workspace contracts / workspace-optimizer:

  1. early in test, call cosmwasm.NewWorkspace(relativePathOfWorkspace).Compile(), returns workspace object
  2. before StoreContract(), call workspace.WaitForCompile(), returns map of cargo names to wasm binary paths (StoreContract input) or error

The examples/cosmwasm/ directory shows two very simple use cases:

  1. rust-optimizer for single contracts
  2. workspace-optimizer for multiple contracts

Closes #370

@misko9 misko9 marked this pull request as ready for review October 10, 2023 16:04
@misko9 misko9 requested a review from a team as a code owner October 10, 2023 16:04
Copy link
Member

@Reecepbcups Reecepbcups left a comment

Choose a reason for hiding this comment

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

Great work here!

contract/cosmwasm/compile.go Outdated Show resolved Hide resolved
contract/cosmwasm/rust_optimizer.go Outdated Show resolved Hide resolved
@misko9 misko9 enabled auto-merge (squash) October 12, 2023 23:17
@misko9 misko9 merged commit 08b20f6 into main Oct 13, 2023
9 checks passed
@misko9 misko9 deleted the steve/cw-build-flow branch October 13, 2023 05:14
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.

Smart contract developer should have a CosmWasm build flow which allows easy re-running w/o manual steps.
2 participants