pub struct Ctx {
pub network: Network,
pub nonce: u64,
pub now_ms: u64,
}Expand description
Everything outside the amounts that a plan is made from.
Fields§
§network: Network§nonce: u64§now_ms: u64Now, milliseconds: a lock or a queue is measured from it.
Implementations§
Source§impl Ctx
impl Ctx
Sourcepub fn stake(&self, hype: Dec) -> Result<Plan<CDeposit>, Refused>
pub fn stake(&self, hype: Dec) -> Result<Plan<CDeposit>, Refused>
cDeposit: HYPE from spot into the staking balance.
Sourcepub fn unstake(
&self,
hype: Dec,
summary: &DelegatorSummary,
) -> Result<Plan<CWithdraw>, Refused>
pub fn unstake( &self, hype: Dec, summary: &DelegatorSummary, ) -> Result<Plan<CWithdraw>, Refused>
cWithdraw: HYPE from the staking balance toward spot, through the
network’s queue, which holds at most five at once.
Sourcepub fn delegate(
&self,
validator: Address,
hype: Dec,
summary: &DelegatorSummary,
) -> Result<Plan<TokenDelegate>, Refused>
pub fn delegate( &self, validator: Address, hype: Dec, summary: &DelegatorSummary, ) -> Result<Plan<TokenDelegate>, Refused>
tokenDelegate: the staking balance to validator, locked for the
network’s delegation lock.
Sourcepub fn undelegate(
&self,
validator: Address,
hype: Dec,
delegations: &[Delegation],
) -> Result<Plan<TokenDelegate>, Refused>
pub fn undelegate( &self, validator: Address, hype: Dec, delegations: &[Delegation], ) -> Result<Plan<TokenDelegate>, Refused>
tokenDelegate back: from validator to the staking balance, once
its lock has passed.
Trait Implementations§
impl Copy for Ctx
impl Eq for Ctx
impl StructuralPartialEq for Ctx
Auto Trait Implementations§
impl Freeze for Ctx
impl RefUnwindSafe for Ctx
impl Send for Ctx
impl Sync for Ctx
impl Unpin for Ctx
impl UnsafeUnpin for Ctx
impl UnwindSafe for Ctx
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.