Make contract slatepack encryption optional

--encrypt-for is no longer required. `contract new` without it produces an
unencrypted slatepack; `contract sign` without it replies to the incoming slate's
sender when known, otherwise unencrypted. Passing --encrypt-for is unchanged. The
slatepack layer already produced plaintext for an empty recipient list — this only
removes the CLI-side requirement.
This commit is contained in:
jwinterm
2026-06-04 07:40:03 -04:00
parent b7b7a6d21d
commit 4fcb6053d5
3 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -452,7 +452,7 @@ subcommands:
about: Create a new contract with initial setup
args:
- encrypt-for:
help: The counter party grin address
help: The counter party grin address (optional; omit to produce an unencrypted slatepack)
short: e
long: encrypt-for
takes_value: true
@@ -544,7 +544,7 @@ subcommands:
about: Sign a contract
args:
- encrypt-for:
help: The counter party grin address
help: The counter party grin address (optional; defaults to the slate sender, else unencrypted)
short: e
long: encrypt-for
takes_value: true
+3 -2
View File
@@ -978,7 +978,8 @@ pub fn parse_contract_new_args(
args: &ArgMatches,
account: &String,
) -> Result<command::ContractNewArgs, ParseError> {
let counterparty_addr = parse_required(args, "encrypt-for")?;
// Optional: without --encrypt-for the contract slatepack is produced unencrypted.
let counterparty_addr = args.value_of("encrypt-for").map(String::from);
// TODO: Make sure the values are in some expected bounds.
// TODO: How to deal with decimals and precision? we probably want users to express the value in Grin.
@@ -1044,7 +1045,7 @@ pub fn parse_contract_new_args(
};
Ok(command::ContractNewArgs {
counterparty_addr: String::from(counterparty_addr),
counterparty_addr: counterparty_addr,
receive: receive,
send: send,
src_acct_name: src_acct_name,