radix_transactions/model/v1/
signed_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 `SignedTransactionIntentV1`, but keeping the old name to avoid refactoring in node.
10#[derive(Debug, Clone, Eq, PartialEq, ManifestSbor, ScryptoDescribe)]
11pub struct SignedIntentV1 {
12    pub intent: IntentV1,
13    pub intent_signatures: IntentSignaturesV1,
14}
15
16define_transaction_payload!(
17    SignedIntentV1,
18    RawSignedTransactionIntent,
19    PreparedSignedIntentV1 {
20        intent: PreparedIntentV1,
21        intent_signatures: PreparedIntentSignaturesV1,
22    },
23    TransactionDiscriminator::V1SignedIntent,
24);
25
26impl HasTransactionIntentHash for PreparedSignedIntentV1 {
27    fn transaction_intent_hash(&self) -> TransactionIntentHash {
28        self.intent.transaction_intent_hash()
29    }
30}
31
32impl HasSignedTransactionIntentHash for PreparedSignedIntentV1 {
33    fn signed_transaction_intent_hash(&self) -> SignedTransactionIntentHash {
34        SignedTransactionIntentHash::from_hash(self.summary.hash)
35    }
36}