use super::*;
use crate::internal_prelude::*;
#[derive(Debug, Clone, Eq, PartialEq, ManifestSbor, ScryptoDescribe)]
pub struct PartialTransactionV2 {
pub root_subintent: SubintentV2,
pub non_root_subintents: NonRootSubintentsV2,
}
define_transaction_payload!(
PartialTransactionV2,
RawPartialTransaction,
PreparedPartialTransactionV2 {
root_subintent: PreparedSubintentV2,
non_root_subintents: PreparedNonRootSubintentsV2,
},
TransactionDiscriminator::V2PartialTransaction,
);
impl PreparedPartialTransactionV2 {
pub fn non_root_subintent_hashes(&self) -> impl Iterator<Item = SubintentHash> + '_ {
self.non_root_subintents
.subintents
.iter()
.map(|s| s.subintent_hash())
}
}
impl HasSubintentHash for PreparedPartialTransactionV2 {
fn subintent_hash(&self) -> SubintentHash {
self.root_subintent.subintent_hash()
}
}