cargo-contract icon indicating copy to clipboard operation
cargo-contract copied to clipboard

Make `--suri` optional for dry-runs

Open cmichi opened this issue 3 years ago • 4 comments

With https://github.com/paritytech/cargo-contract/pull/999 we changed default behavior of cargo-contract to dry-run by default. There's a leftover though: --suri is still marked as required, but it is no longer.

cargo contract call --contract $CONTRACT --message flip
error: the following required arguments were not provided:
  --suri <suri>

Usage: cargo contract call --contract <contract> --message <MESSAGE> --suri <suri> [FILE]

--suri is only necessary for -x. The other sub-commands are affected as well.

cmichi avatar Mar 27 '23 17:03 cmichi

suri is used for CallDryRun: https://github.com/paritytech/cargo-contract/blob/aa97589725ef15ef591182e294acc7e0797387e2/crates/cargo-contract/src/cmd/extrinsics/call.rs#L180

SkymanOne avatar Mar 27 '23 18:03 SkymanOne

Indeed we still need the origin because that may affect the result from the dry run. Although with dry-run signing is not required (just the public account id), so we could add a --origin argument? Still allow to specify --suri instead but it is not required.

ascjones avatar Mar 28 '23 09:03 ascjones

Lol: https://github.com/paritytech/cargo-contract/issues/946

cmichi avatar Mar 28 '23 13:03 cmichi

Lol: #946

Indeed I could have sworn I had seen this one before

ascjones avatar Mar 28 '23 14:03 ascjones