pub fn run_genesis(&mut self, run_genesis_request: &RunGenesisRequest) -> &mut Self {
        let system_account = Key::Account(PublicKey::System.to_account_hash());

        let GenesisSuccess {
            post_state_hash,
            execution_effect,
        } = self
            .engine_state
            .commit_genesis(
                CorrelationId::new(),
                run_genesis_request.genesis_config_hash(),
                run_genesis_request.protocol_version(),
                run_genesis_request.ee_config(),
            )
            .expect("Unable to get genesis response");

        let transforms = execution_effect.transforms;
        let empty_path: Vec<String> = vec![];

        let genesis_account =
            utils::get_account(&transforms, &system_account).expect("Unable to get system account");

        let registry = match self.query(
            Some(post_state_hash),
            Key::SystemContractRegistry,
            &empty_path,
        ) {
            Ok(StoredValue::CLValue(cl_registry)) => {
                CLValue::into_t::<SystemContractRegistry>(cl_registry).unwrap()
            }
            Ok(_) => panic!("Failed to get system registry"),
            Err(err) => panic!("{}", err),
        };

        self.genesis_hash = Some(post_state_hash);
        self.post_state_hash = Some(post_state_hash);
        self.mint_contract_hash = Some(*registry.get(MINT).expect("should have mint hash"));
        self.handle_payment_contract_hash = Some(
            *registry
                .get(HANDLE_PAYMENT)
                .expect("should have handle payment hash"),
        );
        self.standard_payment_hash = Some(
            *registry
                .get(STANDARD_PAYMENT)
                .expect("should have standard payment hash"),
        );
        self.auction_contract_hash =
            Some(*registry.get(AUCTION).expect("should have auction hash"));
        self.genesis_account = Some(genesis_account);
        self.genesis_transforms = Some(transforms);
        self
    }
/// Takes a [`RunGenesisRequest`], executes the request and returns Self.
Takes a [`RunGenesisRequest`], executes the request and returns Self.
Takes a [ ` RunGenesisRequest ` ] executes the request and returns Self .
pub fn run_genesis(&mut self, run_genesis_request: &RunGenesisRequest) -> &mut Self {
        let system_account = Key::Account(PublicKey::System.to_account_hash());
        let GenesisSuccess {
            post_state_hash,
            execution_effect,
        } = self
            .engine_state
            .commit_genesis(
                CorrelationId::new(),
                run_genesis_request.genesis_config_hash(),
                run_genesis_request.protocol_version(),
                run_genesis_request.ee_config(),
            )
            .expect("Unable to get genesis response");
        let transforms = execution_effect.transforms;
        let empty_path: Vec<String> = vec![];
        let genesis_account =
            utils::get_account(&transforms, &system_account).expect("Unable to get system account");
        let registry = match self.query(
            Some(post_state_hash),
            Key::SystemContractRegistry,
            &empty_path,
        ) {
            Ok(StoredValue::CLValue(cl_registry)) => {
                CLValue::into_t::<SystemContractRegistry>(cl_registry).unwrap()
            }
            Ok(_) => panic!("Failed to get system registry"),
            Err(err) => panic!("{}", err),
        };
        self.genesis_hash = Some(post_state_hash);
        self.post_state_hash = Some(post_state_hash);
        self.mint_contract_hash = Some(*registry.get(MINT).expect("should have mint hash"));
        self.handle_payment_contract_hash = Some(
            *registry
                .get(HANDLE_PAYMENT)
                .expect("should have handle payment hash"),
        );
        self.standard_payment_hash = Some(
            *registry
                .get(STANDARD_PAYMENT)
                .expect("should have standard payment hash"),
        );
        self.auction_contract_hash =
            Some(*registry.get(AUCTION).expect("should have auction hash"));
        self.genesis_account = Some(genesis_account);
        self.genesis_transforms = Some(transforms);
        self
    }
pub fn run_genesis ( & mut self , run_genesis_request : & RunGenesisRequest ) -> & mut Self { let system_account = Key :: Account ( PublicKey :: System . to_account_hash ( ) ) ; let GenesisSuccess { post_state_hash , execution_effect , } = self . engine_state . commit_genesis ( CorrelationId :: new ( ) , run_genesis_request . genesis_config_hash ( ) , run_genesis_request . protocol_version ( ) , run_genesis_request . ee_config ( ) , ) . expect ( " " ) ; let transforms = execution_effect . transforms ; let empty_path : Vec < String > = vec ! [ ] ; let genesis_account = utils :: get_account ( & transforms , & system_account ) . expect ( " " ) ; let registry = match self . query ( Some ( post_state_hash ) , Key :: SystemContractRegistry , & empty_path , ) { Ok ( StoredValue :: CLValue ( cl_registry ) ) => { CLValue :: into_t :: < SystemContractRegistry > ( cl_registry ) . unwrap ( ) } Ok ( _ ) => panic ! ( " " ) , Err ( err ) => panic ! ( " " err ) , } ; self . genesis_hash = Some ( post_state_hash ) ; self . post_state_hash = Some ( post_state_hash ) ; self . mint_contract_hash = Some ( * registry . get ( MINT ) . expect ( " " ) ) ; self . handle_payment_contract_hash = Some ( * registry . get ( HANDLE_PAYMENT ) . expect ( " " ) , ) ; self . standard_payment_hash = Some ( * registry . get ( STANDARD_PAYMENT ) . expect ( " " ) , ) ; self . auction_contract_hash = Some ( * registry . get ( AUCTION ) . expect ( " " ) ) ; self . genesis_account = Some ( genesis_account ) ; self . genesis_transforms = Some ( transforms ) ; self }
Takes a [`RunGenesisRequest`], executes the request and returns Self.
Takes a [ ` RunGenesisRequest ` ] executes the request and returns Self .
&mut self
run_genesis_request
&RunGenesisRequest
&mut self
run_genesis_request
&RunGenesisRequest