pub fn sort_tx(&self, tx: &mut Transaction) {
        match self {
            TxOrdering::Untouched => {}
            TxOrdering::Shuffle => {
                use rand::seq::SliceRandom;
                #[cfg(test)]
                use rand::SeedableRng;

                #[cfg(not(test))]
                let mut rng = rand::thread_rng();
                #[cfg(test)]
                let mut rng = rand::rngs::StdRng::seed_from_u64(0);

                tx.output.shuffle(&mut rng);
            }
            TxOrdering::Bip69Lexicographic => {
                tx.input.sort_unstable_by_key(|txin| {
                    (txin.previous_output.txid, txin.previous_output.vout)
                });
                tx.output
                    .sort_unstable_by_key(|txout| (txout.value, txout.script_pubkey.clone()));
            }
        }
    }
/// Sort transaction inputs and outputs by [`TxOrdering`] variant
Sort transaction inputs and outputs by [`TxOrdering`] variant
Sort transaction inputs and outputs by [ ` TxOrdering ` ] variant
pub fn sort_tx(&self, tx: &mut Transaction) {
        match self {
            TxOrdering::Untouched => {}
            TxOrdering::Shuffle => {
                use rand::seq::SliceRandom;
                #[cfg(test)]
                use rand::SeedableRng;
                #[cfg(not(test))]
                let mut rng = rand::thread_rng();
                #[cfg(test)]
                let mut rng = rand::rngs::StdRng::seed_from_u64(0);
                tx.output.shuffle(&mut rng);
            }
            TxOrdering::Bip69Lexicographic => {
                tx.input.sort_unstable_by_key(|txin| {
                    (txin.previous_output.txid, txin.previous_output.vout)
                });
                tx.output
                    .sort_unstable_by_key(|txout| (txout.value, txout.script_pubkey.clone()));
            }
        }
    }
pub fn sort_tx ( & self , tx : & mut Transaction ) { match self { TxOrdering :: Untouched => { } TxOrdering :: Shuffle => { use rand :: seq :: SliceRandom ; # [ cfg ( test ) ] use rand :: SeedableRng ; # [ cfg ( not ( test ) ) ] let mut rng = rand :: thread_rng ( ) ; # [ cfg ( test ) ] let mut rng = rand :: rngs :: StdRng :: seed_from_u64 ( 0 ) ; tx . output . shuffle ( & mut rng ) ; } TxOrdering :: Bip69Lexicographic => { tx . input . sort_unstable_by_key ( | txin | { ( txin . previous_output . txid , txin . previous_output . vout ) } ) ; tx . output . sort_unstable_by_key ( | txout | ( txout . value , txout . script_pubkey . clone ( ) ) ) ; } } }
Sort transaction inputs and outputs by [`TxOrdering`] variant
Sort transaction inputs and outputs by [ ` TxOrdering ` ] variant
&self
tx
&mut Transaction
&self
tx
&mut Transaction