fn add_participant_info<K>(
		&mut self,
		keychain: &K,
		sec_key: &SecretKey,
		sec_nonce: &SecretKey,
		id: usize,
		part_sig: Option<Signature>,
		message: Option<String>,
	) -> Result<(), Error>
	where
		K: Keychain,
	{
		// Add our public key and nonce to the slate
		let pub_key = PublicKey::from_secret_key(keychain.secp(), &sec_key)?;
		let pub_nonce = PublicKey::from_secret_key(keychain.secp(), &sec_nonce)?;

		// Sign the provided message
		let message_sig = {
			if let Some(m) = message.clone() {
				let hashed = blake2b(secp::constants::MESSAGE_SIZE, &[], &m.as_bytes()[..]);
				let m = secp::Message::from_slice(&hashed.as_bytes())?;
				let res = aggsig::sign_single(
					&keychain.secp(),
					&m,
					&sec_key,
					None,
					Some(&pub_key),
				)?;
				Some(res)
			} else {
				None
			}
		};
		self.participant_data.push(ParticipantData {
			id: id as u64,
			public_blind_excess: pub_key,
			public_nonce: pub_nonce,
			part_sig,
			message,
			message_sig,
		});
		Ok(())
	}
/// Adds participants public keys to the slate data
/// and saves participant's transaction context
/// sec_key can be overridden to replace the blinding
/// factor (by whoever split the offset)
Adds participants public keys to the slate data
and saves participant's transaction context
sec_key can be overridden to replace the blinding
factor (by whoever split the offset)
Adds participants public keys to the slate data and saves participant ' s transaction context sec_key can be overridden to replace the blinding factor ( by whoever split the offset )
fn add_participant_info<K>(
		&mut self,
		keychain: &K,
		sec_key: &SecretKey,
		sec_nonce: &SecretKey,
		id: usize,
		part_sig: Option<Signature>,
		message: Option<String>,
	) -> Result<(), Error>
	where
		K: Keychain,
	{
		// Add our public key and nonce to the slate
		let pub_key = PublicKey::from_secret_key(keychain.secp(), &sec_key)?;
		let pub_nonce = PublicKey::from_secret_key(keychain.secp(), &sec_nonce)?;
		// Sign the provided message
		let message_sig = {
			if let Some(m) = message.clone() {
				let hashed = blake2b(secp::constants::MESSAGE_SIZE, &[], &m.as_bytes()[..]);
				let m = secp::Message::from_slice(&hashed.as_bytes())?;
				let res = aggsig::sign_single(
					&keychain.secp(),
					&m,
					&sec_key,
					None,
					Some(&pub_key),
				)?;
				Some(res)
			} else {
				None
			}
		};
		self.participant_data.push(ParticipantData {
			id: id as u64,
			public_blind_excess: pub_key,
			public_nonce: pub_nonce,
			part_sig,
			message,
			message_sig,
		});
		Ok(())
	}
fn add_participant_info < K > ( & mut self , keychain : & K , sec_key : & SecretKey , sec_nonce : & SecretKey , id : usize , part_sig : Option < Signature > , message : Option < String > , ) -> Result < ( ) , Error > where K : Keychain , { // Add our public key and nonce to the slate let pub_key = PublicKey :: from_secret_key ( keychain . secp ( ) , & sec_key ) ? ; let pub_nonce = PublicKey :: from_secret_key ( keychain . secp ( ) , & sec_nonce ) ? ; // Sign the provided message let message_sig = { if let Some ( m ) = message . clone ( ) { let hashed = blake2b ( secp :: constants :: MESSAGE_SIZE , & [ ] , & m . as_bytes ( ) [ .. ] ) ; let m = secp :: Message :: from_slice ( & hashed . as_bytes ( ) ) ? ; let res = aggsig :: sign_single ( & keychain . secp ( ) , & m , & sec_key , None , Some ( & pub_key ) , ) ? ; Some ( res ) } else { None } } ; self . participant_data . push ( ParticipantData { id : id as u64 , public_blind_excess : pub_key , public_nonce : pub_nonce , part_sig , message , message_sig , } ) ; Ok ( ( ) ) }
Adds participants public keys to the slate data
and saves participant's transaction context
sec_key can be overridden to replace the blinding
factor (by whoever split the offset)
Adds participants public keys to the slate data and saves participant ' s transaction context sec_key can be overridden to replace the blinding factor ( by whoever split the offset )
&mut self
keychain
&K
sec_key
&SecretKey
sec_nonce
&SecretKey
id
usize
part_sig
Option<Signature>
message
Option<String>
&mut self
keychain
&K
sec_key
&SecretKey
sec_nonce
&SecretKey
id
usize
part_sig
Option<Signature>
message
Option<String>