/// Creates a new validation rule enforcer by reading the rules from state
///
/// Any invalid rules (ones that cannot be parsed into a known rule) are ignored.
///
/// # Arguments
///
/// * `settings_view` - The view of state used to read the block validation rules setting
/// * `local_signer_key` - The public key of the node that produced the block being validated;
///   it is expected to be the signer of local transactions
Creates a new validation rule enforcer by reading the rules from state
Any invalid rules (ones that cannot be parsed into a known rule) are ignored.
Creates a new validation rule enforcer by reading the rules from state Any invalid rules ( ones that cannot be parsed into a known rule ) are ignored .
pub fn new(
        settings_view: &SettingsView,
        local_signer_key: Vec<u8>,
    ) -> Result<Self, ValidationRuleEnforcerError> {
        let rules = settings_view
            .get_setting_str(BLOCK_VALIDATION_RULES, None)
            .map_err(|err| ValidationRuleEnforcerError::Internal(err.to_string()))?
            .map(|rules_str| parse_rules(&rules_str))
            .unwrap_or_default();
        Ok(Self {
            rules,
            local_signer_key,
            txn_info: vec![],
        })
    }
pub fn new ( settings_view : & SettingsView , local_signer_key : Vec < u8 > , ) -> Result < Self , ValidationRuleEnforcerError > { let rules = settings_view . get_setting_str ( BLOCK_VALIDATION_RULES , None ) . map_err ( | err | ValidationRuleEnforcerError :: Internal ( err . to_string ( ) ) ) ? . map ( | rules_str | parse_rules ( & rules_str ) ) . unwrap_or_default ( ) ; Ok ( Self { rules , local_signer_key , txn_info : vec ! [ ] , } ) }
Creates a new validation rule enforcer by reading the rules from state
Any invalid rules (ones that cannot be parsed into a known rule) are ignored.
Creates a new validation rule enforcer by reading the rules from state Any invalid rules ( ones that cannot be parsed into a known rule ) are ignored .
settings_view
&SettingsView
local_signer_key
Vec<u8>