From bc3d3241cbf6ca31740d811351fc8d54655bb5d4 Mon Sep 17 00:00:00 2001 From: Sabaun Taraki Date: Mon, 30 Sep 2024 19:16:38 +0400 Subject: [PATCH 1/2] Fix gtest --- gtest/src/state/gas_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtest/src/state/gas_tree.rs b/gtest/src/state/gas_tree.rs index ef2d1a9e34e..98435d98780 100644 --- a/gtest/src/state/gas_tree.rs +++ b/gtest/src/state/gas_tree.rs @@ -88,7 +88,7 @@ impl GasTreeManager { new_mid: MessageId, amount: Gas, ) -> Result<(), GasTreeError> { - if !is_reply && !GasTree::exists_and_deposit(GasNodeId::from(new_mid.cast::())) + if !is_reply || !GasTree::exists_and_deposit(GasNodeId::from(new_mid.cast::())) { return GasTree::split_with_value( GasNodeId::from(original_mid.cast::()), @@ -107,7 +107,7 @@ impl GasTreeManager { original_node: impl Origin, new_mid: MessageId, ) -> Result<(), GasTreeError> { - if !is_reply && !GasTree::exists_and_deposit(GasNodeId::from(new_mid.cast::())) + if !is_reply || !GasTree::exists_and_deposit(GasNodeId::from(new_mid.cast::())) { return GasTree::split( GasNodeId::from(original_node.cast::()), From 32cb0dec94447262204e880bca3ec70da7e07377 Mon Sep 17 00:00:00 2001 From: Sabaun Taraki Date: Mon, 30 Sep 2024 20:03:45 +0400 Subject: [PATCH 2/2] Fix reply argument --- gtest/src/manager/journal.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtest/src/manager/journal.rs b/gtest/src/manager/journal.rs index a41604cf1e2..b01bc334884 100644 --- a/gtest/src/manager/journal.rs +++ b/gtest/src/manager/journal.rs @@ -164,15 +164,15 @@ impl JournalHandler for ExtManager { match (gas_limit, reservation) { (Some(gas_limit), None) => self .gas_tree - .split_with_value(false, message_id, dispatch.id(), gas_limit) + .split_with_value(dispatch.is_reply(), message_id, dispatch.id(), gas_limit) .unwrap_or_else(|e| unreachable!("GasTree corrupted! {:?}", e)), (None, None) => self .gas_tree - .split(false, message_id, dispatch.id()) + .split(dispatch.is_reply(), message_id, dispatch.id()) .unwrap_or_else(|e| unreachable!("GasTree corrupted! {:?}", e)), (None, Some(reservation)) => { self.gas_tree - .split(false, reservation, dispatch.id()) + .split(dispatch.is_reply(), reservation, dispatch.id()) .unwrap_or_else(|e| unreachable!("GasTree corrupted! {:?}", e)); self.remove_gas_reservation_with_task(dispatch.source(), reservation); }