pub fn open<T: AsRef<OsStr> + ?Sized>(
        data_dir: &T,
        engine_config: EngineConfig,
        post_state_hash: Vec<u8>,
    ) -> Self {
        Self::initialize_logging();
        let page_size = get_page_size().expect("should get page size");
        let global_state_dir = Self::create_and_get_global_state_dir(data_dir);
        let environment = Arc::new(
            LmdbEnvironment::new(&global_state_dir, page_size * DEFAULT_LMDB_PAGES)
                .expect("should create LmdbEnvironment"),
        );
        let trie_store =
            Arc::new(LmdbTrieStore::open(&environment, None).expect("should open LmdbTrieStore"));
        let protocol_data_store = Arc::new(
            LmdbProtocolDataStore::open(&environment, None)
                .expect("should open LmdbProtocolDataStore"),
        );
        let global_state = LmdbGlobalState::empty(environment, trie_store, protocol_data_store)
            .expect("should create LmdbGlobalState");
        let engine_state = EngineState::new(global_state, engine_config);
        WasmTestBuilder {
            engine_state: Rc::new(engine_state),
            exec_responses: Vec::new(),
            upgrade_responses: Vec::new(),
            genesis_hash: None,
            post_state_hash: Some(post_state_hash),
            transforms: Vec::new(),
            bonded_validators: Vec::new(),
            genesis_account: None,
            genesis_transforms: None,
            mint_contract_uref: None,
            pos_contract_uref: None,
            standard_payment_uref: None,
        }
    }
/// Creates a new instance of builder using the supplied configurations, opening wrapped LMDBs
/// (e.g. in the Trie and Data stores) rather than creating them.
Creates a new instance of builder using the supplied configurations, opening wrapped LMDBs
rather than creating them.
Creates a new instance of builder using the supplied configurations opening wrapped LMDBs rather than creating them .
pub fn open<T: AsRef<OsStr> + ?Sized>(
        data_dir: &T,
        engine_config: EngineConfig,
        post_state_hash: Vec<u8>,
    ) -> Self {
        Self::initialize_logging();
        let page_size = get_page_size().expect("should get page size");
        let global_state_dir = Self::create_and_get_global_state_dir(data_dir);
        let environment = Arc::new(
            LmdbEnvironment::new(&global_state_dir, page_size * DEFAULT_LMDB_PAGES)
                .expect("should create LmdbEnvironment"),
        );
        let trie_store =
            Arc::new(LmdbTrieStore::open(&environment, None).expect("should open LmdbTrieStore"));
        let protocol_data_store = Arc::new(
            LmdbProtocolDataStore::open(&environment, None)
                .expect("should open LmdbProtocolDataStore"),
        );
        let global_state = LmdbGlobalState::empty(environment, trie_store, protocol_data_store)
            .expect("should create LmdbGlobalState");
        let engine_state = EngineState::new(global_state, engine_config);
        WasmTestBuilder {
            engine_state: Rc::new(engine_state),
            exec_responses: Vec::new(),
            upgrade_responses: Vec::new(),
            genesis_hash: None,
            post_state_hash: Some(post_state_hash),
            transforms: Vec::new(),
            bonded_validators: Vec::new(),
            genesis_account: None,
            genesis_transforms: None,
            mint_contract_uref: None,
            pos_contract_uref: None,
            standard_payment_uref: None,
        }
    }
pub fn open < T : AsRef < OsStr > + ? Sized > ( data_dir : & T , engine_config : EngineConfig , post_state_hash : Vec < u8 > , ) -> Self { Self :: initialize_logging ( ) ; let page_size = get_page_size ( ) . expect ( " " ) ; let global_state_dir = Self :: create_and_get_global_state_dir ( data_dir ) ; let environment = Arc :: new ( LmdbEnvironment :: new ( & global_state_dir , page_size * DEFAULT_LMDB_PAGES ) . expect ( " " ) , ) ; let trie_store = Arc :: new ( LmdbTrieStore :: open ( & environment , None ) . expect ( " " ) ) ; let protocol_data_store = Arc :: new ( LmdbProtocolDataStore :: open ( & environment , None ) . expect ( " " ) , ) ; let global_state = LmdbGlobalState :: empty ( environment , trie_store , protocol_data_store ) . expect ( " " ) ; let engine_state = EngineState :: new ( global_state , engine_config ) ; WasmTestBuilder { engine_state : Rc :: new ( engine_state ) , exec_responses : Vec :: new ( ) , upgrade_responses : Vec :: new ( ) , genesis_hash : None , post_state_hash : Some ( post_state_hash ) , transforms : Vec :: new ( ) , bonded_validators : Vec :: new ( ) , genesis_account : None , genesis_transforms : None , mint_contract_uref : None , pos_contract_uref : None , standard_payment_uref : None , } }
Creates a new instance of builder using the supplied configurations, opening wrapped LMDBs
(e.g.
Creates a new instance of builder using the supplied configurations opening wrapped LMDBs ( e . g .
data_dir
&T
engine_config
EngineConfig
post_state_hash
Vec<u8>
data_dir
&T
engine_config
EngineConfig
post_state_hash
Vec<u8>