pub struct AuthWrapper;Expand description
Simplifies calling into the service
Implementations§
Source§impl AuthWrapper
impl AuthWrapper
Sourcepub const SERVICE: AccountNumber
pub const SERVICE: AccountNumber
The account this service normally runs on, “example-auth”
Sourcepub fn call() -> AuthActions<ServiceCaller>
pub fn call() -> AuthActions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
This method defaults sender to crate::get_sender and service to “example-auth”.
Sourcepub fn call_to(service: AccountNumber) -> AuthActions<ServiceCaller>
pub fn call_to(service: AccountNumber) -> AuthActions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
This method defaults sender to crate::get_sender.
Sourcepub fn call_from(sender: AccountNumber) -> AuthActions<ServiceCaller>
pub fn call_from(sender: AccountNumber) -> AuthActions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
This method defaults service to “example-auth”.
Sourcepub fn call_from_to(
sender: AccountNumber,
service: AccountNumber,
) -> AuthActions<ServiceCaller>
pub fn call_from_to( sender: AccountNumber, service: AccountNumber, ) -> AuthActions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
Sourcepub fn call_as(sender: AccountNumber) -> AuthActions<RunAsCaller>
pub fn call_as(sender: AccountNumber) -> AuthActions<RunAsCaller>
Call another service using runAs.
This method returns an object which has methods
(one per action) which call another service via runAs and return the result from the call.
The action will run with sender set to the provided account. This method defaults service to “example-auth”.
This will fail unless certain conditions are met. See runAs documentation for more details.
Sourcepub fn call_as_extend(
sender: AccountNumber,
allowed_actions: Vec<ServiceMethod>,
) -> AuthActions<RunAsCaller>
pub fn call_as_extend( sender: AccountNumber, allowed_actions: Vec<ServiceMethod>, ) -> AuthActions<RunAsCaller>
Call another service using runAs.
This method returns an object which has methods
(one per action) which call another service via runAs and return the result from the call.
The action will run with sender set to the provided account. This method defaults service to “example-auth”.
This will fail unless certain conditions are met. See runAs documentation for more details.
This method also accepts allowedActions for nested runAs calls.
Sourcepub fn rpc() -> AuthActions<ServiceCaller>
pub fn rpc() -> AuthActions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
This method defaults sender to crate::get_sender and service to “example-auth”.
Sourcepub fn push(chain: &Chain) -> AuthActions<ChainPusher<'_>>
pub fn push(chain: &Chain) -> AuthActions<ChainPusher<'_>>
push transactions to psibase::Chain.
This method returns an object which has methods (one per action) which push transactions to a test chain and return a psibase::ChainResult or psibase::ChainEmptyResult. This final object can verify success or failure and can retrieve the return value, if any.
This method defaults both sender and service to “example-auth”.
Sourcepub fn push_to(
chain: &Chain,
service: AccountNumber,
) -> AuthActions<ChainPusher<'_>>
pub fn push_to( chain: &Chain, service: AccountNumber, ) -> AuthActions<ChainPusher<'_>>
push transactions to psibase::Chain.
This method returns an object which has methods (one per action) which push transactions to a test chain and return a psibase::ChainResult or psibase::ChainEmptyResult. This final object can verify success or failure and can retrieve the return value, if any.
This method defaults sender to “example-auth”.
Sourcepub fn push_from(
chain: &Chain,
sender: AccountNumber,
) -> AuthActions<ChainPusher<'_>>
pub fn push_from( chain: &Chain, sender: AccountNumber, ) -> AuthActions<ChainPusher<'_>>
push transactions to psibase::Chain.
This method returns an object which has methods (one per action) which push transactions to a test chain and return a psibase::ChainResult or psibase::ChainEmptyResult. This final object can verify success or failure and can retrieve the return value, if any.
This method defaults service to “example-auth”.
Sourcepub fn push_from_to(
chain: &Chain,
sender: AccountNumber,
service: AccountNumber,
) -> AuthActions<ChainPusher<'_>>
pub fn push_from_to( chain: &Chain, sender: AccountNumber, service: AccountNumber, ) -> AuthActions<ChainPusher<'_>>
push transactions to psibase::Chain.
This method returns an object which has methods (one per action) which push transactions to a test chain and return a psibase::ChainResult or psibase::ChainEmptyResult. This final object can verify success or failure and can retrieve the return value, if any.
Sourcepub fn pack() -> AuthActions<ActionPacker>
pub fn pack() -> AuthActions<ActionPacker>
Pack actions into psibase::Action.
This method returns an object which has methods
(one per action) which pack the action’s arguments using fracpack and
return a psibase::Action. The pack_* series of
functions is mainly useful to applications which push transactions
to blockchains.
This method defaults both sender and service to “example-auth”.
Sourcepub fn pack_to(service: AccountNumber) -> AuthActions<ActionPacker>
pub fn pack_to(service: AccountNumber) -> AuthActions<ActionPacker>
Pack actions into psibase::Action.
This method returns an object which has methods
(one per action) which pack the action’s arguments using fracpack and
return a psibase::Action. The pack_* series of
functions is mainly useful to applications which push transactions
to blockchains.
This method defaults sender to “example-auth”.
Sourcepub fn pack_from(sender: AccountNumber) -> AuthActions<ActionPacker>
pub fn pack_from(sender: AccountNumber) -> AuthActions<ActionPacker>
Pack actions into psibase::Action.
This method returns an object which has methods
(one per action) which pack the action’s arguments using fracpack and
return a psibase::Action. The pack_* series of
functions is mainly useful to applications which push transactions
to blockchains.
This method defaults service to “example-auth”.
Sourcepub fn pack_from_to(
sender: AccountNumber,
service: AccountNumber,
) -> AuthActions<ActionPacker>
pub fn pack_from_to( sender: AccountNumber, service: AccountNumber, ) -> AuthActions<ActionPacker>
Pack actions into psibase::Action.
This method returns an object which has methods
(one per action) which pack the action’s arguments using fracpack and
return a psibase::Action. The pack_* series of
functions is mainly useful to applications which push transactions
to blockchains.
Sourcepub fn emit() -> EmitEvent
pub fn emit() -> EmitEvent
Emit events from a service.
This method defaults service to “example-auth”.
Sourcepub fn emit_from(sender: AccountNumber) -> EmitEvent
pub fn emit_from(sender: AccountNumber) -> EmitEvent
Emit events from a service.
Trait Implementations§
Source§impl Clone for AuthWrapper
impl Clone for AuthWrapper
Source§fn clone(&self) -> AuthWrapper
fn clone(&self) -> AuthWrapper
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more