pub enum HandleRefundMode {
Burn {
limit: U512,
cost: U512,
consumed: U512,
gas_price: u8,
source: Box<BalanceIdentifier>,
ratio: Ratio<u64>,
},
Refund {
initiator_addr: Box<InitiatorAddr>,
limit: U512,
cost: U512,
consumed: U512,
gas_price: u8,
ratio: Ratio<u64>,
source: Box<BalanceIdentifier>,
target: Box<BalanceIdentifier>,
},
RefundNoFeeCustomPayment {
initiator_addr: Box<InitiatorAddr>,
limit: U512,
cost: U512,
gas_price: u8,
},
CalculateAmount {
limit: U512,
cost: U512,
consumed: U512,
gas_price: u8,
ratio: Ratio<u64>,
source: Box<BalanceIdentifier>,
},
SetRefundPurse {
target: Box<BalanceIdentifier>,
},
ClearRefundPurse,
}Expand description
Selects refund operation.
Variants§
Burn
This variant will cause the refund amount to be calculated and then burned.
Fields
source: Box<BalanceIdentifier>Refund source.
Refund
This variant will cause the refund amount to be calculated and the refund to be executed.
Fields
initiator_addr: Box<InitiatorAddr>Refund initiator.
source: Box<BalanceIdentifier>Refund source.
target: Box<BalanceIdentifier>Target for refund.
RefundNoFeeCustomPayment
This variant handles the edge case of custom payment plus no fee plus no refund. This ultimately turns into a hold on the initiator, but it takes extra steps to get there because the payment has already been fully processed up front and must first be unwound.
Fields
initiator_addr: Box<InitiatorAddr>Refund initiator.
CalculateAmount
This variant only calculates and returns the refund amount. It does not execute a refund.
Fields
source: Box<BalanceIdentifier>Refund source.
SetRefundPurse
This variant will cause the refund purse tracked by handle_payment to be set.
Fields
target: Box<BalanceIdentifier>Target for refund, which will receive any refunded token while set.
ClearRefundPurse
This variant will cause the refund purse tracked by handle_payment to be cleared.
Implementations§
Trait Implementations§
Source§impl Clone for HandleRefundMode
impl Clone for HandleRefundMode
Source§fn clone(&self) -> HandleRefundMode
fn clone(&self) -> HandleRefundMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HandleRefundMode
impl Debug for HandleRefundMode
Source§impl PartialEq for HandleRefundMode
impl PartialEq for HandleRefundMode
impl Eq for HandleRefundMode
impl StructuralPartialEq for HandleRefundMode
Auto Trait Implementations§
impl Freeze for HandleRefundMode
impl RefUnwindSafe for HandleRefundMode
impl Send for HandleRefundMode
impl Sync for HandleRefundMode
impl Unpin for HandleRefundMode
impl UnwindSafe for HandleRefundMode
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
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
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
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>
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>
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