From d1f9b7678809d1cf1c71e23e01df453d843834d1 Mon Sep 17 00:00:00 2001 From: Constance Beguier Date: Fri, 11 Oct 2024 13:35:19 +0200 Subject: [PATCH] Add SwapBundle struct --- src/bundle.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/bundle.rs b/src/bundle.rs index bca6bca91..5eb7bd75e 100644 --- a/src/bundle.rs +++ b/src/bundle.rs @@ -24,6 +24,7 @@ use crate::{ note::{AssetBase, Note}, note_encryption::{OrchardDomain, OrchardDomainCommon}, orchard_flavor::OrchardFlavor, + orchard_flavor::OrchardZSA, primitives::redpallas::{self, Binding, SpendAuth}, tree::Anchor, value::{NoteValue, ValueCommitTrapdoor, ValueCommitment, ValueSum}, @@ -456,6 +457,21 @@ impl Bundle { } } +/// A swap bundle to be applied to the ledger. +#[derive(Clone, Debug)] +pub struct SwapBundle { + /// The list of action groups that make up this swap bundle. + action_groups: Vec>, + /// Orchard-specific transaction-level flags for this swap. + flags: Flags, + /// The net value moved out of this swap. + /// + /// This is the sum of Orchard spends minus the sum of Orchard outputs. + value_balance: V, + /// The binding signature for this swap. + binding_signature: redpallas::Signature, +} + pub(crate) fn derive_bvk<'a, A: 'a, V: Clone + Into, FL: 'a + OrchardFlavor>( actions: impl IntoIterator>, value_balance: V,