From 5dd0b424fffdc2db2b29f14b107d787066c6396f Mon Sep 17 00:00:00 2001 From: glihm Date: Sat, 16 Dec 2023 22:18:12 -0600 Subject: [PATCH] fix(katana): adjust types for solis --- crates/katana/core/src/sequencer.rs | 6 +++++- crates/katana/core/src/service/messaging/mod.rs | 1 + crates/katana/core/src/service/messaging/service.rs | 6 +++++- crates/katana/rpc/rpc-types/src/transaction.rs | 2 +- crates/katana/rpc/src/starknet.rs | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/katana/core/src/sequencer.rs b/crates/katana/core/src/sequencer.rs index bba2ef33a8..21746f63aa 100644 --- a/crates/katana/core/src/sequencer.rs +++ b/crates/katana/core/src/sequencer.rs @@ -1,3 +1,8 @@ +// SOLIS +use tokio::sync::RwLock as AsyncRwLock; +use crate::hooker::{HookerAddresses, KatanaHooker}; +// + use std::cmp::Ordering; use std::iter::Skip; use std::slice::Iter; @@ -30,7 +35,6 @@ use starknet_api::core::ChainId; use crate::backend::config::StarknetConfig; use crate::backend::contract::StarknetContract; use crate::backend::Backend; -use crate::hooker::{HookerAddresses, KatanaHooker}; use crate::pool::TransactionPool; use crate::sequencer_error::SequencerError; use crate::service::block_producer::{BlockProducer, BlockProducerMode}; diff --git a/crates/katana/core/src/service/messaging/mod.rs b/crates/katana/core/src/service/messaging/mod.rs index 833dfe19fa..8da029feb4 100644 --- a/crates/katana/core/src/service/messaging/mod.rs +++ b/crates/katana/core/src/service/messaging/mod.rs @@ -177,6 +177,7 @@ pub enum MessengerMode { impl MessengerMode { pub async fn from_config( config: MessagingConfig, + #[allow(unused)] hooker: Arc>, ) -> MessengerResult { match config.chain.as_str() { diff --git a/crates/katana/core/src/service/messaging/service.rs b/crates/katana/core/src/service/messaging/service.rs index 5cbb21d241..c0e4b6625b 100644 --- a/crates/katana/core/src/service/messaging/service.rs +++ b/crates/katana/core/src/service/messaging/service.rs @@ -1,3 +1,8 @@ +// SOLIS +use tokio::sync::RwLock as AsyncRwLock; +use crate::hooker::KatanaHooker; +// + use std::pin::Pin; use std::sync::Arc; use std::task::{Context, Poll}; @@ -15,7 +20,6 @@ use tracing::{error, info}; use super::{MessagingConfig, Messenger, MessengerMode, MessengerResult, LOG_TARGET}; use crate::backend::Backend; -use crate::hooker::KatanaHooker; use crate::pool::TransactionPool; type MessagingFuture = Pin + Send>>; diff --git a/crates/katana/rpc/rpc-types/src/transaction.rs b/crates/katana/rpc/rpc-types/src/transaction.rs index ee2934e8ed..86e422152c 100644 --- a/crates/katana/rpc/rpc-types/src/transaction.rs +++ b/crates/katana/rpc/rpc-types/src/transaction.rs @@ -21,7 +21,7 @@ use starknet::core::utils::get_contract_address; #[derive(Debug, Clone, Deserialize, Deref)] #[serde(transparent)] -pub struct BroadcastedInvokeTx(BroadcastedInvokeTransaction); +pub struct BroadcastedInvokeTx(pub BroadcastedInvokeTransaction); impl BroadcastedInvokeTx { pub fn into_tx_with_chain_id(self, chain_id: FieldElement) -> InvokeTx { diff --git a/crates/katana/rpc/src/starknet.rs b/crates/katana/rpc/src/starknet.rs index 6dec6efe5e..1200d3debd 100644 --- a/crates/katana/rpc/src/starknet.rs +++ b/crates/katana/rpc/src/starknet.rs @@ -531,7 +531,7 @@ impl StarknetApiServer for StarknetApi { .hooker .read() .await - .verify_invoke_tx_before_pool(invoke_transaction.clone()) + .verify_invoke_tx_before_pool(invoke_transaction.0.clone()) .await { return Err(StarknetApiError::SolisAssetFault.into());