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: Add parsing to deploy to support new constructor feature #1574

Merged
merged 42 commits into from
Nov 6, 2024

Conversation

willemneal
Copy link
Member

If a contract has a method called __contructor then it parses the slop, e.i. anything after --. So after adding one to the hello world contract you would use it like:

cargo s contract deploy --build-only --wasm ./target/wasm32-unknown-unknown/test-wasms/test_hello_world.wasm --source default --network testnet -- --help
ℹ️ Using wasm hash 75eca9c92c997f6b1b1c7caba32311e81077f29c2f11eb3be6d453406e939a34
Example constructor
Usage Notes:
Each arg has a corresponding --<arg_name>-file-path which is a path to a file containing the corresponding JSON argument.
Note: The only types which aren't JSON are Bytes and BytesN, which are raw bytes

Usage: __constructor [OPTIONS]

Options:
      --world <String>
          Example:
            --world '"hello world"'

  -h, --help
          Print help (see a summary with '-h')

For now this is a noop. And adding the new operation is still needed but hard to test now.

Close #1561

@willemneal willemneal marked this pull request as ready for review October 12, 2024 13:56
@willemneal
Copy link
Member Author

willemneal commented Oct 12, 2024

Requires RPC updates and release stellar/rs-stellar-rpc-client#12
Requires that RPC does a release with the newest xdr types.

@willemneal willemneal requested review from leighmcculloch and fnando and removed request for leighmcculloch October 29, 2024 19:11
Cargo.lock Outdated Show resolved Hide resolved
cmd/soroban-cli/src/commands/contract/deploy/wasm.rs Outdated Show resolved Hide resolved
@leighmcculloch leighmcculloch enabled auto-merge (squash) November 6, 2024 07:20
@leighmcculloch
Copy link
Member

leighmcculloch commented Nov 6, 2024

Pushed a few changes, mostly removing dep changes, a couple other minor things. Approved. Set to merge.

@leighmcculloch leighmcculloch merged commit 8163f30 into main Nov 6, 2024
26 checks passed
@leighmcculloch leighmcculloch deleted the feat/deploy_with_constructor branch November 6, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

CAP-58: Support deploy with constructor arguments
2 participants