Struct raiden_network_messages::messages::LockedTransfer
source · pub struct LockedTransfer {Show 17 fields
pub message_identifier: MessageIdentifier,
pub payment_identifier: PaymentIdentifier,
pub chain_id: ChainID,
pub token_network_address: TokenNetworkAddress,
pub channel_identifier: ChannelIdentifier,
pub transferred_amount: TokenAmount,
pub locked_amount: LockedAmount,
pub locksroot: Locksroot,
pub token: TokenAddress,
pub recipient: Address,
pub lock: Lock,
pub target: Address,
pub initiator: Address,
pub metadata: Metadata,
pub nonce: U256,
pub secret: Option<Secret>,
pub signature: Signature,
}
Expand description
Message used to reserve tokens for a new mediated transfer.
For this message to be valid, the sender must:
- Use a lock.amount smaller then its current capacity. If the amount is higher, then the recipient will reject it, as it means spending money it does not own.
- Have the new lock represented in locksroot.
- Increase the locked_amount by exactly
lock.amount
otherwise the message would be rejected by the recipient. If the locked_amount is increased by more, then funds may get locked in the channel. If the locked_amount is increased by less, then the recipient will reject the message as it may mean it received the funds with an on-chain unlock. The initiator will estimate the fees based on the available routes and incorporate it in the lock’s amount. Note that with permissive routing it is not possible to predetermine the exact fee amount, as the initiator does not know which nodes are available, thus an estimated value is used.
Fields§
§message_identifier: MessageIdentifier
§payment_identifier: PaymentIdentifier
§chain_id: ChainID
§token_network_address: TokenNetworkAddress
§channel_identifier: ChannelIdentifier
§transferred_amount: TokenAmount
§locked_amount: LockedAmount
§locksroot: Locksroot
§token: TokenAddress
§recipient: Address
§lock: Lock
§target: Address
§initiator: Address
§metadata: Metadata
§nonce: U256
§secret: Option<Secret>
§signature: Signature
Trait Implementations§
source§impl Clone for LockedTransfer
impl Clone for LockedTransfer
source§fn clone(&self) -> LockedTransfer
fn clone(&self) -> LockedTransfer
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 LockedTransfer
impl Debug for LockedTransfer
source§impl<'de> Deserialize<'de> for LockedTransfer
impl<'de> Deserialize<'de> for LockedTransfer
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 From<SendLockedTransfer> for LockedTransfer
impl From<SendLockedTransfer> for LockedTransfer
source§fn from(event: SendLockedTransfer) -> Self
fn from(event: SendLockedTransfer) -> Self
Converts to this type from the input type.
source§impl PartialEq for LockedTransfer
impl PartialEq for LockedTransfer
source§fn eq(&self, other: &LockedTransfer) -> bool
fn eq(&self, other: &LockedTransfer) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LockedTransfer
impl Serialize for LockedTransfer
source§impl SignedEnvelopeMessage for LockedTransfer
impl SignedEnvelopeMessage for LockedTransfer
fn message_hash(&self) -> H256
source§impl SignedMessage for LockedTransfer
impl SignedMessage for LockedTransfer
fn bytes_to_sign(&self) -> Vec<u8>
fn sign(&mut self, key: PrivateKey) -> Result<(), SigningError>
fn sign_message(&self, key: PrivateKey) -> Result<Signature, SigningError>
impl Eq for LockedTransfer
impl StructuralPartialEq for LockedTransfer
Auto Trait Implementations§
impl Freeze for LockedTransfer
impl RefUnwindSafe for LockedTransfer
impl Send for LockedTransfer
impl Sync for LockedTransfer
impl Unpin for LockedTransfer
impl UnwindSafe for LockedTransfer
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
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.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> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.