// FUTURE: At the moment we can't pass transaction metadata or the signed transaction due to
// restrictions in the two places that this function is called. We therefore just pass through what
// we need at the moment---the sender address---but we may want/need to pass more data later on.
At the moment we can't pass transaction metadata or the signed transaction due to
restrictions in the two places that this function is called.
At the moment we can ' t pass transaction metadata or the signed transaction due to restrictions in the two places that this function is called .
pub fn convert_prologue_runtime_error(status: VMStatus) -> VMStatus {
    match status {
        // TODO look at location? or remove this function entirely
        VMStatus::MoveAbort(location, code) => {
            let new_major_status = match code {
                EACCOUNT_FROZEN => StatusCode::SENDING_ACCOUNT_FROZEN,
                // Invalid authentication key
                EBAD_ACCOUNT_AUTHENTICATION_KEY => StatusCode::INVALID_AUTH_KEY,
                // Sequence number too old
                ESEQUENCE_NUMBER_TOO_OLD => StatusCode::SEQUENCE_NUMBER_TOO_OLD,
                // Sequence number too new
                ESEQUENCE_NUMBER_TOO_NEW => StatusCode::SEQUENCE_NUMBER_TOO_NEW,
                // Sequence number too new
                EACCOUNT_DOES_NOT_EXIST => StatusCode::SENDING_ACCOUNT_DOES_NOT_EXIST,
                // Can't pay for transaction gas deposit/fee
                ECANT_PAY_GAS_DEPOSIT => StatusCode::INSUFFICIENT_BALANCE_FOR_TRANSACTION_FEE,
                ETRANSACTION_EXPIRED => StatusCode::TRANSACTION_EXPIRED,
                code => return VMStatus::MoveAbort(location, code),
            };
            VMStatus::Error(new_major_status)
        }
        status @ VMStatus::Error(_) | status @ VMStatus::Executed => status,
    }
}
pub fn convert_prologue_runtime_error ( status : VMStatus ) -> VMStatus { match status { // TODO look at location? or remove this function entirely VMStatus :: MoveAbort ( location , code ) => { let new_major_status = match code { EACCOUNT_FROZEN => StatusCode :: SENDING_ACCOUNT_FROZEN , // Invalid authentication key EBAD_ACCOUNT_AUTHENTICATION_KEY => StatusCode :: INVALID_AUTH_KEY , // Sequence number too old ESEQUENCE_NUMBER_TOO_OLD => StatusCode :: SEQUENCE_NUMBER_TOO_OLD , // Sequence number too new ESEQUENCE_NUMBER_TOO_NEW => StatusCode :: SEQUENCE_NUMBER_TOO_NEW , // Sequence number too new EACCOUNT_DOES_NOT_EXIST => StatusCode :: SENDING_ACCOUNT_DOES_NOT_EXIST , // Can't pay for transaction gas deposit/fee ECANT_PAY_GAS_DEPOSIT => StatusCode :: INSUFFICIENT_BALANCE_FOR_TRANSACTION_FEE , ETRANSACTION_EXPIRED => StatusCode :: TRANSACTION_EXPIRED , code => return VMStatus :: MoveAbort ( location , code ) , } ; VMStatus :: Error ( new_major_status ) } status @ VMStatus :: Error ( _ ) | status @ VMStatus :: Executed => status , } }
FUTURE: At the moment we can't pass transaction metadata or the signed transaction due to
restrictions in the two places that this function is called.
FUTURE : At the moment we can ' t pass transaction metadata or the signed transaction due to restrictions in the two places that this function is called .
status
VMStatus