Skip to content

Commit

Permalink
feat: rename KatanaHooker hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Nov 28, 2023
1 parent 491a380 commit d5f5b58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/katana/core/src/hooker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
}
4 changes: 2 additions & 2 deletions crates/katana/core/src/service/messaging/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
}
};
Expand Down

0 comments on commit d5f5b58

Please sign in to comment.