pub fn from_counts(c: usize, t: usize, p: &RollupBenchParams<E, H>) -> Self {
        let gens = FixedGenerators::SpendingKeyGenerator;
        let hasher = Pedersen::<E> {
            params: p.jj_params.clone(),
        };
        let mut sks = Vec::new();
        let mut rng = rand::thread_rng();
        for _ in 0..c {
            sks.push(PrivateKey(rng.gen()));
        }
        let pks: Vec<_> = sks
            .iter()
            .map(|k| PublicKey::from_private(k, gens, p.jj_params.as_ref()))
            .collect();
        let mut accounts = Accounts::new(&p.set_params);
        for i in 0..c {
            let account = Account {
                id: pks[i].clone(),
                amt: if i == 0 { 1 } else { 0 },
                next_tx_no: 0,
            };
            accounts.insert(account);
        }
        let mut transactions = Vec::new();
        for i in 0..t {
            let action = Action {
                dst: pks[(i + 1) % c].clone(),
                amt: 1,
                tx_no: (i / c) as u64,
            };
            transactions.push(action.sign(
                &mut rng,
                gens,
                p.jj_params.as_ref(),
                &hasher,
                &sks[i % c],
            ));
        }
        let final_digest = {
            let mut accounts = accounts.clone();
            for t in &transactions {
                accounts.apply_tx(&t.tx);
            }
            accounts.digest()
        };
        Self {
            transactions,
            accounts,
            final_digest,
        }
    }
/// Creates a benchmark where `t` coins are exchanged in a pool of size `c`.
Creates a benchmark where `t` coins are exchanged in a pool of size `c`.
Creates a benchmark where ` t ` coins are exchanged in a pool of size ` c ` .
pub fn from_counts(c: usize, t: usize, p: &RollupBenchParams<E, H>) -> Self {
        let gens = FixedGenerators::SpendingKeyGenerator;
        let hasher = Pedersen::<E> {
            params: p.jj_params.clone(),
        };
        let mut sks = Vec::new();
        let mut rng = rand::thread_rng();
        for _ in 0..c {
            sks.push(PrivateKey(rng.gen()));
        }
        let pks: Vec<_> = sks
            .iter()
            .map(|k| PublicKey::from_private(k, gens, p.jj_params.as_ref()))
            .collect();
        let mut accounts = Accounts::new(&p.set_params);
        for i in 0..c {
            let account = Account {
                id: pks[i].clone(),
                amt: if i == 0 { 1 } else { 0 },
                next_tx_no: 0,
            };
            accounts.insert(account);
        }
        let mut transactions = Vec::new();
        for i in 0..t {
            let action = Action {
                dst: pks[(i + 1) % c].clone(),
                amt: 1,
                tx_no: (i / c) as u64,
            };
            transactions.push(action.sign(
                &mut rng,
                gens,
                p.jj_params.as_ref(),
                &hasher,
                &sks[i % c],
            ));
        }
        let final_digest = {
            let mut accounts = accounts.clone();
            for t in &transactions {
                accounts.apply_tx(&t.tx);
            }
            accounts.digest()
        };
        Self {
            transactions,
            accounts,
            final_digest,
        }
    }
pub fn from_counts ( c : usize , t : usize , p : & RollupBenchParams < E , H > ) -> Self { let gens = FixedGenerators :: SpendingKeyGenerator ; let hasher = Pedersen :: < E > { params : p . jj_params . clone ( ) , } ; let mut sks = Vec :: new ( ) ; let mut rng = rand :: thread_rng ( ) ; for _ in 0 .. c { sks . push ( PrivateKey ( rng . gen ( ) ) ) ; } let pks : Vec < _ > = sks . iter ( ) . map ( | k | PublicKey :: from_private ( k , gens , p . jj_params . as_ref ( ) ) ) . collect ( ) ; let mut accounts = Accounts :: new ( & p . set_params ) ; for i in 0 .. c { let account = Account { id : pks [ i ] . clone ( ) , amt : if i == 0 { 1 } else { 0 } , next_tx_no : 0 , } ; accounts . insert ( account ) ; } let mut transactions = Vec :: new ( ) ; for i in 0 .. t { let action = Action { dst : pks [ ( i + 1 ) % c ] . clone ( ) , amt : 1 , tx_no : ( i / c ) as u64 , } ; transactions . push ( action . sign ( & mut rng , gens , p . jj_params . as_ref ( ) , & hasher , & sks [ i % c ] , ) ) ; } let final_digest = { let mut accounts = accounts . clone ( ) ; for t in & transactions { accounts . apply_tx ( & t . tx ) ; } accounts . digest ( ) } ; Self { transactions , accounts , final_digest , } }
Creates a benchmark where `t` coins are exchanged in a pool of size `c`.
Creates a benchmark where ` t ` coins are exchanged in a pool of size ` c ` .
c
usize
t
usize
p
&RollupBenchParams<E, H>
c
usize
t
usize
p
&RollupBenchParams<E, H>