radix_transactions/model/v1/
intent.rs

1use super::*;
2use crate::internal_prelude::*;
3
4//=================================================================================
5// NOTE:
6// See versioned.rs for tests and a demonstration for the calculation of hashes etc
7//=================================================================================
8
9/// This should really be `TransactionIntentV1`, but keeping the old name to avoid refactoring in node.
10#[derive(Debug, Clone, Eq, PartialEq, ManifestSbor, ScryptoDescribe)]
11pub struct IntentV1 {
12    pub header: TransactionHeaderV1,
13    pub instructions: InstructionsV1,
14    pub blobs: BlobsV1,
15    pub message: MessageV1,
16}
17
18define_transaction_payload!(
19    IntentV1,
20    RawTransactionIntent,
21    PreparedIntentV1 {
22        header: PreparedTransactionHeaderV1,
23        instructions: PreparedInstructionsV1,
24        blobs: PreparedBlobsV1,
25        message: PreparedMessageV1,
26    },
27    TransactionDiscriminator::V1Intent,
28);
29
30impl HasTransactionIntentHash for PreparedIntentV1 {
31    fn transaction_intent_hash(&self) -> TransactionIntentHash {
32        TransactionIntentHash::from_hash(self.summary.hash)
33    }
34}