pub fn add_inputs_to_slate<T: ?Sized, C, K>(
	wallet: &mut T,
	slate: &mut Slate,
	minimum_confirmations: u64,
	max_outputs: usize,
	num_change_outputs: usize,
	selection_strategy_is_use_all: bool,
	parent_key_id: &Identifier,
	participant_id: usize,
	message: Option<String>,
	is_initator: bool,
	use_test_rng: bool,
) -> Result<Context, Error>
where
	T: WalletBackend<C, K>,
	C: NodeClient,
	K: Keychain,
{
	// sender should always refresh outputs
	updater::refresh_outputs(wallet, parent_key_id, false)?;

	// Sender selects outputs into a new slate and save our corresponding keys in
	// a transaction context. The secret key in our transaction context will be
	// randomly selected. This returns the public slate, and a closure that locks
	// our inputs and outputs once we're convinced the transaction exchange went
	// according to plan
	// This function is just a big helper to do all of that, in theory
	// this process can be split up in any way
	let mut context = selection::build_send_tx(
		wallet,
		slate,
		minimum_confirmations,
		max_outputs,
		num_change_outputs,
		selection_strategy_is_use_all,
		parent_key_id.clone(),
		use_test_rng,
	)?;

	// Generate a kernel offset and subtract from our context's secret key. Store
	// the offset in the slate's transaction kernel, and adds our public key
	// information to the slate
	let _ = slate.fill_round_1(
		wallet.keychain(),
		&mut context.sec_key,
		&context.sec_nonce,
		participant_id,
		message,
		use_test_rng,
	)?;

	if !is_initator {
		// perform partial sig
		let _ = slate.fill_round_2(
			wallet.keychain(),
			&context.sec_key,
			&context.sec_nonce,
			participant_id,
		)?;
	}

	Ok(context)
}
/// Add inputs to the slate (effectively becoming the sender)
Add inputs to the slate (effectively becoming the sender)
Add inputs to the slate ( effectively becoming the sender )
pub fn add_inputs_to_slate<T: ?Sized, C, K>(
	wallet: &mut T,
	slate: &mut Slate,
	minimum_confirmations: u64,
	max_outputs: usize,
	num_change_outputs: usize,
	selection_strategy_is_use_all: bool,
	parent_key_id: &Identifier,
	participant_id: usize,
	message: Option<String>,
	is_initator: bool,
	use_test_rng: bool,
) -> Result<Context, Error>
where
	T: WalletBackend<C, K>,
	C: NodeClient,
	K: Keychain,
{
	// sender should always refresh outputs
	updater::refresh_outputs(wallet, parent_key_id, false)?;
	// Sender selects outputs into a new slate and save our corresponding keys in
	// a transaction context. The secret key in our transaction context will be
	// randomly selected. This returns the public slate, and a closure that locks
	// our inputs and outputs once we're convinced the transaction exchange went
	// according to plan
	// This function is just a big helper to do all of that, in theory
	// this process can be split up in any way
	let mut context = selection::build_send_tx(
		wallet,
		slate,
		minimum_confirmations,
		max_outputs,
		num_change_outputs,
		selection_strategy_is_use_all,
		parent_key_id.clone(),
		use_test_rng,
	)?;
	// Generate a kernel offset and subtract from our context's secret key. Store
	// the offset in the slate's transaction kernel, and adds our public key
	// information to the slate
	let _ = slate.fill_round_1(
		wallet.keychain(),
		&mut context.sec_key,
		&context.sec_nonce,
		participant_id,
		message,
		use_test_rng,
	)?;
	if !is_initator {
		// perform partial sig
		let _ = slate.fill_round_2(
			wallet.keychain(),
			&context.sec_key,
			&context.sec_nonce,
			participant_id,
		)?;
	}
	Ok(context)
}
pub fn add_inputs_to_slate < T : ? Sized , C , K > ( wallet : & mut T , slate : & mut Slate , minimum_confirmations : u64 , max_outputs : usize , num_change_outputs : usize , selection_strategy_is_use_all : bool , parent_key_id : & Identifier , participant_id : usize , message : Option < String > , is_initator : bool , use_test_rng : bool , ) -> Result < Context , Error > where T : WalletBackend < C , K > , C : NodeClient , K : Keychain , { // sender should always refresh outputs updater :: refresh_outputs ( wallet , parent_key_id , false ) ? ; // Sender selects outputs into a new slate and save our corresponding keys in // a transaction context. The secret key in our transaction context will be // randomly selected. This returns the public slate, and a closure that locks // our inputs and outputs once we're convinced the transaction exchange went // according to plan // This function is just a big helper to do all of that, in theory // this process can be split up in any way let mut context = selection :: build_send_tx ( wallet , slate , minimum_confirmations , max_outputs , num_change_outputs , selection_strategy_is_use_all , parent_key_id . clone ( ) , use_test_rng , ) ? ; // Generate a kernel offset and subtract from our context's secret key. Store // the offset in the slate's transaction kernel, and adds our public key // information to the slate let _ = slate . fill_round_1 ( wallet . keychain ( ) , & mut context . sec_key , & context . sec_nonce , participant_id , message , use_test_rng , ) ? ; if ! is_initator { // perform partial sig let _ = slate . fill_round_2 ( wallet . keychain ( ) , & context . sec_key , & context . sec_nonce , participant_id , ) ? ; } Ok ( context ) }
Add inputs to the slate (effectively becoming the sender)
Add inputs to the slate ( effectively becoming the sender )
wallet
&mut T
slate
&mut Slate
minimum_confirmations
u64
max_outputs
usize
num_change_outputs
usize
selection_strategy_is_use_all
bool
parent_key_id
&Identifier
participant_id
usize
message
Option<String>
is_initator
bool
use_test_rng
bool