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 arg parsing to deploy command to support new constructor feature #1570

Closed

Conversation

willemneal
Copy link
Member

@willemneal willemneal commented Aug 28, 2024

Depends on #1569.

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 force-pushed the feat/deploy_with_constructor branch from 2a448cd to 41b990d Compare August 28, 2024 11:45
@willemneal willemneal force-pushed the feat/deploy_with_constructor branch from 41b990d to 8cd6747 Compare August 29, 2024 07:16
@willemneal
Copy link
Member Author

Closed in favor of #1574 as I am moving away from using AhaLabs as a remote.

@willemneal willemneal closed this Aug 29, 2024
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
1 participant