Trait totem_primitives::escrow::EscrowableCurrency
source · [−]pub trait EscrowableCurrency<AccountId> {
type Moment;
type Currency: Currency<AccountId>;
fn escrow_account() -> AccountId;
fn set_lock(
id: LockIdentifier,
who: &AccountId,
amount: <Self::Currency as Currency<AccountId>>::Balance,
until: Self::Moment,
reason: Reason
) -> Result<(), TotemLocksError>;
fn remove_lock(
id: LockIdentifier,
who: &AccountId
) -> Result<(), TotemLocksError>;
}
Expand description
A currency whose accounts can have liquidity restrictions.
Associated Types
Required methods
fn escrow_account() -> AccountId
fn escrow_account() -> AccountId
This function simply returns the Totem escrow account address.
Create a new balance lock on account who
.
If the new lock is valid (i.e. not already expired), it will push the struct to
the Locks
vec in storage.
fn remove_lock(
id: LockIdentifier,
who: &AccountId
) -> Result<(), TotemLocksError>
fn remove_lock(
id: LockIdentifier,
who: &AccountId
) -> Result<(), TotemLocksError>
Remove an existing lock.