fn create_context<'a, T: ?Sized, C, K>(
	wallet: &mut T,
	keychain_mask: Option<&SecretKey>,
	swap_api: &mut Box<dyn SwapApi<K> + 'a>,
	keychain: &K,
	secondary_currency: Currency,
	is_seller: bool,
	inputs: Option<Vec<(Identifier, Option<u64>, u64)>>,
	change_amount: u64,
) -> Result<Context, Error>
where
	T: WalletBackend<'a, C, K>,
	C: NodeClient + 'a,
	K: Keychain + 'a,
{
	let secondary_key_size =
		(**swap_api).context_key_count(keychain, secondary_currency, is_seller)?;
	let mut keys: Vec<Identifier> = Vec::new();

	for _ in 0..secondary_key_size {
		keys.push(wallet.next_child(keychain_mask)?);
	}

	let context = (**swap_api).create_context(
		keychain,
		secondary_currency,
		is_seller,
		inputs,
		change_amount,
		keys,
	)?;

	Ok(context)
}
// Local Helper method to create a context
Local Helper method to create a context
Local Helper method to create a context
fn create_context<'a, T: ?Sized, C, K>(
	wallet: &mut T,
	keychain_mask: Option<&SecretKey>,
	swap_api: &mut Box<dyn SwapApi<K> + 'a>,
	keychain: &K,
	secondary_currency: Currency,
	is_seller: bool,
	inputs: Option<Vec<(Identifier, Option<u64>, u64)>>,
	change_amount: u64,
) -> Result<Context, Error>
where
	T: WalletBackend<'a, C, K>,
	C: NodeClient + 'a,
	K: Keychain + 'a,
{
	let secondary_key_size =
		(**swap_api).context_key_count(keychain, secondary_currency, is_seller)?;
	let mut keys: Vec<Identifier> = Vec::new();
	for _ in 0..secondary_key_size {
		keys.push(wallet.next_child(keychain_mask)?);
	}
	let context = (**swap_api).create_context(
		keychain,
		secondary_currency,
		is_seller,
		inputs,
		change_amount,
		keys,
	)?;
	Ok(context)
}
fn create_context < ' a , T : ? Sized , C , K > ( wallet : & mut T , keychain_mask : Option < & SecretKey > , swap_api : & mut Box < dyn SwapApi < K > + ' a > , keychain : & K , secondary_currency : Currency , is_seller : bool , inputs : Option < Vec < ( Identifier , Option < u64 > , u64 ) > > , change_amount : u64 , ) -> Result < Context , Error > where T : WalletBackend < ' a , C , K > , C : NodeClient + ' a , K : Keychain + ' a , { let secondary_key_size = ( * * swap_api ) . context_key_count ( keychain , secondary_currency , is_seller ) ? ; let mut keys : Vec < Identifier > = Vec :: new ( ) ; for _ in 0 .. secondary_key_size { keys . push ( wallet . next_child ( keychain_mask ) ? ) ; } let context = ( * * swap_api ) . create_context ( keychain , secondary_currency , is_seller , inputs , change_amount , keys , ) ? ; Ok ( context ) }
Local Helper method to create a context
Local Helper method to create a context
wallet
&mut T
keychain_mask
Option<&SecretKey>
swap_api
&mut Box<dyn SwapApi<K> + 'a>
keychain
&K
secondary_currency
Currency
is_seller
bool
inputs
Option<Vec<(Identifier, Option<u64>, u64)>>
change_amount
u64
wallet
&mut T
keychain_mask
Option<&SecretKey>
swap_api
&mut Box<dyn SwapApi<K> + 'a>
keychain
&K
secondary_currency
Currency
is_seller
bool
inputs
Option<Vec<(Identifier, Option<u64>, u64)>>
change_amount
u64