fn unbond<Q: QueueProvider, S: StakesProvider>(
    maybe_amount: Option<U512>,
    validator: PublicKey,
    timestamp: BlockTime,
) -> Result<()> {
    let mut queue = Q::read_unbonding();
    if queue.0.len() >= MAX_UNBOND_LEN {
        return Err(Error::TooManyEventsInQueue);
    }

    let mut stakes = S::read()?;
    let payout = stakes.unbond(&validator, maybe_amount)?;
    S::write(&stakes);
    // TODO: Make sure the destination is valid and the amount can be paid. The
    // actual payment will be made later, after the unbonding delay.
    // contract_api::transfer_dry_run(POS_PURSE, dest, amount)?;
    queue.push(validator, payout, timestamp)?;
    Q::write_unbonding(&queue);
    Ok(())
}
/// Enqueues the deploy's creator for unbonding. Their vote weight as a
/// validator is decreased immediately, but the funds will only be released
/// after a delay. If `maybe_amount` is `None`, all funds are enqueued for
/// withdrawal, terminating the validator status.
Enqueues the deploy's creator for unbonding. Their vote weight as a
validator is decreased immediately, but the funds will only be released
after a delay. If `maybe_amount` is `None`, all funds are enqueued for
withdrawal, terminating the validator status.
Enqueues the deploy ' s creator for unbonding . Their vote weight as a validator is decreased immediately but the funds will only be released after a delay . If ` maybe_amount ` is ` None ` all funds are enqueued for withdrawal terminating the validator status .
fn unbond<Q: QueueProvider, S: StakesProvider>(
    maybe_amount: Option<U512>,
    validator: PublicKey,
    timestamp: BlockTime,
) -> Result<()> {
    let mut queue = Q::read_unbonding();
    if queue.0.len() >= MAX_UNBOND_LEN {
        return Err(Error::TooManyEventsInQueue);
    }
    let mut stakes = S::read()?;
    let payout = stakes.unbond(&validator, maybe_amount)?;
    S::write(&stakes);
    // TODO: Make sure the destination is valid and the amount can be paid. The
    // actual payment will be made later, after the unbonding delay.
    // contract_api::transfer_dry_run(POS_PURSE, dest, amount)?;
    queue.push(validator, payout, timestamp)?;
    Q::write_unbonding(&queue);
    Ok(())
}
fn unbond < Q : QueueProvider , S : StakesProvider > ( maybe_amount : Option < U512 > , validator : PublicKey , timestamp : BlockTime , ) -> Result < ( ) > { let mut queue = Q :: read_unbonding ( ) ; if queue . 0 . len ( ) >= MAX_UNBOND_LEN { return Err ( Error :: TooManyEventsInQueue ) ; } let mut stakes = S :: read ( ) ? ; let payout = stakes . unbond ( & validator , maybe_amount ) ? ; S :: write ( & stakes ) ; // TODO: Make sure the destination is valid and the amount can be paid. The // actual payment will be made later, after the unbonding delay. // contract_api::transfer_dry_run(POS_PURSE, dest, amount)?; queue . push ( validator , payout , timestamp ) ? ; Q :: write_unbonding ( & queue ) ; Ok ( ( ) ) }
Enqueues the deploy's creator for unbonding.
Enqueues the deploy ' s creator for unbonding .
maybe_amount
Option<U512>
validator
PublicKey
timestamp
BlockTime
maybe_amount
Option<U512>
validator
PublicKey
timestamp
BlockTime