Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

InternalTrait

Fully qualified path: starkware_utils::components::request_approvals::request_approvals::RequestApprovalsComponent::InternalTrait

pub trait InternalTrait<TContractState, +HasComponent<TContractState>>

Trait functions

register_approval

Registers an approval for a request. If the owner_account is non-zero, the caller must be the owner_account. The approval is signed with the public key. The signature is verified with the hash of the request. The request is stored with a status of PENDING.

Fully qualified path: starkware_utils::components::request_approvals::request_approvals::RequestApprovalsComponent::InternalTrait::register_approval

fn register_approval<T, +OffchainMessageHash<T>, +Drop<T>>(
    ref self: ComponentState<TContractState>,
    owner_account: Option<ContractAddress>,
    public_key: felt252,
    signature: Span<felt252>,
    args: T,
) -> felt252

consume_approved_request

Consumes an approved request. Marks the request with status DONE.

Validations: The request must be registered with PENDING state.

Fully qualified path: starkware_utils::components::request_approvals::request_approvals::RequestApprovalsComponent::InternalTrait::consume_approved_request

fn consume_approved_request<T, +OffchainMessageHash<T>, +Drop<T>>(
    ref self: ComponentState<TContractState>, args: T, public_key: felt252,
) -> felt252