pub trait Locked: Sync + Send {
type Error: Error + Into<Error> + 'static;
fn whoami(&self) -> ValidatorId;
fn verify(
&self,
signer: ValidatorId,
state_root: &str,
signature: &str
) -> Result<bool, Self::Error>;
fn session_from_token<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Session, Self::Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_deposit<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_context: &'life1 ChainOf<Channel>,
depositor_address: Address
) -> Pin<Box<dyn Future<Output = Result<Deposit, Self::Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}
Expand description
Available methods for Locked clients.
Required Associated Types
Required Methods
sourcefn whoami(&self) -> ValidatorId
fn whoami(&self) -> ValidatorId
Get Adapter whoami
sourcefn verify(
&self,
signer: ValidatorId,
state_root: &str,
signature: &str
) -> Result<bool, Self::Error>
fn verify(
&self,
signer: ValidatorId,
state_root: &str,
signature: &str
) -> Result<bool, Self::Error>
Verify, based on the signature
& state_root
, that the signer
is the same.
signature
should be a 0x
prefixed hex string.
state_root
should be a hex string, with no 0x
prefix.
sourcefn session_from_token<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Session, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn session_from_token<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Session, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Creates a Session
from a provided Token by calling the Contract.
Does not cache the (Token
, Session
) pair.