fn is_system_immediate_caller(&self) -> Result<bool, Error> {
        let immediate_caller = match self.get_immediate_caller() {
            Some(call_stack_element) => call_stack_element,
            None => {
                // Immediate caller is assumed to exist at a time this check is run.
                return Ok(false);
            }
        };

        match immediate_caller {
            CallStackElement::Session { account_hash } => {
                // This case can happen during genesis where we're setting up purses for accounts.
                Ok(account_hash == &PublicKey::System.to_account_hash())
            }
            CallStackElement::StoredSession { contract_hash, .. }
            | CallStackElement::StoredContract { contract_hash, .. } => {
                Ok(self.context.is_system_contract(contract_hash)?)
            }
        }
    }
/// Checks if immediate caller is a system contract or account.
///
/// For cases where call stack is only the session code, then this method returns `true` if the
/// caller is system, or `false` otherwise.
Checks if immediate caller is a system contract or account.
For cases where call stack is only the session code, then this method returns `true` if the
caller is system, or `false` otherwise.
Checks if immediate caller is a system contract or account . For cases where call stack is only the session code then this method returns ` true ` if the caller is system or ` false ` otherwise .
fn is_system_immediate_caller(&self) -> Result<bool, Error> {
        let immediate_caller = match self.get_immediate_caller() {
            Some(call_stack_element) => call_stack_element,
            None => {
                // Immediate caller is assumed to exist at a time this check is run.
                return Ok(false);
            }
        };
        match immediate_caller {
            CallStackElement::Session { account_hash } => {
                // This case can happen during genesis where we're setting up purses for accounts.
                Ok(account_hash == &PublicKey::System.to_account_hash())
            }
            CallStackElement::StoredSession { contract_hash, .. }
            | CallStackElement::StoredContract { contract_hash, .. } => {
                Ok(self.context.is_system_contract(contract_hash)?)
            }
        }
    }
fn is_system_immediate_caller ( & self ) -> Result < bool , Error > { let immediate_caller = match self . get_immediate_caller ( ) { Some ( call_stack_element ) => call_stack_element , None => { // Immediate caller is assumed to exist at a time this check is run. return Ok ( false ) ; } } ; match immediate_caller { CallStackElement :: Session { account_hash } => { // This case can happen during genesis where we're setting up purses for accounts. Ok ( account_hash == & PublicKey :: System . to_account_hash ( ) ) } CallStackElement :: StoredSession { contract_hash , .. } | CallStackElement :: StoredContract { contract_hash , .. } => { Ok ( self . context . is_system_contract ( contract_hash ) ? ) } } }
Checks if immediate caller is a system contract or account.
Checks if immediate caller is a system contract or account .
&self
&self