pub fn partial_sign<T: KeypairUtil>(&mut self, keypairs: &[&T], recent_blockhash: Hash) {
        let signed_keys =
            &self.message.account_keys[0..self.message.header.num_required_signatures as usize];

        // if you change the blockhash, you're re-signing...
        if recent_blockhash != self.message.recent_blockhash {
            self.message.recent_blockhash = recent_blockhash;
            self.signatures
                .iter_mut()
                .for_each(|signature| *signature = Signature::default());
        }

        for keypair in keypairs {
            let i = signed_keys
                .iter()
                .position(|pubkey| pubkey == &keypair.pubkey())
                .expect("keypair-pubkey mismatch");

            self.signatures[i] = keypair.sign_message(&self.message_data())
        }
    }
/// Sign using some subset of required keys
///  if recent_blockhash is not the same as currently in the transaction,
///  clear any prior signatures and update recent_blockhash
Sign using some subset of required keys
if recent_blockhash is not the same as currently in the transaction,
clear any prior signatures and update recent_blockhash
Sign using some subset of required keys if recent_blockhash is not the same as currently in the transaction clear any prior signatures and update recent_blockhash
pub fn partial_sign<T: KeypairUtil>(&mut self, keypairs: &[&T], recent_blockhash: Hash) {
        let signed_keys =
            &self.message.account_keys[0..self.message.header.num_required_signatures as usize];
        // if you change the blockhash, you're re-signing...
        if recent_blockhash != self.message.recent_blockhash {
            self.message.recent_blockhash = recent_blockhash;
            self.signatures
                .iter_mut()
                .for_each(|signature| *signature = Signature::default());
        }
        for keypair in keypairs {
            let i = signed_keys
                .iter()
                .position(|pubkey| pubkey == &keypair.pubkey())
                .expect("keypair-pubkey mismatch");
            self.signatures[i] = keypair.sign_message(&self.message_data())
        }
    }
pub fn partial_sign < T : KeypairUtil > ( & mut self , keypairs : & [ & T ] , recent_blockhash : Hash ) { let signed_keys = & self . message . account_keys [ 0 .. self . message . header . num_required_signatures as usize ] ; // if you change the blockhash, you're re-signing... if recent_blockhash != self . message . recent_blockhash { self . message . recent_blockhash = recent_blockhash ; self . signatures . iter_mut ( ) . for_each ( | signature | * signature = Signature :: default ( ) ) ; } for keypair in keypairs { let i = signed_keys . iter ( ) . position ( | pubkey | pubkey == & keypair . pubkey ( ) ) . expect ( " " ) ; self . signatures [ i ] = keypair . sign_message ( & self . message_data ( ) ) } }
Sign using some subset of required keys
if recent_blockhash is not the same as currently in the transaction,
clear any prior signatures and update recent_blockhash
Sign using some subset of required keys if recent_blockhash is not the same as currently in the transaction clear any prior signatures and update recent_blockhash
&mut self
keypairs
&[&T]
recent_blockhash
Hash
&mut self
keypairs
&[&T]
recent_blockhash
Hash