diff --git a/controller/tests/contract_accounts.rs b/controller/tests/contract_accounts.rs index fc729a1fe..ba2e52ed7 100644 --- a/controller/tests/contract_accounts.rs +++ b/controller/tests/contract_accounts.rs @@ -144,6 +144,7 @@ fn contract_accounts_impl(test_dir: &'static str) -> Result<(), libwallet::Error let mut slate = Slate::blank(0, true); // this gets overriden below + let mut sender_address = None; wallet::controller::owner_single_use(Some(wallet1.clone()), mask1, None, |api, m| { // Send wallet inititates a standard transaction with --send=5 let args = &ContractNewArgsAPI { @@ -154,17 +155,21 @@ fn contract_accounts_impl(test_dir: &'static str) -> Result<(), libwallet::Error ..Default::default() }; slate = api.contract_new(m, args)?; + sender_address = Some(api.get_slatepack_address(mask1, 0)?.pub_key); Ok(()) })?; assert_eq!(slate.state, SlateState::Standard1); + let mut recipient_address = None; wallet::controller::owner_single_use(Some(wallet2.clone()), mask2, None, |api, m| { // Receive wallet calls --receive=5 - let args = &ContractSetupArgsAPI { + let args = &mut ContractSetupArgsAPI { net_change: Some(5_000_000_000), ..Default::default() }; + args.proof_args.sender_address = sender_address; slate = api.contract_sign(m, &slate, args)?; + recipient_address = Some(api.get_slatepack_address(mask2, 0)?.pub_key); Ok(()) })?; assert_eq!(slate.state, SlateState::Standard2); diff --git a/controller/tests/contract_accounts_switch.rs b/controller/tests/contract_accounts_switch.rs index ce81c9c2c..7b47dfbb7 100644 --- a/controller/tests/contract_accounts_switch.rs +++ b/controller/tests/contract_accounts_switch.rs @@ -113,10 +113,11 @@ fn contract_accounts_switch_impl(test_dir: &'static str) -> Result<(), libwallet } wallet::controller::owner_single_use(Some(wallet2.clone()), mask2, None, |api, m| { // Receive wallet calls --receive=5 - let args = &ContractSetupArgsAPI { + let args = &mut ContractSetupArgsAPI { net_change: Some(5_000_000_000), ..Default::default() }; + args.proof_args.suppress_proof = true; slate = api.contract_sign(m, &slate, args)?; Ok(()) })?; diff --git a/controller/tests/contract_rsr.rs b/controller/tests/contract_rsr.rs index a3ba8f0af..2821950b4 100644 --- a/controller/tests/contract_rsr.rs +++ b/controller/tests/contract_rsr.rs @@ -45,13 +45,14 @@ fn contract_rsr_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> wallet::controller::owner_single_use(Some(recv_wallet.clone()), recv_mask, None, |api, m| { // Receive wallet inititates an invoice transaction with --receive=5 - let args = &ContractNewArgsAPI { + let args = &mut ContractNewArgsAPI { setup_args: ContractSetupArgsAPI { net_change: Some(5_000_000_000), ..Default::default() }, ..Default::default() }; + args.setup_args.proof_args.suppress_proof = true; slate = api.contract_new(m, args)?; Ok(()) })?; @@ -70,9 +71,11 @@ fn contract_rsr_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> // Receive wallet finalizes and posts wallet::controller::owner_single_use(Some(recv_wallet.clone()), recv_mask, None, |api, m| { - let args = &ContractSetupArgsAPI { + let args = &mut ContractSetupArgsAPI { ..Default::default() }; + // TODO: This possibly shouldn't be needed here if no proof? + args.proof_args.suppress_proof = true; slate = api.contract_sign(m, &slate, args)?; Ok(()) })?; diff --git a/controller/tests/contract_srs.rs b/controller/tests/contract_srs.rs index 704ac4d23..7fb9dcfaa 100644 --- a/controller/tests/contract_srs.rs +++ b/controller/tests/contract_srs.rs @@ -45,7 +45,7 @@ fn contract_srs_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> wallet::controller::owner_single_use(Some(send_wallet.clone()), send_mask, None, |api, m| { // Send wallet inititates a standard transaction with --send=5 - let args = &ContractNewArgsAPI { + let args = &mut ContractNewArgsAPI { setup_args: ContractSetupArgsAPI { net_change: Some(-5_000_000_000), ..Default::default() @@ -59,10 +59,11 @@ fn contract_srs_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> wallet::controller::owner_single_use(Some(recv_wallet.clone()), recv_mask, None, |api, m| { // Receive wallet calls --receive=5 - let args = &ContractSetupArgsAPI { + let args = &mut ContractSetupArgsAPI { net_change: Some(5_000_000_000), ..Default::default() }; + args.proof_args.suppress_proof = true; slate = api.contract_sign(m, &slate, args)?; Ok(()) })?; @@ -70,9 +71,10 @@ fn contract_srs_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> // Send wallet finalizes and posts wallet::controller::owner_single_use(Some(send_wallet.clone()), send_mask, None, |api, m| { - let args = &ContractSetupArgsAPI { + let args = &mut ContractSetupArgsAPI { ..Default::default() }; + args.proof_args.suppress_proof = true; slate = api.contract_sign(m, &slate, args)?; Ok(()) })?; diff --git a/libwallet/src/contract/slate.rs b/libwallet/src/contract/slate.rs index aa712754e..4cc65fe7b 100644 --- a/libwallet/src/contract/slate.rs +++ b/libwallet/src/contract/slate.rs @@ -47,7 +47,7 @@ where { // TODO: Implement. Consider adding this function to the Slate itself so they can easily be versioned // e.g. slate.add_payment_proof_data() - trace!("contract::slate::add_payment_proof => called"); + debug!("contract::slate::add_payment_proof => called"); // If we're a recipient, generate proof unless explicity told not to if let Some(ref c) = net_change { if *c > 0 && !proof_args.suppress_proof && slate.payment_proof.is_none() {