pub fn commit_genesis(
        &self,
        correlation_id: CorrelationId,
        genesis_config_hash: Digest,
        protocol_version: ProtocolVersion,
        ee_config: &ExecConfig,
    ) -> Result<GenesisSuccess, Error> {
        // Preliminaries
        let initial_root_hash = self.state.empty_root();

        let tracking_copy = match self.tracking_copy(initial_root_hash) {
            Ok(Some(tracking_copy)) => Rc::new(RefCell::new(tracking_copy)),
            // NOTE: As genesis is run once per instance condition below is considered programming
            // error
            Ok(None) => panic!("state has not been initialized properly"),
            Err(error) => return Err(error),
        };

        let wasm_config = ee_config.wasm_config();
        let preprocessor = Preprocessor::new(*wasm_config);

        let system_module = tracking_copy
            .borrow_mut()
            .get_system_module(&preprocessor)?;

        let mut genesis_installer: GenesisInstaller<S> = GenesisInstaller::new(
            genesis_config_hash,
            protocol_version,
            correlation_id,
            *self.config(),
            ee_config.clone(),
            tracking_copy,
            system_module,
        );

        genesis_installer.create_mint()?;

        // Create accounts
        genesis_installer.create_accounts()?;

        // Create handle payment
        genesis_installer.create_handle_payment()?;

        // Create auction
        genesis_installer.create_auction()?;

        // Create standard payment
        genesis_installer.create_standard_payment()?;

        // Commit the transforms.
        let execution_effect = genesis_installer.finalize();

        let post_state_hash = self
            .state
            .commit(
                correlation_id,
                initial_root_hash,
                execution_effect.transforms.to_owned(),
            )
            .map_err(Into::<execution::Error>::into)?;

        // Return the result
        Ok(GenesisSuccess {
            post_state_hash,
            execution_effect,
        })
    }
/// Commits genesis process.
///
/// This process is run only once per network to initiate the system. By definition users are
/// unable to execute smart contracts on a network without a genesis.
///
/// Takes genesis configuration passed through [`ExecConfig`] and creates the system contracts,
/// sets up the genesis accounts, and sets up the auction state based on that. At the end of
/// the process, [`SystemContractRegistry`] is persisted under the special global state space
/// [`Key::SystemContractRegistry`].
///
/// Returns a [`GenesisSuccess`] for a successful operation, or an error otherwise.
Commits genesis process.
This process is run only once per network to initiate the system. By definition users are
unable to execute smart contracts on a network without a genesis.

Takes genesis configuration passed through [`ExecConfig`] and creates the system contracts,
sets up the genesis accounts, and sets up the auction state based on that. At the end of
the process, [`SystemContractRegistry`] is persisted under the special global state space
[`Key::SystemContractRegistry`].

Returns a [`GenesisSuccess`] for a successful operation, or an error otherwise.
Commits genesis process . This process is run only once per network to initiate the system . By definition users are unable to execute smart contracts on a network without a genesis . Takes genesis configuration passed through [ ` ExecConfig ` ] and creates the system contracts sets up the genesis accounts and sets up the auction state based on that . At the end of the process [ ` SystemContractRegistry ` ] is persisted under the special global state space [ ` Key :: SystemContractRegistry ` ] . Returns a [ ` GenesisSuccess ` ] for a successful operation or an error otherwise .
pub fn commit_genesis(
        &self,
        correlation_id: CorrelationId,
        genesis_config_hash: Digest,
        protocol_version: ProtocolVersion,
        ee_config: &ExecConfig,
    ) -> Result<GenesisSuccess, Error> {
        // Preliminaries
        let initial_root_hash = self.state.empty_root();
        let tracking_copy = match self.tracking_copy(initial_root_hash) {
            Ok(Some(tracking_copy)) => Rc::new(RefCell::new(tracking_copy)),
            // NOTE: As genesis is run once per instance condition below is considered programming
            // error
            Ok(None) => panic!("state has not been initialized properly"),
            Err(error) => return Err(error),
        };
        let wasm_config = ee_config.wasm_config();
        let preprocessor = Preprocessor::new(*wasm_config);
        let system_module = tracking_copy
            .borrow_mut()
            .get_system_module(&preprocessor)?;
        let mut genesis_installer: GenesisInstaller<S> = GenesisInstaller::new(
            genesis_config_hash,
            protocol_version,
            correlation_id,
            *self.config(),
            ee_config.clone(),
            tracking_copy,
            system_module,
        );
        genesis_installer.create_mint()?;
        // Create accounts
        genesis_installer.create_accounts()?;
        // Create handle payment
        genesis_installer.create_handle_payment()?;
        // Create auction
        genesis_installer.create_auction()?;
        // Create standard payment
        genesis_installer.create_standard_payment()?;
        // Commit the transforms.
        let execution_effect = genesis_installer.finalize();
        let post_state_hash = self
            .state
            .commit(
                correlation_id,
                initial_root_hash,
                execution_effect.transforms.to_owned(),
            )
            .map_err(Into::<execution::Error>::into)?;
        // Return the result
        Ok(GenesisSuccess {
            post_state_hash,
            execution_effect,
        })
    }
pub fn commit_genesis ( & self , correlation_id : CorrelationId , genesis_config_hash : Digest , protocol_version : ProtocolVersion , ee_config : & ExecConfig , ) -> Result < GenesisSuccess , Error > { // Preliminaries let initial_root_hash = self . state . empty_root ( ) ; let tracking_copy = match self . tracking_copy ( initial_root_hash ) { Ok ( Some ( tracking_copy ) ) => Rc :: new ( RefCell :: new ( tracking_copy ) ) , // NOTE: As genesis is run once per instance condition below is considered programming // error Ok ( None ) => panic ! ( " " ) , Err ( error ) => return Err ( error ) , } ; let wasm_config = ee_config . wasm_config ( ) ; let preprocessor = Preprocessor :: new ( * wasm_config ) ; let system_module = tracking_copy . borrow_mut ( ) . get_system_module ( & preprocessor ) ? ; let mut genesis_installer : GenesisInstaller < S > = GenesisInstaller :: new ( genesis_config_hash , protocol_version , correlation_id , * self . config ( ) , ee_config . clone ( ) , tracking_copy , system_module , ) ; genesis_installer . create_mint ( ) ? ; // Create accounts genesis_installer . create_accounts ( ) ? ; // Create handle payment genesis_installer . create_handle_payment ( ) ? ; // Create auction genesis_installer . create_auction ( ) ? ; // Create standard payment genesis_installer . create_standard_payment ( ) ? ; // Commit the transforms. let execution_effect = genesis_installer . finalize ( ) ; let post_state_hash = self . state . commit ( correlation_id , initial_root_hash , execution_effect . transforms . to_owned ( ) , ) . map_err ( Into :: < execution :: Error > :: into ) ? ; // Return the result Ok ( GenesisSuccess { post_state_hash , execution_effect , } ) }
Commits genesis process.
Commits genesis process .
&self
correlation_id
CorrelationId
genesis_config_hash
Digest
protocol_version
ProtocolVersion
ee_config
&ExecConfig
&self
correlation_id
CorrelationId
genesis_config_hash
Digest
protocol_version
ProtocolVersion
ee_config
&ExecConfig