[][src]Struct casperlabs_engine_shared::account::Account

pub struct Account { /* fields omitted */ }

Methods

impl Account[src]

pub fn new(
    public_key: PublicKey,
    named_keys: BTreeMap<String, Key>,
    main_purse: URef,
    associated_keys: AssociatedKeys,
    action_thresholds: ActionThresholds
) -> Self
[src]

pub fn create(
    account: PublicKey,
    named_keys: BTreeMap<String, Key>,
    main_purse: URef
) -> Self
[src]

pub fn named_keys_append(&mut self, keys: &mut BTreeMap<String, Key>)[src]

pub fn named_keys(&self) -> &BTreeMap<String, Key>[src]

pub fn named_keys_mut(&mut self) -> &mut BTreeMap<String, Key>[src]

pub fn public_key(&self) -> PublicKey[src]

pub fn main_purse(&self) -> URef[src]

pub fn main_purse_add_only(&self) -> URef[src]

Returns an AccessRights::ADD-only version of the URef.

pub fn get_associated_keys(&self) -> impl Iterator<Item = (&PublicKey, &Weight)>[src]

pub fn action_thresholds(&self) -> &ActionThresholds[src]

pub fn add_associated_key(
    &mut self,
    public_key: PublicKey,
    weight: Weight
) -> Result<(), AddKeyFailure>
[src]

pub fn remove_associated_key(
    &mut self,
    public_key: PublicKey
) -> Result<(), RemoveKeyFailure>
[src]

pub fn update_associated_key(
    &mut self,
    public_key: PublicKey,
    weight: Weight
) -> Result<(), UpdateKeyFailure>
[src]

pub fn get_associated_key_weight(
    &self,
    public_key: PublicKey
) -> Option<&Weight>
[src]

pub fn set_action_threshold(
    &mut self,
    action_type: ActionType,
    weight: Weight
) -> Result<(), SetThresholdFailure>
[src]

pub fn can_set_threshold(
    &self,
    new_threshold: Weight
) -> Result<(), SetThresholdFailure>
[src]

Verifies if user can set action threshold

pub fn can_authorize(&self, authorization_keys: &BTreeSet<PublicKey>) -> bool[src]

Checks whether all authorization keys are associated with this account

pub fn can_deploy_with(&self, authorization_keys: &BTreeSet<PublicKey>) -> bool[src]

Checks whether the sum of the weights of all authorization keys is greater or equal to deploy threshold.

pub fn can_manage_keys_with(
    &self,
    authorization_keys: &BTreeSet<PublicKey>
) -> bool
[src]

Checks whether the sum of the weights of all authorization keys is greater or equal to key management threshold.

Trait Implementations

impl Clone for Account[src]

impl Debug for Account[src]

impl Eq for Account[src]

impl FromBytes for Account[src]

impl PartialEq<Account> for Account[src]

impl StructuralEq for Account[src]

impl StructuralPartialEq for Account[src]

impl ToBytes for Account[src]

impl TryFrom<StoredValue> for Account[src]

type Error = TypeMismatch

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Account

impl Send for Account

impl Sync for Account

impl Unpin for Account

impl UnwindSafe for Account

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromBits<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,