pub enum TransferConfig {
Administered {
administrative_accounts: BTreeSet<AccountHash>,
allow_unrestricted_transfers: bool,
},
Unadministered,
}Expand description
Configuration for transfer.
Variants§
Administered
Transfers are affected by the existence of administrative_accounts. This is a behavior specific to private or managed chains, not a public chain.
Fields
§
administrative_accounts: BTreeSet<AccountHash>Retrusn the set of account hashes for all administrators.
Unadministered
Transfers are not affected by the existence of administrative_accounts (the standard behavior).
Implementations§
Source§impl TransferConfig
impl TransferConfig
Sourcepub fn new(
administrative_accounts: BTreeSet<AccountHash>,
allow_unrestricted_transfers: bool,
) -> Self
pub fn new( administrative_accounts: BTreeSet<AccountHash>, allow_unrestricted_transfers: bool, ) -> Self
Returns a new instance.
Sourcepub fn from_chainspec(chainspec: &Chainspec) -> Self
pub fn from_chainspec(chainspec: &Chainspec) -> Self
New instance from chainspec.
Sourcepub fn is_administrator(&self, account_hash: &AccountHash) -> bool
pub fn is_administrator(&self, account_hash: &AccountHash) -> bool
Does account hash belong to an administrative account?
Sourcepub fn administrative_accounts(&self) -> BTreeSet<AccountHash>
pub fn administrative_accounts(&self) -> BTreeSet<AccountHash>
Administrative accounts, if any.
Sourcepub fn allow_unrestricted_transfers(&self) -> bool
pub fn allow_unrestricted_transfers(&self) -> bool
Allow unrestricted transfers.
Sourcepub fn enforce_transfer_restrictions(&self, account_hash: &AccountHash) -> bool
pub fn enforce_transfer_restrictions(&self, account_hash: &AccountHash) -> bool
Restricted transfer should be enforced.
Trait Implementations§
Source§impl Clone for TransferConfig
impl Clone for TransferConfig
Source§fn clone(&self) -> TransferConfig
fn clone(&self) -> TransferConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransferConfig
impl Debug for TransferConfig
Source§impl Default for TransferConfig
impl Default for TransferConfig
Source§fn default() -> TransferConfig
fn default() -> TransferConfig
Returns the “default value” for a type. Read more
Source§impl PartialEq for TransferConfig
impl PartialEq for TransferConfig
impl Eq for TransferConfig
impl StructuralPartialEq for TransferConfig
Auto Trait Implementations§
impl Freeze for TransferConfig
impl RefUnwindSafe for TransferConfig
impl Send for TransferConfig
impl Sync for TransferConfig
impl Unpin for TransferConfig
impl UnwindSafe for TransferConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more