radix_transactions/model/v2/
intent_header_v2.rs

1use crate::internal_prelude::*;
2
3#[derive(Debug, Clone, Eq, PartialEq, ManifestSbor, ScryptoDescribe)]
4pub struct IntentHeaderV2 {
5    pub network_id: u8,
6
7    // Nullifier stuff
8    pub start_epoch_inclusive: Epoch,
9    pub end_epoch_exclusive: Epoch,
10    pub min_proposer_timestamp_inclusive: Option<Instant>,
11    pub max_proposer_timestamp_exclusive: Option<Instant>,
12
13    /// This field is intended to enable a network user to generate an identical
14    /// intent with a new hash. Users can simply set this randomly if they wish to.
15    /// A u64 is large enough to avoid any risk of collision over the course of a
16    /// single epoch anyway.
17    ///
18    /// This field's name `intent_discriminator` is the new name for what was the
19    /// `nonce` field in `IntentV1`. This was poorly named, as it caused confusion with an Ethereum-style nonce.
20    pub intent_discriminator: u64,
21}
22
23impl TransactionPartialPrepare for IntentHeaderV2 {
24    type Prepared = PreparedIntentHeaderV2;
25}
26
27pub type PreparedIntentHeaderV2 = SummarizedRawValueBody<IntentHeaderV2>;