fn with_universe<S>(
        strategy: S,
        universe_strategy: impl Strategy<Value = AccountUniverseGen>,
        num_transactions: usize,
    ) -> Self
    where
        S: Strategy,
        S::Value: AUTransactionGen,
    {
        let mut runner = TestRunner::default();
        let universe = universe_strategy
            .new_tree(&mut runner)
            .expect("creating a new value should succeed")
            .current();

        let mut executor = FakeExecutor::from_genesis_file();
        // Run in gas-cost-stability mode for now -- this ensures that new accounts are ignored.
        // XXX We may want to include new accounts in case they have interesting performance
        // characteristics.
        let mut universe = universe.setup_gas_cost_stability(&mut executor);

        let transaction_gens = vec(strategy, num_transactions)
            .new_tree(&mut runner)
            .expect("creating a new value should succeed")
            .current();
        let transactions = transaction_gens
            .into_iter()
            .map(|txn_gen| txn_gen.apply(&mut universe).0)
            .collect();

        Self {
            executor,
            transactions,
        }
    }
/// Creates a new benchmark state with the given account universe strategy and number of
/// transactions.
Creates a new benchmark state with the given account universe strategy and number of
transactions.
Creates a new benchmark state with the given account universe strategy and number of transactions .
fn with_universe<S>(
        strategy: S,
        universe_strategy: impl Strategy<Value = AccountUniverseGen>,
        num_transactions: usize,
    ) -> Self
    where
        S: Strategy,
        S::Value: AUTransactionGen,
    {
        let mut runner = TestRunner::default();
        let universe = universe_strategy
            .new_tree(&mut runner)
            .expect("creating a new value should succeed")
            .current();
        let mut executor = FakeExecutor::from_genesis_file();
        // Run in gas-cost-stability mode for now -- this ensures that new accounts are ignored.
        // XXX We may want to include new accounts in case they have interesting performance
        // characteristics.
        let mut universe = universe.setup_gas_cost_stability(&mut executor);
        let transaction_gens = vec(strategy, num_transactions)
            .new_tree(&mut runner)
            .expect("creating a new value should succeed")
            .current();
        let transactions = transaction_gens
            .into_iter()
            .map(|txn_gen| txn_gen.apply(&mut universe).0)
            .collect();
        Self {
            executor,
            transactions,
        }
    }
fn with_universe < S > ( strategy : S , universe_strategy : impl Strategy < Value = AccountUniverseGen > , num_transactions : usize , ) -> Self where S : Strategy , S :: Value : AUTransactionGen , { let mut runner = TestRunner :: default ( ) ; let universe = universe_strategy . new_tree ( & mut runner ) . expect ( " " ) . current ( ) ; let mut executor = FakeExecutor :: from_genesis_file ( ) ; // Run in gas-cost-stability mode for now -- this ensures that new accounts are ignored. // XXX We may want to include new accounts in case they have interesting performance // characteristics. let mut universe = universe . setup_gas_cost_stability ( & mut executor ) ; let transaction_gens = vec ( strategy , num_transactions ) . new_tree ( & mut runner ) . expect ( " " ) . current ( ) ; let transactions = transaction_gens . into_iter ( ) . map ( | txn_gen | txn_gen . apply ( & mut universe ) . 0 ) . collect ( ) ; Self { executor , transactions , } }
Creates a new benchmark state with the given account universe strategy and number of
transactions.
Creates a new benchmark state with the given account universe strategy and number of transactions .
strategy
S
universe_strategy
impl Strategy<Value = AccountUniverseGen>
num_transactions
usize
strategy
S
universe_strategy
impl Strategy<Value = AccountUniverseGen>
num_transactions
usize