Skip to content

Commit

Permalink
fix(katana): adjust types for solis
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Dec 17, 2023
1 parent f072bf4 commit 5dd0b42
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion crates/katana/core/src/sequencer.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions crates/katana/core/src/service/messaging/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ pub enum MessengerMode {
impl MessengerMode {
pub async fn from_config(
config: MessagingConfig,
#[allow(unused)]
hooker: Arc<AsyncRwLock<dyn KatanaHooker + Send + Sync>>,
) -> MessengerResult<Self> {
match config.chain.as_str() {
Expand Down
6 changes: 5 additions & 1 deletion crates/katana/core/src/service/messaging/service.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -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<T> = Pin<Box<dyn Future<Output = T> + Send>>;
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/rpc/rpc-types/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/rpc/src/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 5dd0b42

Please sign in to comment.