File tree Expand file tree Collapse file tree 5 files changed +16
-24
lines changed
Expand file tree Collapse file tree 5 files changed +16
-24
lines changed Original file line number Diff line number Diff line change @@ -132,21 +132,21 @@ impl Client {
132132
133133 pub async fn add_invoke_transaction (
134134 & self ,
135- transaction : katana_rpc_types :: broadcasted :: BroadcastedInvokeTx ,
135+ transaction : BroadcastedInvokeTx ,
136136 ) -> Result < AddInvokeTransactionResponse , Error > {
137137 self . gateway ( "add_transaction" ) . json ( & transaction) . send ( ) . await
138138 }
139139
140140 pub async fn add_declare_transaction (
141141 & self ,
142- transaction : katana_rpc_types :: broadcasted :: BroadcastedDeclareTx ,
142+ transaction : BroadcastedDeclareTx ,
143143 ) -> Result < AddDeclareTransactionResponse , Error > {
144144 self . gateway ( "add_transaction" ) . json ( & transaction) . send ( ) . await
145145 }
146146
147147 pub async fn add_deploy_account_transaction (
148148 & self ,
149- transaction : katana_rpc_types :: broadcasted :: BroadcastedDeployAccountTx ,
149+ transaction : BroadcastedDeployAccountTx ,
150150 ) -> Result < AddDeployAccountTransactionResponse , Error > {
151151 self . gateway ( "add_transaction" ) . json ( & transaction) . send ( ) . await
152152 }
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ cairo-lang-starknet-classes.workspace = true
1616flate2.workspace = true
1717serde_json.workspace = true
1818serde.workspace = true
19- serde_json.workspace = true
2019starknet.workspace = true
2120thiserror.workspace = true
2221
Original file line number Diff line number Diff line change @@ -21,14 +21,12 @@ use katana_optimistic::pool::{PoolValidator, TxPool};
2121use katana_pool:: ordering:: FiFo ;
2222use katana_primitives:: block:: BlockIdOrTag ;
2323use katana_primitives:: env:: { CfgEnv , FeeTokenAddressses } ;
24- use katana_provider:: api:: block:: BlockNumberProvider ;
25- use katana_provider:: api:: env:: BlockEnvProvider ;
2624use katana_provider:: providers:: fork:: ForkedProvider ;
27- use katana_rpc:: cors:: Cors ;
28- use katana_rpc:: starknet:: forking:: ForkedClient ;
29- use katana_rpc:: starknet:: { OptimisticPendingBlockProvider , StarknetApi , StarknetApiConfig } ;
30- use katana_rpc:: { RpcServer , RpcServerHandle } ;
3125use katana_rpc_api:: starknet:: { StarknetApiServer , StarknetTraceApiServer , StarknetWriteApiServer } ;
26+ use katana_rpc_server:: cors:: Cors ;
27+ use katana_rpc_server:: starknet:: forking:: ForkedClient ;
28+ use katana_rpc_server:: starknet:: { OptimisticPendingBlockProvider , StarknetApi , StarknetApiConfig } ;
29+ use katana_rpc_server:: { RpcServer , RpcServerHandle } ;
3230use katana_tasks:: { JoinHandle , TaskManager } ;
3331use tracing:: info;
3432
Original file line number Diff line number Diff line change @@ -38,22 +38,17 @@ impl Validator for PoolValidator {
3838 // Forward the transaction to the remote node
3939 let result = match & tx. tx {
4040 BroadcastedTx :: Invoke ( invoke_tx) => {
41- self . gateway_client . add_invoke_transaction ( invoke_tx. clone ( ) ) . await . map ( |_| ( ) )
42- // self.client .add_invoke_transaction(invoke_tx.clone() ).await.map(|_| ())
41+ let gateway_tx = invoke_tx. clone ( ) . into ( ) ;
42+ self . gateway_client . add_invoke_transaction ( gateway_tx ) . await . map ( |_| ( ) )
4343 }
4444 BroadcastedTx :: Declare ( declare_tx) => {
45- self . gateway_client . add_declare_transaction ( declare_tx. clone ( ) ) . await . map ( |_| ( ) )
46- // self.client.add_declare_transaction(declare_tx.clone()).await.map(|_| ())
45+ let gateway_tx = declare_tx. clone ( ) . into ( ) ;
46+ self . gateway_client . add_declare_transaction ( gateway_tx) . await . map ( |_| ( ) )
47+ }
48+ BroadcastedTx :: DeployAccount ( deploy_account_tx) => {
49+ let gateway_tx = deploy_account_tx. clone ( ) . into ( ) ;
50+ self . gateway_client . add_deploy_account_transaction ( gateway_tx) . await . map ( |_| ( ) )
4751 }
48- BroadcastedTx :: DeployAccount ( deploy_account_tx) => self
49- . gateway_client
50- . add_deploy_account_transaction ( deploy_account_tx. clone ( ) )
51- . await
52- . map ( |_| ( ) ) , /* self
53- * .client
54- * .add_deploy_account_transaction(deploy_account_tx.clone())
55- * .await
56- * .map(|_| ()), */
5752 } ;
5853
5954 match result {
Original file line number Diff line number Diff line change @@ -716,7 +716,7 @@ impl From<BroadcastedTxWithChainId> for crate::transaction::RpcTxWithHash {
716716 fee_data_availability_mode : tx. fee_data_availability_mode ,
717717 } ) ) ,
718718 BroadcastedTx :: Declare ( tx) => {
719- let class_hash = tx. contract_class . hash ( ) . expect ( "failed to compute class hash" ) ;
719+ let class_hash = tx. contract_class . hash ( ) ;
720720 RpcTx :: Declare ( RpcDeclareTx :: V3 ( RpcDeclareTxV3 {
721721 sender_address : tx. sender_address ,
722722 compiled_class_hash : tx. compiled_class_hash ,
You can’t perform that action at this time.
0 commit comments