#[non_exhaustive]pub enum TransactionExpiration {
None,
Epoch(EpochId),
ValidDuring {
min_epoch: Option<EpochId>,
max_epoch: Option<EpochId>,
min_timestamp: Option<u64>,
max_timestamp: Option<u64>,
chain: Digest,
nonce: u32,
},
Validity {
min_epoch: Option<EpochId>,
max_epoch: Option<EpochId>,
min_timestamp: Option<u64>,
max_timestamp: Option<u64>,
chain: Digest,
nonce: u32,
allowed_proposers: Option<AllowedProposers>,
},
}Expand description
A TTL for a transaction
§BCS
The BCS serialized form for this type is defined by the following ABNF:
transaction-expiration = %x00 ; none
=/ %x01 u64 ; epochVariants (Non-exhaustive)§
This enum is marked as non-exhaustive
None
The transaction has no expiration
Epoch(EpochId)
Validators wont sign a transaction unless the expiration Epoch is greater than or equal to the current epoch
ValidDuring
ValidDuring enables gas payments from address balances.
When transactions use address balances for gas payment instead of explicit gas coins, we lose the natural transaction uniqueness and replay prevention that comes from mutation of gas coin objects.
By bounding expiration and providing a nonce, validators must only retain executed digests for the maximum possible expiry range to differentiate retries from unique transactions with otherwise identical inputs.
Fields
Validity
Everything in ValidDuring, plus a restriction on which validators may propose the
transaction in consensus.
Fields
allowed_proposers: Option<AllowedProposers>The validators allowed to propose this transaction in consensus, if it restricts them
Trait Implementations§
Source§impl Arbitrary for TransactionExpiration
impl Arbitrary for TransactionExpiration
Source§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<TransactionExpiration>
type Strategy = BoxedStrategy<TransactionExpiration>
Strategy used to generate values of type Self.Source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
Source§impl Clone for TransactionExpiration
impl Clone for TransactionExpiration
Source§fn clone(&self) -> TransactionExpiration
fn clone(&self) -> TransactionExpiration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransactionExpiration
impl Debug for TransactionExpiration
Source§impl Default for TransactionExpiration
impl Default for TransactionExpiration
Source§fn default() -> TransactionExpiration
fn default() -> TransactionExpiration
Source§impl<'de> Deserialize<'de> for TransactionExpiration
impl<'de> Deserialize<'de> for TransactionExpiration
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>,
impl Eq for TransactionExpiration
Source§impl Hash for TransactionExpiration
impl Hash for TransactionExpiration
Source§impl PartialEq for TransactionExpiration
impl PartialEq for TransactionExpiration
Source§fn eq(&self, other: &TransactionExpiration) -> bool
fn eq(&self, other: &TransactionExpiration) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for TransactionExpiration
impl Serialize for TransactionExpiration
impl StructuralPartialEq for TransactionExpiration
Auto Trait Implementations§
impl Freeze for TransactionExpiration
impl RefUnwindSafe for TransactionExpiration
impl Send for TransactionExpiration
impl Sync for TransactionExpiration
impl Unpin for TransactionExpiration
impl UnsafeUnpin for TransactionExpiration
impl UnwindSafe for TransactionExpiration
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<'de, T> FromBcs for Twhere
T: Deserialize<'de>,
impl<'de, T> FromBcs for Twhere
T: Deserialize<'de>,
Source§fn from_bcs<'de>(bytes: &'de [u8]) -> Result<Self, Error>where
Self: Deserialize<'de>,
fn from_bcs<'de>(bytes: &'de [u8]) -> Result<Self, Error>where
Self: Deserialize<'de>,
serde only.Source§fn from_bcs_base64(base64: &str) -> Result<Self, Error>where
Self: DeserializeOwned,
fn from_bcs_base64(base64: &str) -> Result<Self, Error>where
Self: DeserializeOwned,
serde only.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