This module contains the error code for auth_validator module The auth_validator implementation should contain the following functions public fun validate(authenticator_payload: vector)
- Struct
AuthValidator
- Struct
TxValidateResult
- Constants
- Function
error_validate_sequence_number_too_old
- Function
error_validate_sequence_number_too_new
- Function
error_validate_account_does_not_exist
- Function
error_validate_cant_pay_gas_deposit
- Function
error_validate_transaction_expired
- Function
error_validate_bad_chain_id
- Function
error_validate_sequence_number_too_big
- Function
error_validate_max_gas_amount_exceeded
- Function
error_validate_invalid_account_auth_key
- Function
error_validate_invalid_authenticator
- Function
error_validate_not_installed_auth_validator
- Function
error_validate_session_is_expired
- Function
error_validate_function_call_beyond_session_scope
- Function
new_auth_validator
- Function
validator_id
- Function
validator_module_address
- Function
validator_module_name
- Function
new_tx_validate_result
- Function
get_validate_result_from_ctx
- Function
get_validator_id_from_ctx
- Function
get_session_key_from_ctx_option
- Function
is_validate_via_session_key
- Function
get_session_key_from_ctx
- Function
get_bitcoin_address_from_ctx
use 0x1::option;
use 0x1::string;
use 0x2::tx_context;
use 0x3::bitcoin_address;
The Authentication Validator
struct AuthValidator has copy, drop, store
The Transaction Validate Result this result will be stored in the TxContext
struct TxValidateResult has copy, drop, store
The function must be executed after the transaction is validated
const ErrorMustExecuteAfterValidate: u64 = 1;
const ErrorValidateAccountDoesNotExist: u64 = 1003;
const ErrorValidateBadChainId: u64 = 1006;
const ErrorValidateCantPayGasDeposit: u64 = 1004;
The function call is beyond the session's scope
const ErrorValidateFunctionCallBeyondSessionScope: u64 = 1013;
The AuthKey in transaction's authenticator do not match with the sender's account auth key
const ErrorValidateInvalidAccountAuthKey: u64 = 1009;
InvalidAuthenticator, include invalid signature
const ErrorValidateInvalidAuthenticator: u64 = 1010;
const ErrorValidateMaxGasAmountExceeded: u64 = 1008;
The authenticator's auth validator id is not installed to the sender's account
const ErrorValidateNotInstalledAuthValidator: u64 = 1011;
Validate errors. These are separated out from the other errors in this module since they are mapped separately to major VM statuses, and are important to the semantics of the system.
const ErrorValidateSequenceNuberTooOld: u64 = 1001;
const ErrorValidateSequenceNumberTooBig: u64 = 1007;
const ErrorValidateSequenceNumberTooNew: u64 = 1002;
The session is expired
const ErrorValidateSessionIsExpired: u64 = 1012;
const ErrorValidateTransactionExpired: u64 = 1005;
public fun error_validate_sequence_number_too_old(): u64
public fun error_validate_sequence_number_too_new(): u64
public fun error_validate_account_does_not_exist(): u64
public fun error_validate_cant_pay_gas_deposit(): u64
public fun error_validate_transaction_expired(): u64
public fun error_validate_bad_chain_id(): u64
public fun error_validate_sequence_number_too_big(): u64
public fun error_validate_max_gas_amount_exceeded(): u64
public fun error_validate_invalid_account_auth_key(): u64
public fun error_validate_invalid_authenticator(): u64
public fun error_validate_not_installed_auth_validator(): u64
public fun error_validate_session_is_expired(): u64
public fun error_validate_function_call_beyond_session_scope(): u64
public(friend) fun new_auth_validator(id: u64, module_address: address, module_name: string::String): auth_validator::AuthValidator
public fun validator_id(validator: &auth_validator::AuthValidator): u64
public fun validator_module_address(validator: &auth_validator::AuthValidator): address
public fun validator_module_name(validator: &auth_validator::AuthValidator): string::String
public(friend) fun new_tx_validate_result(auth_validator_id: u64, auth_validator: option::Option<auth_validator::AuthValidator>, session_key: option::Option<vector<u8>>, bitcoin_address: bitcoin_address::BitcoinAddress): auth_validator::TxValidateResult
Get the TxValidateResult from the TxContext, Only can be called after the transaction is validated
public(friend) fun get_validate_result_from_ctx(): auth_validator::TxValidateResult
Get the auth validator's id from the TxValidateResult in the TxContext
public(friend) fun get_validator_id_from_ctx(): u64
Get the session key from the TxValidateResult in the TxContext If the TxValidateResult is None or SessionKey is None, return None
public(friend) fun get_session_key_from_ctx_option(): option::Option<vector<u8>>
The current tx is validate via the session key or not
public(friend) fun is_validate_via_session_key(): bool
Get the session key from the TxValidateResult in the TxContext Only can be called after the transaction is validated
public(friend) fun get_session_key_from_ctx(): vector<u8>
public(friend) fun get_bitcoin_address_from_ctx(): bitcoin_address::BitcoinAddress