diff --git a/applications/minotari_console_wallet/src/automation/commands.rs b/applications/minotari_console_wallet/src/automation/commands.rs index 242de2c0df..9d71989b70 100644 --- a/applications/minotari_console_wallet/src/automation/commands.rs +++ b/applications/minotari_console_wallet/src/automation/commands.rs @@ -95,6 +95,7 @@ use tokio::{ use super::error::CommandError; use crate::{ + automation::{Step1OutputsForLeader, Step1OutputsForSelf, Step2OutputsForParties, Step2OutputsForSelf}, cli::{CliCommands, MakeItRainTransactionType}, utils::db::{CUSTOM_BASE_NODE_ADDRESS_KEY, CUSTOM_BASE_NODE_PUBLIC_KEY_KEY}, }; @@ -722,11 +723,11 @@ pub async fn command_runner( let wallet_public_spend_key = key_manager_service .get_public_key_at_key_id(&wallet_spend_key_id) .await?; - let (script_nonce_key_id, public_script_nonce) = key_manager_service.get_random_key().await?; + let (script_nonce_key_id, public_script_nonce_key) = key_manager_service.get_random_key().await?; let (sender_offset_key_id, public_sender_offset_key) = key_manager_service.get_random_key().await?; - let (sender_offset_nonce_key_id, public_sender_offset_nonce) = + let (sender_offset_nonce_key_id, public_sender_offset_nonce_key) = key_manager_service.get_random_key().await?; let commitment = Commitment::from_hex(&args.commitment)?; @@ -765,13 +766,28 @@ pub async fn command_runner( script_input_signature.get_public_nonce().to_hex(), wallet_spend_key_id, script_nonce_key_id, - public_script_nonce, + public_script_nonce_key, sender_offset_key_id, public_sender_offset_key, sender_offset_nonce_key_id, - public_sender_offset_nonce, + public_sender_offset_nonce_key, shared_secret_public_key ); + + let outputs_for_self = Step1OutputsForSelf { + wallet_spend_key_id, + script_nonce_key_id, + sender_offset_key_id, + sender_offset_nonce_key_id, + }; + let outputs_for_leader = Step1OutputsForLeader { + script_input_signature, + wallet_public_spend_key, + public_script_nonce_key, + public_sender_offset_key, + public_sender_offset_nonce_key, + shared_secret_public_key, + }; }, FaucetEncumberAggregateUtxo(args) => { #[allow(clippy::mutable_key_type)] @@ -828,13 +844,11 @@ pub async fn command_runner( 6. script_signature_ephemeral_commitment: {}, 7. script_signature_ephemeral_pubkey: {}, 8. output_commitment: {}, - 9. output_hash: {}, - 10. sender_offset_pubkey: {}, - 11. meta_signature_ephemeral_commitment: {}, - 12. meta_signature_ephemeral_pubkey: {}, - 13. total_public_offset: {}, - 14. encrypted_data: {}, - 15. output_features: {}", + 9. sender_offset_pubkey: {}, + 10. meta_signature_ephemeral_commitment: {}, + 11. meta_signature_ephemeral_pubkey: {}, + 12. encrypted_data: {}, + 13. output_features: {}", tx_id, transaction.body.inputs()[0].commitment().unwrap().to_hex(), transaction.body.inputs()[0].input_data.to_hex(), @@ -846,18 +860,39 @@ pub async fn command_runner( .to_hex(), total_script_nonce.to_hex(), transaction.body.outputs()[0].commitment().to_hex(), - transaction.body.outputs()[0].hash().to_hex(), transaction.body.outputs()[0].sender_offset_public_key.to_hex(), transaction.body.outputs()[0] .metadata_signature .ephemeral_commitment() .to_hex(), total_metadata_ephemeral_public_key.to_hex(), - transaction.script_offset.to_hex(), transaction.body.outputs()[0].encrypted_data.to_hex(), serde_json::to_string(&transaction.body.outputs()[0].features) .unwrap_or("Could not serialize output features".to_string()) - ) + ); + + let step_2_outputs_for_self = Step2OutputsForSelf { tx_id }; + + let step_2_outputs_for_parties = Step2OutputsForParties { + input_commitment: transaction.body.inputs()[0].commitment().unwrap().clone(), + input_stack: transaction.body.inputs()[0].clone().input_data, + input_script: transaction.body.inputs()[0].script().unwrap().clone(), + total_script_key: script_pubkey, + script_signature_ephemeral_commitment: transaction.body.inputs()[0] + .script_signature + .ephemeral_commitment() + .clone(), + script_signature_ephemeral_pubkey: total_script_nonce, + output_commitment: transaction.body.outputs()[0].commitment().clone(), + sender_offset_pubkey: transaction.body.outputs()[0].clone().sender_offset_public_key, + metadata_signature_ephemeral_commitment: transaction.body.outputs()[0] + .metadata_signature + .ephemeral_commitment() + .clone(), + metadata_signature_ephemeral_pubkey: total_metadata_ephemeral_public_key, + encrypted_data: transaction.body.outputs()[0].clone().encrypted_data, + output_features: transaction.body.outputs()[0].clone().features, + }; }, Err(e) => println!("Encumber aggregate transaction error! {}", e), } @@ -894,11 +929,11 @@ pub async fn command_runner( .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; let input_data = ExecutionStack::from_hex(&args.input_stack) .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; - let commitment = - Commitment::from_hex(&args.commitment).map_err(|e| CommandError::InvalidArgument(e.to_string()))?; - let ephemeral_commitment = Commitment::from_hex(&args.ephemeral_commitment) + let commitment = Commitment::from_hex(&args.input_commitment) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let ephemeral_commitment = Commitment::from_hex(&args.script_ephemeral_commitment) .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; - let ephemeral_pubkey = PublicKey::from(args.ephemeral_pubkey); + let ephemeral_pubkey = PublicKey::from(args.script_ephemeral_pubkey); let challenge = TransactionInput::build_script_signature_challenge( &TransactionInputVersion::get_current_version(), &ephemeral_commitment, @@ -910,7 +945,7 @@ pub async fn command_runner( ); match key_manager_service - .sign_with_nonce_and_message(&args.private_key_id, &args.secret_nonce_key_id, &challenge) + .sign_with_nonce_and_message(&args.wallet_spend_key_id, &args.spend_nonce_key_id, &challenge) .await { Ok(signature) => { @@ -926,21 +961,21 @@ pub async fn command_runner( }, FaucetCreateMetaSig(args) => { let offset = key_manager_service - .get_script_offset(&vec![args.secret_script_key_id], &vec![args - .secret_sender_offset_key_id + .get_script_offset(&vec![args.wallet_spend_key_id], &vec![args + .sender_offset_key_id .clone()]) .await?; let script = script!(PushPubKey(Box::new(args.recipient_address.public_spend_key().clone()))); - let commitment = - Commitment::from_hex(&args.commitment).map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let commitment = Commitment::from_hex(&args.output_commitment) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; let covenant = Covenant::default(); let encrypted_data = EncryptedData::from_hex(&args.encrypted_data) .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; let output_features = serde_json::from_str(&args.output_features) .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; - let ephemeral_commitment = Commitment::from_hex(&args.ephemeral_commitment) + let ephemeral_commitment = Commitment::from_hex(&args.metadata_ephemeral_commitment) .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; - let ephemeral_pubkey = PublicKey::from_hex(&args.ephemeral_pubkey) + let ephemeral_pubkey = PublicKey::from_hex(&args.metadata_ephemeral_pubkey) .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; let minimum_value_promise = MicroMinotari::zero(); trace!( @@ -950,7 +985,7 @@ pub async fn command_runner( ); trace!(target: LOG_TARGET, "script: {:?}", script); trace!(target: LOG_TARGET, "output features: {:?}", output_features); - let offsetkey: PublicKey = args.total_meta_key.clone().into(); + let offsetkey: PublicKey = args.total_metadata_key.clone().into(); trace!(target: LOG_TARGET, "sender_offset_public_key: {:?}", offsetkey); trace!(target: LOG_TARGET, "ephemeral_commitment: {:?}", ephemeral_commitment); trace!(target: LOG_TARGET, "ephemeral_pubkey: {:?}", ephemeral_pubkey); @@ -962,7 +997,7 @@ pub async fn command_runner( &TransactionOutputVersion::get_current_version(), &script, &output_features, - &args.total_meta_key.into(), + &args.total_metadata_key.into(), &ephemeral_commitment, &ephemeral_pubkey, &commitment, @@ -973,8 +1008,8 @@ pub async fn command_runner( trace!(target: LOG_TARGET, "meta challenge: {:?}", challenge); match key_manager_service .sign_with_nonce_and_message( - &args.secret_sender_offset_key_id, - &args.secret_nonce_key_id, + &args.sender_offset_key_id, + &args.sender_offset_nonce_key_id, &challenge, ) .await @@ -992,6 +1027,119 @@ pub async fn command_runner( Err(e) => eprintln!("SignMessage error! {}", e), } }, + FaucetCreateInputOutputSigs(args) => { + // Script signature + let script = TariScript::from_hex(&args.input_script) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let input_data = ExecutionStack::from_hex(&args.input_stack) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let commitment = Commitment::from_hex(&args.input_commitment) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let ephemeral_commitment = Commitment::from_hex(&args.script_ephemeral_commitment) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let ephemeral_pubkey = PublicKey::from(args.script_ephemeral_pubkey); + let challenge = TransactionInput::build_script_signature_challenge( + &TransactionInputVersion::get_current_version(), + &ephemeral_commitment, + &ephemeral_pubkey, + &script, + &input_data, + &args.total_script_key.into(), + &commitment, + ); + + let mut script_signature = Signature::default(); + match key_manager_service + .sign_with_nonce_and_message(&args.wallet_spend_key_id, &args.spend_nonce_key_id, &challenge) + .await + { + Ok(signature) => { + script_signature = signature; + }, + Err(e) => eprintln!("Script signature SignMessage error! {}", e), + } + + // Metadata signature + let offset = key_manager_service + .get_script_offset(&vec![args.wallet_spend_key_id], &vec![args + .sender_offset_key_id + .clone()]) + .await?; + let script = script!(PushPubKey(Box::new(args.recipient_address.public_spend_key().clone()))); + let commitment = Commitment::from_hex(&args.output_commitment) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let covenant = Covenant::default(); + let encrypted_data = EncryptedData::from_hex(&args.encrypted_data) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let output_features = serde_json::from_str(&args.output_features) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let ephemeral_commitment = Commitment::from_hex(&args.metadata_ephemeral_commitment) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let ephemeral_pubkey = PublicKey::from_hex(&args.metadata_ephemeral_pubkey) + .map_err(|e| CommandError::InvalidArgument(e.to_string()))?; + let minimum_value_promise = MicroMinotari::zero(); + trace!( + target: LOG_TARGET, + "version: {:?}", + TransactionOutputVersion::get_current_version() + ); + trace!(target: LOG_TARGET, "script: {:?}", script); + trace!(target: LOG_TARGET, "output features: {:?}", output_features); + let offsetkey: PublicKey = args.total_metadata_key.clone().into(); + trace!(target: LOG_TARGET, "sender_offset_public_key: {:?}", offsetkey); + trace!(target: LOG_TARGET, "ephemeral_commitment: {:?}", ephemeral_commitment); + trace!(target: LOG_TARGET, "ephemeral_pubkey: {:?}", ephemeral_pubkey); + trace!(target: LOG_TARGET, "commitment: {:?}", commitment); + trace!(target: LOG_TARGET, "covenant: {:?}", covenant); + trace!(target: LOG_TARGET, "encrypted_value: {:?}", encrypted_data); + trace!(target: LOG_TARGET, "minimum_value_promise: {:?}", minimum_value_promise); + let challenge = TransactionOutput::build_metadata_signature_challenge( + &TransactionOutputVersion::get_current_version(), + &script, + &output_features, + &args.total_metadata_key.into(), + &ephemeral_commitment, + &ephemeral_pubkey, + &commitment, + &covenant, + &encrypted_data, + minimum_value_promise, + ); + trace!(target: LOG_TARGET, "meta challenge: {:?}", challenge); + + let mut metadata_signature = Signature::default(); + match key_manager_service + .sign_with_nonce_and_message( + &args.sender_offset_key_id, + &args.sender_offset_nonce_key_id, + &challenge, + ) + .await + { + Ok(signature) => { + metadata_signature = signature; + }, + Err(e) => eprintln!("Metadata signature SignMessage error! {}", e), + } + + if script_signature.get_signature() == Signature::default().get_signature() || + metadata_signature.get_signature() == Signature::default().get_signature() + { + eprintln!("Script and/or metadata signatures not created") + } else { + println!( + "Input and output signatures created: + 1. script signature: ({},{}) + 1. metadata signature: ({},{}) + 2. script offset: {}", + script_signature.get_signature().to_hex(), + script_signature.get_public_nonce().to_hex(), + metadata_signature.get_signature().to_hex(), + metadata_signature.get_public_nonce().to_hex(), + offset.to_hex(), + ); + } + }, SendMinotari(args) => { match send_tari( transaction_service.clone(), diff --git a/applications/minotari_console_wallet/src/automation/mod.rs b/applications/minotari_console_wallet/src/automation/mod.rs index 1470375082..13da4f173f 100644 --- a/applications/minotari_console_wallet/src/automation/mod.rs +++ b/applications/minotari_console_wallet/src/automation/mod.rs @@ -24,3 +24,65 @@ pub mod commands; pub mod error; // removed temporarily add back in when used. // mod prompt; + +use serde::{Deserialize, Serialize}; +use tari_common_types::{ + transaction::TxId, + types::{Commitment, PrivateKey, PublicKey, Signature}, +}; +use tari_core::transactions::{ + key_manager::TariKeyId, + transaction_components::{EncryptedData, OutputFeatures}, +}; +use tari_script::{CheckSigSchnorrSignature, ExecutionStack, TariScript}; + +/// Outputs for self with `FaucetCreatePartyDetails` +#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)] +struct Step1OutputsForSelf { + wallet_spend_key_id: TariKeyId, + script_nonce_key_id: TariKeyId, + sender_offset_key_id: TariKeyId, + sender_offset_nonce_key_id: TariKeyId, +} + +/// Outputs for leader with `FaucetCreatePartyDetails` +#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)] +struct Step1OutputsForLeader { + script_input_signature: CheckSigSchnorrSignature, + wallet_public_spend_key: PublicKey, + public_script_nonce_key: PublicKey, + public_sender_offset_key: PublicKey, + public_sender_offset_nonce_key: PublicKey, + shared_secret_public_key: PublicKey, +} + +/// Outputs for self with `FaucetEncumberAggregateUtxo` +#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)] +struct Step2OutputsForSelf { + tx_id: TxId, +} + +/// Outputs for parties with `FaucetEncumberAggregateUtxo` +#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)] +struct Step2OutputsForParties { + input_commitment: Commitment, + input_stack: ExecutionStack, + input_script: TariScript, + total_script_key: PublicKey, + script_signature_ephemeral_commitment: Commitment, + script_signature_ephemeral_pubkey: PublicKey, + output_commitment: Commitment, + sender_offset_pubkey: PublicKey, + metadata_signature_ephemeral_commitment: Commitment, + metadata_signature_ephemeral_pubkey: PublicKey, + encrypted_data: EncryptedData, + output_features: OutputFeatures, +} + +/// Outputs for leader with `FaucetCreateScriptSig` and `FaucetCreateMetaSig` +#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)] +struct Step3OutputsForLeader { + script_signature: Signature, + metadata_signature: Signature, + script_offset: PrivateKey, +} diff --git a/applications/minotari_console_wallet/src/cli.rs b/applications/minotari_console_wallet/src/cli.rs index 3f10360494..1354ba18b3 100644 --- a/applications/minotari_console_wallet/src/cli.rs +++ b/applications/minotari_console_wallet/src/cli.rs @@ -124,6 +124,7 @@ pub enum CliCommands { FaucetCreatePartyDetails(FaucetCreatePartyDetailsArgs), FaucetCreateScriptSig(FaucetCreateScriptSigArgs), FaucetCreateMetaSig(FaucetCreateMetaSigArgs), + FaucetCreateInputOutputSigs(FaucetCreateInputOutputSigArgs), SendOneSidedToStealthAddress(SendMinotariArgs), MakeItRain(MakeItRainArgs), CoinSplit(CoinSplitArgs), @@ -244,39 +245,79 @@ pub struct FaucetSpendAggregateUtxoArgs { #[derive(Debug, Args, Clone)] pub struct FaucetCreateScriptSigArgs { #[clap(long)] - pub private_key_id: TariKeyId, + pub wallet_spend_key_id: TariKeyId, #[clap(long)] - pub secret_nonce_key_id: TariKeyId, + pub spend_nonce_key_id: TariKeyId, #[clap(long)] pub input_script: String, #[clap(long)] pub input_stack: String, #[clap(long)] - pub ephemeral_commitment: String, + pub script_ephemeral_commitment: String, #[clap(long)] - pub ephemeral_pubkey: UniPublicKey, + pub script_ephemeral_pubkey: UniPublicKey, #[clap(long)] pub total_script_key: UniPublicKey, #[clap(long)] - pub commitment: String, + pub input_commitment: String, } #[derive(Debug, Args, Clone)] pub struct FaucetCreateMetaSigArgs { #[clap(long)] - pub secret_script_key_id: TariKeyId, + pub wallet_spend_key_id: TariKeyId, #[clap(long)] - pub secret_sender_offset_key_id: TariKeyId, + pub sender_offset_key_id: TariKeyId, #[clap(long)] - pub secret_nonce_key_id: TariKeyId, + pub sender_offset_nonce_key_id: TariKeyId, #[clap(long)] - pub ephemeral_commitment: String, + pub metadata_ephemeral_commitment: String, #[clap(long)] - pub ephemeral_pubkey: String, + pub metadata_ephemeral_pubkey: String, #[clap(long)] - pub total_meta_key: UniPublicKey, + pub total_metadata_key: UniPublicKey, #[clap(long)] - pub commitment: String, + pub output_commitment: String, + #[clap(long)] + pub encrypted_data: String, + #[clap(long)] + pub output_features: String, + #[clap(long)] + pub recipient_address: TariAddress, +} + +#[derive(Debug, Args, Clone)] +pub struct FaucetCreateInputOutputSigArgs { + #[clap(long)] + pub wallet_spend_key_id: TariKeyId, + + #[clap(long)] + pub spend_nonce_key_id: TariKeyId, + #[clap(long)] + pub input_script: String, + #[clap(long)] + pub input_stack: String, + #[clap(long)] + pub script_ephemeral_commitment: String, + #[clap(long)] + pub script_ephemeral_pubkey: UniPublicKey, + #[clap(long)] + pub total_script_key: UniPublicKey, + #[clap(long)] + pub input_commitment: String, + + #[clap(long)] + pub sender_offset_key_id: TariKeyId, + #[clap(long)] + pub sender_offset_nonce_key_id: TariKeyId, + #[clap(long)] + pub metadata_ephemeral_commitment: String, + #[clap(long)] + pub metadata_ephemeral_pubkey: String, + #[clap(long)] + pub total_metadata_key: UniPublicKey, + #[clap(long)] + pub output_commitment: String, #[clap(long)] pub encrypted_data: String, #[clap(long)] diff --git a/applications/minotari_console_wallet/src/wallet_modes.rs b/applications/minotari_console_wallet/src/wallet_modes.rs index a35d719f20..5ff570c7ce 100644 --- a/applications/minotari_console_wallet/src/wallet_modes.rs +++ b/applications/minotari_console_wallet/src/wallet_modes.rs @@ -144,14 +144,12 @@ pub(crate) fn command_mode( wallet: WalletSqlite, command: CliCommands, ) -> Result<(), ExitError> { - let commands = vec![command]; - // Do not remove this println! const CUCUMBER_TEST_MARKER_A: &str = "Minotari Console Wallet running... (Command mode started)"; println!("{}", CUCUMBER_TEST_MARKER_A); info!(target: LOG_TARGET, "Starting wallet command mode"); - handle.block_on(command_runner(config, commands, wallet.clone()))?; + handle.block_on(command_runner(config, vec![command.clone()], wallet.clone()))?; // Do not remove this println! const CUCUMBER_TEST_MARKER_B: &str = "Minotari Console Wallet running... (Command mode completed)"; @@ -159,7 +157,25 @@ pub(crate) fn command_mode( info!(target: LOG_TARGET, "Completed wallet command mode"); - wallet_or_exit(handle, cli, config, base_node_config, wallet) + wallet_or_exit( + handle, + cli, + config, + base_node_config, + wallet, + force_exit_for_faucet_commands(&command), + ) +} + +fn force_exit_for_faucet_commands(command: &CliCommands) -> bool { + match command { + CliCommands::FaucetEncumberAggregateUtxo(_) | + CliCommands::FaucetSpendAggregateUtxo(_) | + CliCommands::FaucetCreatePartyDetails(_) | + CliCommands::FaucetCreateScriptSig(_) | + CliCommands::FaucetCreateMetaSig(_) => true, + _ => false, + } } pub(crate) fn parse_command_file(script: String) -> Result, ExitError> { @@ -206,22 +222,33 @@ pub(crate) fn script_mode( println!("Parsing commands..."); let commands = parse_command_file(script)?; - println!("{} commands parsed successfully.", commands.len()); + let mut exit_wallet = false; + for command in &commands { + if force_exit_for_faucet_commands(command) { + println!("Faucet commands may not run in script mode!"); + exit_wallet = true; + break; + } + } - // Do not remove this println! - const CUCUMBER_TEST_MARKER_A: &str = "Minotari Console Wallet running... (Script mode started)"; - println!("{}", CUCUMBER_TEST_MARKER_A); + if !exit_wallet { + println!("{} commands parsed successfully.", commands.len()); - println!("Starting the command runner!"); - handle.block_on(command_runner(config, commands, wallet.clone()))?; + // Do not remove this println! + const CUCUMBER_TEST_MARKER_A: &str = "Minotari Console Wallet running... (Script mode started)"; + println!("{}", CUCUMBER_TEST_MARKER_A); - // Do not remove this println! - const CUCUMBER_TEST_MARKER_B: &str = "Minotari Console Wallet running... (Script mode completed)"; - println!("{}", CUCUMBER_TEST_MARKER_B); + println!("Starting the command runner!"); + handle.block_on(command_runner(config, commands, wallet.clone()))?; - info!(target: LOG_TARGET, "Completed wallet script mode"); + // Do not remove this println! + const CUCUMBER_TEST_MARKER_B: &str = "Minotari Console Wallet running... (Script mode completed)"; + println!("{}", CUCUMBER_TEST_MARKER_B); - wallet_or_exit(handle, cli, config, base_node_config, wallet) + info!(target: LOG_TARGET, "Completed wallet script mode"); + } + + wallet_or_exit(handle, cli, config, base_node_config, wallet, exit_wallet) } /// Prompts the user to continue to the wallet, or exit. @@ -231,11 +258,16 @@ fn wallet_or_exit( config: &WalletConfig, base_node_config: &PeerConfig, wallet: WalletSqlite, + force_exit: bool, ) -> Result<(), ExitError> { if cli.command_mode_auto_exit { info!(target: LOG_TARGET, "Auto exit argument supplied - exiting."); return Ok(()); } + if force_exit { + info!(target: LOG_TARGET, "Forced exit argument supplied by process - exiting."); + return Ok(()); + } if cli.non_interactive_mode { info!(target: LOG_TARGET, "Starting GRPC server."); @@ -528,23 +560,42 @@ mod test { --recipient-address f4LR9f6WwwcPiKJjK5ciTkU1ocNhANa3FPw1wkyVUwbuKpgiihawCXy6PFszunUWQ4Te8KVFnyWVHHwsk9x5Cg7ZQiA faucet-create-script-sig \ - --private-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ - --secret-nonce-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --wallet-spend-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --spend-nonce-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ --input-script ae010268593ed2d36a2d95f0ffe0f41649b97cc36fc4ef0c8ecd6bd28f9d56c76b793b08691435a5c813578f8a7f4973166dc1c6c15f37aec2a7d65b1583c8b2129364c916d5986a0c1b3dac7d6efb94bed688ba52fa8b962cf27c0446e2fea6d66a04 \ --input-stack 050857c14f72cf885aac9f08c9484cb7cb06b6cc20eab68c9bee1e8d5a85649b0a6d31c5cc49afc1e03ebbcf55c82f47e8cbc796c33e96c17a31eab027ee821f00 \ - --ephemeral-commitment f6b2ca781342a3ebe30ee1643655c96f1d7c14f4d49f077695395de98ae73665 \ - --ephemeral-pubkey 8a55d1cb503be36875d38f2dc6abac7b23445bbd7253684a1506f5ee1855cd58 \ + --script-ephemeral-commitment f6b2ca781342a3ebe30ee1643655c96f1d7c14f4d49f077695395de98ae73665 \ + --script-ephemeral-pubkey 8a55d1cb503be36875d38f2dc6abac7b23445bbd7253684a1506f5ee1855cd58 \ --total-script-key 5c4f2a4b3f3f84e047333218a84fd24f581a9d7e4f23b78e3714e9d174427d61 \ - --commitment 94966b4f1b5dc050df1109cf07a516ae85912c82503b1a8c1625986a569fae67 + --input-commitment 94966b4f1b5dc050df1109cf07a516ae85912c82503b1a8c1625986a569fae67 faucet-create-meta-sig \ - --secret-script-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ - --secret-sender-offset-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ - --secret-nonce-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ - --ephemeral-commitment f6b2ca781342a3ebe30ee1643655c96f1d7c14f4d49f077695395de98ae73665 \ - --ephemeral-pubkey 8a55d1cb503be36875d38f2dc6abac7b23445bbd7253684a1506f5ee1855cd58 \ - --total-meta-key 5c4f2a4b3f3f84e047333218a84fd24f581a9d7e4f23b78e3714e9d174427d61 \ - --commitment 94966b4f1b5dc050df1109cf07a516ae85912c82503b1a8c1625986a569fae67 \ + --wallet-spend-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --sender-offset-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --sender-offset-nonce-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --metadata-ephemeral-commitment f6b2ca781342a3ebe30ee1643655c96f1d7c14f4d49f077695395de98ae73665 \ + --metadata-ephemeral-pubkey 8a55d1cb503be36875d38f2dc6abac7b23445bbd7253684a1506f5ee1855cd58 \ + --total-metadata-key 5c4f2a4b3f3f84e047333218a84fd24f581a9d7e4f23b78e3714e9d174427d61 \ + --output-commitment 94966b4f1b5dc050df1109cf07a516ae85912c82503b1a8c1625986a569fae67 \ + --encrypted-data 6a7aa2053ae187f60f27df0e10184bf93d02a84cd9548320ec7da546185fc23c6daa720974007c6106cfb0361eb9828e1af979b69fff724d2bcd0d86d5b9675ef1f65b424b22bee06e52fcaf4fd2a2ed \ + --output-features 'features' \ + --recipient-address f4FB7HhYCmLw4PsivjG8bAgUuxyPS6GTjFkhMWx6d9Nv4aoBESyaH5TdS1dAkSCg4qXqehpjZU9QrSUP2Ec7v4Gj8wf + + faucet-create-input-output-sigs \ + --wallet-spend-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --spend-nonce-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --input-script ae010268593ed2d36a2d95f0ffe0f41649b97cc36fc4ef0c8ecd6bd28f9d56c76b793b08691435a5c813578f8a7f4973166dc1c6c15f37aec2a7d65b1583c8b2129364c916d5986a0c1b3dac7d6efb94bed688ba52fa8b962cf27c0446e2fea6d66a04 \ + --input-stack 050857c14f72cf885aac9f08c9484cb7cb06b6cc20eab68c9bee1e8d5a85649b0a6d31c5cc49afc1e03ebbcf55c82f47e8cbc796c33e96c17a31eab027ee821f00 \ + --script-ephemeral-commitment f6b2ca781342a3ebe30ee1643655c96f1d7c14f4d49f077695395de98ae73665 \ + --script-ephemeral-pubkey 8a55d1cb503be36875d38f2dc6abac7b23445bbd7253684a1506f5ee1855cd58 \ + --total-script-key 5c4f2a4b3f3f84e047333218a84fd24f581a9d7e4f23b78e3714e9d174427d61 \ + --input-commitment 94966b4f1b5dc050df1109cf07a516ae85912c82503b1a8c1625986a569fae67 \ + --sender-offset-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --sender-offset-nonce-key-id imported.96159b07298a453c9f514f5307f70659c7561dd6d9ed376854c5cb573cb2e311 \ + --metadata-ephemeral-commitment f6b2ca781342a3ebe30ee1643655c96f1d7c14f4d49f077695395de98ae73665 \ + --metadata-ephemeral-pubkey 8a55d1cb503be36875d38f2dc6abac7b23445bbd7253684a1506f5ee1855cd58 \ + --total-metadata-key 5c4f2a4b3f3f84e047333218a84fd24f581a9d7e4f23b78e3714e9d174427d61 \ + --output-commitment 94966b4f1b5dc050df1109cf07a516ae85912c82503b1a8c1625986a569fae67 \ --encrypted-data 6a7aa2053ae187f60f27df0e10184bf93d02a84cd9548320ec7da546185fc23c6daa720974007c6106cfb0361eb9828e1af979b69fff724d2bcd0d86d5b9675ef1f65b424b22bee06e52fcaf4fd2a2ed \ --output-features 'features' \ --recipient-address f4FB7HhYCmLw4PsivjG8bAgUuxyPS6GTjFkhMWx6d9Nv4aoBESyaH5TdS1dAkSCg4qXqehpjZU9QrSUP2Ec7v4Gj8wf @@ -573,6 +624,7 @@ mod test { let mut faucet_create_party_details = false; let mut faucet_create_script_sig = false; let mut faucet_create_meta_sig = false; + let mut faucet_create_input_output_sigs = false; let mut make_it_rain = false; let mut coin_split = false; let mut discover_peer = false; @@ -589,6 +641,7 @@ mod test { CliCommands::FaucetCreatePartyDetails(_) => faucet_create_party_details = true, CliCommands::FaucetCreateScriptSig(_) => faucet_create_script_sig = true, CliCommands::FaucetCreateMetaSig(_) => faucet_create_meta_sig = true, + CliCommands::FaucetCreateInputOutputSigs(_) => faucet_create_input_output_sigs = true, CliCommands::SendOneSidedToStealthAddress(_) => {}, CliCommands::MakeItRain(_) => make_it_rain = true, CliCommands::CoinSplit(_) => coin_split = true, @@ -627,6 +680,7 @@ mod test { faucet_create_party_details && faucet_create_script_sig && faucet_create_meta_sig && + faucet_create_input_output_sigs && make_it_rain && coin_split && discover_peer &&