soroban-cli icon indicating copy to clipboard operation
soroban-cli copied to clipboard

feat: Add parsing to deploy to support new constructor feature

Open willemneal opened this issue 1 year ago • 0 comments

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 avatar Aug 29 '24 08:08 willemneal