radix_transactions/model/v2/
signed_partial_transaction_v2.rs1use super::*;
2use crate::internal_prelude::*;
3
4#[derive(Debug, Clone, Eq, PartialEq, ManifestSbor, ScryptoDescribe)]
22pub struct SignedPartialTransactionV2 {
23 pub partial_transaction: PartialTransactionV2,
24 pub root_subintent_signatures: IntentSignaturesV2,
25 pub non_root_subintent_signatures: NonRootSubintentSignaturesV2,
26}
27
28impl SignedPartialTransactionV2 {
29 pub fn prepare_and_validate(
30 &self,
31 validator: &TransactionValidator,
32 ) -> Result<ValidatedSignedPartialTransactionV2, TransactionValidationError> {
33 self.prepare(validator.preparation_settings())?
34 .validate(validator)
35 }
36}
37
38define_transaction_payload!(
39 SignedPartialTransactionV2,
40 RawSignedPartialTransaction,
41 PreparedSignedPartialTransactionV2 {
42 partial_transaction: PreparedPartialTransactionV2,
43 root_subintent_signatures: PreparedIntentSignaturesV2,
44 non_root_subintent_signatures: PreparedNonRootSubintentSignaturesV2,
45 },
46 TransactionDiscriminator::V2SignedPartialTransaction,
47);
48
49impl HasSubintentHash for PreparedSignedPartialTransactionV2 {
50 fn subintent_hash(&self) -> SubintentHash {
51 self.partial_transaction.subintent_hash()
52 }
53}
54
55impl PreparedSignedPartialTransactionV2 {
56 pub fn non_root_subintent_hashes(&self) -> impl Iterator<Item = SubintentHash> + '_ {
57 self.partial_transaction.non_root_subintent_hashes()
58 }
59
60 pub fn validate(
61 self,
62 validator: &TransactionValidator,
63 ) -> Result<ValidatedSignedPartialTransactionV2, TransactionValidationError> {
64 validator.validate_signed_partial_transaction_v2(self)
65 }
66}