From bd78b0d71f1fb8ef2a5aad816beab4ddd00b5fd2 Mon Sep 17 00:00:00 2001 From: fborello-lambda Date: Mon, 30 Dec 2024 17:23:22 -0300 Subject: [PATCH] fix: calculations --- crates/l2/tests/tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/l2/tests/tests.rs b/crates/l2/tests/tests.rs index 1eb9bd2d0..f3d3c5ad0 100644 --- a/crates/l2/tests/tests.rs +++ b/crates/l2/tests/tests.rs @@ -295,7 +295,7 @@ async fn testito() -> Result<(), Box> { let total_locked_l2_value = deposit_value - withdraw_value - fees_transfer.total_fees - fees_withdraw.total_fees; let total_locked_l2_value_with_recoverable_fees = - total_locked_l2_value + fees_transfer.recoverable_fees + fees_transfer.recoverable_fees; + total_locked_l2_value + fees_transfer.recoverable_fees + fees_withdraw.recoverable_fees; let total_burned_fees = fees_transfer.burned_fees + fees_withdraw.burned_fees; println!("TOTAL Locked L2 value: {total_locked_l2_value}"); @@ -304,6 +304,8 @@ async fn testito() -> Result<(), Box> { ); println!("BURNED FEES L2: {total_burned_fees}"); + println!("The total locked value by the CommonBridge contract doesn't take burned fees into account, also the deposit transactions \"gives\" some tokens (from fees) to the coinbase address. This behavior shouldn't happen."); + // Check that we only have the amount left after the withdrawal assert_eq!(common_bridge_locked_balance, deposit_value - withdraw_value);