From 913064da3928a881fc7885d636b1f03dd58b8bcf Mon Sep 17 00:00:00 2001 From: David Rusu Date: Sat, 15 Jun 2024 09:18:03 -0400 Subject: [PATCH] cl: verify bundle isn't balanced with just one unbalanced partial tx --- cl/src/bundle.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cl/src/bundle.rs b/cl/src/bundle.rs index 5a8d578..0ca4a16 100644 --- a/cl/src/bundle.rs +++ b/cl/src/bundle.rs @@ -119,6 +119,10 @@ mod test { let bundle = Bundle::from_witness(bundle_witness.clone()); + assert!(!bundle.is_balanced( + -nmo_10_in.balance_blinding - eth_23_in.balance_blinding + + crv_4840_out.balance_blinding + )); assert_eq!( bundle.balance(), crate::balance::balance(4840, "CRV", crv_4840_out.balance_blinding)