pub trait ApprovalManager<A, S, C>where
    A: Action<Self> + BorshSerialize + BorshDeserialize,
    S: BorshSerialize + BorshDeserialize + Serialize,
    C: ApprovalConfiguration<A, S> + BorshDeserialize + BorshSerialize,
{ fn root() -> Slot<()> { ... } fn slot_next_request_id() -> Slot<u32> { ... } fn slot_config() -> Slot<C> { ... } fn get_config() -> C { ... } fn slot_request(request_id: u32) -> Slot<ActionRequest<A, S>> { ... } fn get_request(request_id: u32) -> Option<ActionRequest<A, S>> { ... } fn init(config: C) { ... } fn create_request(
        &mut self,
        action: A,
        approval_state: S
    ) -> Result<u32, CreationError<C::AuthorizationError>> { ... } fn execute_request(
        &mut self,
        request_id: u32
    ) -> Result<A::Output, ExecutionError<C::AuthorizationError, C::ExecutionEligibilityError>> { ... } fn is_approved_for_execution(
        request_id: u32
    ) -> Result<(), C::ExecutionEligibilityError> { ... } fn approve_request(
        &mut self,
        request_id: u32
    ) -> Result<(), ApprovalError<C::AuthorizationError, C::ApprovalError>> { ... } fn remove_request(
        &mut self,
        request_id: u32
    ) -> Result<(), RemovalError<C::AuthorizationError, C::RemovalError>> { ... } }
Expand description

Collection of action requests that manages their approval state and execution

Provided Methods§

Storage root

Because requests will be deleted from the requests collection, maintain a simple counter to guarantee unique IDs

Approval context included in relevant approval-related calls

Reads config from storage. Panics if the component has not been initialized.

Current list of pending action requests.

Get a request by ID

Must be called before using the Approval construct. Can only be called once.

Creates a new action request initialized with the given approval state

Executes an action request and removes it from the collection if the approval state of the request is fulfilled.

Is the given request ID able to be executed if such a request were to be initiated by an authorized account?

Tries to approve the action request designated by the given request ID with the given arguments. Panics if the request ID does not exist.

Tries to remove the action request indicated by request_id.

Implementors§