Struct nym_mixnet_contract_common::delegation::Delegation
source · pub struct Delegation {
pub owner: Addr,
pub mix_id: MixId,
pub cumulative_reward_ratio: Decimal,
pub amount: Coin,
pub height: u64,
pub proxy: Option<Addr>,
}
Fields§
§owner: Addr
Address of the owner of this delegation.
mix_id: MixId
Id of the MixNode that this delegation was performed against.
cumulative_reward_ratio: Decimal
Value of the “unit delegation” associated with the mixnode at the time of delegation.
amount: Coin
Original delegation amount. Note that it is never mutated as delegation accumulates rewards.
height: u64
Block height where this delegation occurred.
proxy: Option<Addr>
Proxy address used to delegate the funds on behalf of another address
Implementations§
source§impl Delegation
impl Delegation
pub fn new( owner: Addr, mix_id: MixId, cumulative_reward_ratio: Decimal, amount: Coin, height: u64, proxy: Option<Addr> ) -> Self
pub fn generate_storage_key( mix_id: MixId, owner_address: &Addr, proxy: Option<&Addr> ) -> StorageKey
pub fn generate_storage_key_with_subkey( mix_id: MixId, owner_proxy_subkey: OwnerProxySubKey ) -> StorageKey
pub fn dec_amount(&self) -> StdResult<Decimal>
pub fn proxy_storage_key(&self) -> OwnerProxySubKey
pub fn storage_key(&self) -> StorageKey
Trait Implementations§
source§impl Clone for Delegation
impl Clone for Delegation
source§fn clone(&self) -> Delegation
fn clone(&self) -> Delegation
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 Delegation
impl Debug for Delegation
source§impl<'de> Deserialize<'de> for Delegation
impl<'de> Deserialize<'de> for Delegation
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl JsonSchema for Delegation
impl JsonSchema for Delegation
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq<Delegation> for Delegation
impl PartialEq<Delegation> for Delegation
source§fn eq(&self, other: &Delegation) -> bool
fn eq(&self, other: &Delegation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Delegation
impl Serialize for Delegation
impl StructuralPartialEq for Delegation
Auto Trait Implementations§
impl RefUnwindSafe for Delegation
impl Send for Delegation
impl Sync for Delegation
impl Unpin for Delegation
impl UnwindSafe for Delegation
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