From d5f5b583e27ae9eaa05c54a49de1241db63dcba9 Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 27 Nov 2023 19:20:59 -0600 Subject: [PATCH] feat: rename KatanaHooker hooks --- crates/katana/core/src/hooker.rs | 4 ++-- crates/katana/core/src/service/messaging/starknet.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/katana/core/src/hooker.rs b/crates/katana/core/src/hooker.rs index bcb32bd393..4c6b33a344 100644 --- a/crates/katana/core/src/hooker.rs +++ b/crates/katana/core/src/hooker.rs @@ -49,7 +49,7 @@ pub trait KatanaHooker { /// /// * `call` - The `Call` to inspect, built from the /// message. - async fn verify_message_to_starknet_before_tx(&self, call: Call) -> bool; + async fn verify_tx_for_starknet(&self, call: Call) -> bool; /// Runs when Solis attempts to execute an order on Starknet, /// but it fails. @@ -58,5 +58,5 @@ pub trait KatanaHooker { /// /// * `call` - The `Call` of the transaction that has failed. Usually the same as /// `verify_message_to_starknet_before_tx`. - async fn react_on_starknet_tx_failed(&self, call: Call); + async fn on_starknet_tx_failed(&self, call: Call); } diff --git a/crates/katana/core/src/service/messaging/starknet.rs b/crates/katana/core/src/service/messaging/starknet.rs index 2f2847ba2b..9c2720e769 100644 --- a/crates/katana/core/src/service/messaging/starknet.rs +++ b/crates/katana/core/src/service/messaging/starknet.rs @@ -253,7 +253,7 @@ impl Messenger for StarknetMessaging { for call in &calls { // 1. Verify before TX. - if !self.hooker.read().await.verify_message_to_starknet_before_tx(call.clone()).await { + if !self.hooker.read().await.verify_tx_for_starknet(call.clone()).await { continue; } @@ -263,7 +263,7 @@ impl Messenger for StarknetMessaging { } Err(e) => { // 2. React on TX error. - self.hooker.read().await.react_on_starknet_tx_failed(call.clone()).await; + self.hooker.read().await.on_starknet_tx_failed(call.clone()).await; error!("Error sending invoke tx on Starknet: {:?}", e); } };