pub(crate) fn check_tx(
        snapshot: &dyn Snapshot,
        tx: &Verified<AnyTx>,
    ) -> Result<(), ExecutionError> {
        // Currently the only check is that destination service exists, but later
        // functionality of this method can be extended.
        let call_info = &tx.as_ref().call_info;
        let instance = Schema::new(snapshot)
            .get_instance(call_info.instance_id)
            .ok_or(CoreError::IncorrectInstanceId)?;

        match instance.status {
            Some(InstanceStatus::Active) => Ok(()),
            _ => Err(CoreError::ServiceNotActive.into()),
        }
    }
/// Performs several shallow checks that transaction is correct.
///
/// Returned `Ok(())` value doesn't necessarily mean that transaction is correct and will be
/// executed successfully, but returned `Err(..)` value means that this transaction is
/// **obviously** incorrect and should be declined as early as possible.
Performs several shallow checks that transaction is correct.
Returned `Ok(())` value doesn't necessarily mean that transaction is correct and will be
executed successfully, but returned `Err(..)` value means that this transaction is
obviously** incorrect and should be declined as early as possible.
Performs several shallow checks that transaction is correct . Returned ` Ok (( )) ` value doesn ' t necessarily mean that transaction is correct and will be executed successfully but returned ` Err ( .. ) ` value means that this transaction is obviously ** incorrect and should be declined as early as possible .
pub(crate) fn check_tx(
        snapshot: &dyn Snapshot,
        tx: &Verified<AnyTx>,
    ) -> Result<(), ExecutionError> {
        // Currently the only check is that destination service exists, but later
        // functionality of this method can be extended.
        let call_info = &tx.as_ref().call_info;
        let instance = Schema::new(snapshot)
            .get_instance(call_info.instance_id)
            .ok_or(CoreError::IncorrectInstanceId)?;
        match instance.status {
            Some(InstanceStatus::Active) => Ok(()),
            _ => Err(CoreError::ServiceNotActive.into()),
        }
    }
pub ( crate ) fn check_tx ( snapshot : & dyn Snapshot , tx : & Verified < AnyTx > , ) -> Result < ( ) , ExecutionError > { // Currently the only check is that destination service exists, but later // functionality of this method can be extended. let call_info = & tx . as_ref ( ) . call_info ; let instance = Schema :: new ( snapshot ) . get_instance ( call_info . instance_id ) . ok_or ( CoreError :: IncorrectInstanceId ) ? ; match instance . status { Some ( InstanceStatus :: Active ) => Ok ( ( ) ) , _ => Err ( CoreError :: ServiceNotActive . into ( ) ) , } }
Performs several shallow checks that transaction is correct.
Performs several shallow checks that transaction is correct .
snapshot
&dyn Snapshot
tx
&Verified<AnyTx>
snapshot
&dyn Snapshot
tx
&Verified<AnyTx>