@@ -61,7 +61,7 @@ use crate::{
6161 constants:: VERSION_BUILD ,
6262 rpc:: {
6363 constants:: { FIELD_NOT_SUPPORTED , UNSUPPORTED_RPC_CALL } ,
64- handlers:: { helper, shared} ,
64+ handlers:: { helper, shared, shared :: not_available } ,
6565 service:: { address_book, blockchain, blockchain_context, blockchain_manager, txpool} ,
6666 CupratedRpcHandler ,
6767 } ,
@@ -77,11 +77,11 @@ pub async fn map_request(
7777 use JsonRpcResponse as Resp ;
7878
7979 Ok ( match request {
80- Req :: GetBlockTemplate ( r) => Resp :: GetBlockTemplate ( get_block_template ( state , r ) . await ?) ,
80+ Req :: GetBlockTemplate ( r) => Resp :: GetBlockTemplate ( not_available ( ) ?) ,
8181 Req :: GetBlockCount ( r) => Resp :: GetBlockCount ( get_block_count ( state, r) . await ?) ,
8282 Req :: OnGetBlockHash ( r) => Resp :: OnGetBlockHash ( on_get_block_hash ( state, r) . await ?) ,
83- Req :: SubmitBlock ( r) => Resp :: SubmitBlock ( submit_block ( state , r ) . await ?) ,
84- Req :: GenerateBlocks ( r) => Resp :: GenerateBlocks ( generate_blocks ( state , r ) . await ?) ,
83+ Req :: SubmitBlock ( r) => Resp :: SubmitBlock ( not_available ( ) ?) ,
84+ Req :: GenerateBlocks ( r) => Resp :: GenerateBlocks ( not_available ( ) ?) ,
8585 Req :: GetLastBlockHeader ( r) => {
8686 Resp :: GetLastBlockHeader ( get_last_block_header ( state, r) . await ?)
8787 }
@@ -95,33 +95,25 @@ pub async fn map_request(
9595 Resp :: GetBlockHeadersRange ( get_block_headers_range ( state, r) . await ?)
9696 }
9797 Req :: GetBlock ( r) => Resp :: GetBlock ( get_block ( state, r) . await ?) ,
98- Req :: GetConnections ( r) => Resp :: GetConnections ( get_connections ( state, r) . await ?) ,
99- Req :: GetInfo ( r) => Resp :: GetInfo ( get_info ( state, r) . await ?) ,
100- Req :: HardForkInfo ( r) => Resp :: HardForkInfo ( hard_fork_info ( state, r) . await ?) ,
101- Req :: SetBans ( r) => Resp :: SetBans ( set_bans ( state, r) . await ?) ,
102- Req :: GetBans ( r) => Resp :: GetBans ( get_bans ( state, r) . await ?) ,
103- Req :: Banned ( r) => Resp :: Banned ( banned ( state, r) . await ?) ,
104- Req :: FlushTransactionPool ( r) => {
105- Resp :: FlushTransactionPool ( flush_transaction_pool ( state, r) . await ?)
106- }
107- Req :: GetOutputHistogram ( r) => {
108- Resp :: GetOutputHistogram ( get_output_histogram ( state, r) . await ?)
109- }
110- Req :: GetCoinbaseTxSum ( r) => Resp :: GetCoinbaseTxSum ( get_coinbase_tx_sum ( state, r) . await ?) ,
111- Req :: GetVersion ( r) => Resp :: GetVersion ( get_version ( state, r) . await ?) ,
112- Req :: GetFeeEstimate ( r) => Resp :: GetFeeEstimate ( get_fee_estimate ( state, r) . await ?) ,
113- Req :: GetAlternateChains ( r) => {
114- Resp :: GetAlternateChains ( get_alternate_chains ( state, r) . await ?)
115- }
116- Req :: RelayTx ( r) => Resp :: RelayTx ( relay_tx ( state, r) . await ?) ,
117- Req :: SyncInfo ( r) => Resp :: SyncInfo ( sync_info ( state, r) . await ?) ,
118- Req :: GetTransactionPoolBacklog ( r) => {
119- Resp :: GetTransactionPoolBacklog ( get_transaction_pool_backlog ( state, r) . await ?)
120- }
121- Req :: GetMinerData ( r) => Resp :: GetMinerData ( get_miner_data ( state, r) . await ?) ,
122- Req :: PruneBlockchain ( r) => Resp :: PruneBlockchain ( prune_blockchain ( state, r) . await ?) ,
123- Req :: CalcPow ( r) => Resp :: CalcPow ( calc_pow ( state, r) . await ?) ,
124- Req :: AddAuxPow ( r) => Resp :: AddAuxPow ( add_aux_pow ( state, r) . await ?) ,
98+ Req :: GetConnections ( r) => Resp :: GetConnections ( not_available ( ) ?) ,
99+ Req :: GetInfo ( r) => Resp :: GetInfo ( not_available ( ) ?) ,
100+ Req :: HardForkInfo ( r) => Resp :: HardForkInfo ( not_available ( ) ?) ,
101+ Req :: SetBans ( r) => Resp :: SetBans ( not_available ( ) ?) ,
102+ Req :: GetBans ( r) => Resp :: GetBans ( not_available ( ) ?) ,
103+ Req :: Banned ( r) => Resp :: Banned ( not_available ( ) ?) ,
104+ Req :: FlushTransactionPool ( r) => Resp :: FlushTransactionPool ( not_available ( ) ?) ,
105+ Req :: GetOutputHistogram ( r) => Resp :: GetOutputHistogram ( not_available ( ) ?) ,
106+ Req :: GetCoinbaseTxSum ( r) => Resp :: GetCoinbaseTxSum ( not_available ( ) ?) ,
107+ Req :: GetVersion ( r) => Resp :: GetVersion ( not_available ( ) ?) ,
108+ Req :: GetFeeEstimate ( r) => Resp :: GetFeeEstimate ( not_available ( ) ?) ,
109+ Req :: GetAlternateChains ( r) => Resp :: GetAlternateChains ( not_available ( ) ?) ,
110+ Req :: RelayTx ( r) => Resp :: RelayTx ( not_available ( ) ?) ,
111+ Req :: SyncInfo ( r) => Resp :: SyncInfo ( not_available ( ) ?) ,
112+ Req :: GetTransactionPoolBacklog ( r) => Resp :: GetTransactionPoolBacklog ( not_available ( ) ?) ,
113+ Req :: GetMinerData ( r) => Resp :: GetMinerData ( not_available ( ) ?) ,
114+ Req :: PruneBlockchain ( r) => Resp :: PruneBlockchain ( not_available ( ) ?) ,
115+ Req :: CalcPow ( r) => Resp :: CalcPow ( not_available ( ) ?) ,
116+ Req :: AddAuxPow ( r) => Resp :: AddAuxPow ( not_available ( ) ?) ,
125117
126118 // Unsupported RPC calls.
127119 Req :: GetTxIdsLoose ( _) | Req :: FlushCache ( _) => return Err ( anyhow ! ( UNSUPPORTED_RPC_CALL ) ) ,
@@ -172,7 +164,7 @@ async fn get_block_template(
172164 seed_hash,
173165 next_seed_hash,
174166 } = * blockchain_manager:: create_block_template (
175- & mut state . blockchain_manager ,
167+ todo ! ( ) ,
176168 prev_block,
177169 request. wallet_address ,
178170 request. extra_nonce . 0 ,
@@ -242,7 +234,7 @@ async fn submit_block(
242234 let block_id = Hex ( block. hash ( ) ) ;
243235
244236 // Attempt to relay the block.
245- blockchain_manager:: relay_block ( & mut state . blockchain_manager , Box :: new ( block) ) . await ?;
237+ blockchain_manager:: relay_block ( todo ! ( ) , Box :: new ( block) ) . await ?;
246238
247239 Ok ( SubmitBlockResponse {
248240 base : helper:: response_base ( false ) ,
@@ -269,7 +261,7 @@ async fn generate_blocks(
269261 } ;
270262
271263 let ( blocks, height) = blockchain_manager:: generate_blocks (
272- & mut state . blockchain_manager ,
264+ todo ! ( ) ,
273265 request. amount_of_blocks ,
274266 prev_block,
275267 request. starting_nonce ,
@@ -479,7 +471,7 @@ async fn get_info(
479471 ( String :: new ( ) , false )
480472 } ;
481473
482- let busy_syncing = blockchain_manager:: syncing ( & mut state . blockchain_manager ) . await ?;
474+ let busy_syncing = blockchain_manager:: syncing ( todo ! ( ) ) . await ?;
483475
484476 let ( cumulative_difficulty, cumulative_difficulty_top64) =
485477 split_u128_into_low_high_bits ( cumulative_difficulty) ;
@@ -524,12 +516,10 @@ async fn get_info(
524516 let rpc_connections_count = if restricted { 0 } else { 0 } ;
525517
526518 let start_time = if restricted { 0 } else { * START_INSTANT_UNIX } ;
527- let synchronized = blockchain_manager:: synced ( & mut state . blockchain_manager ) . await ?;
519+ let synchronized = blockchain_manager:: synced ( todo ! ( ) ) . await ?;
528520
529- let target_height = blockchain_manager:: target_height ( & mut state. blockchain_manager ) . await ?;
530- let target = blockchain_manager:: target ( & mut state. blockchain_manager )
531- . await ?
532- . as_secs ( ) ;
521+ let target_height = blockchain_manager:: target_height ( todo ! ( ) ) . await ?;
522+ let target = blockchain_manager:: target ( todo ! ( ) ) . await ?. as_secs ( ) ;
533523 let top_block_hash = Hex ( c. top_hash ) ;
534524
535525 let tx_count = blockchain:: total_tx_count ( & mut state. blockchain_read ) . await ?;
@@ -738,7 +728,7 @@ async fn flush_transaction_pool(
738728 . map ( |h| h. 0 )
739729 . collect :: < Vec < [ u8 ; 32 ] > > ( ) ;
740730
741- txpool:: flush ( & mut state . txpool_manager , tx_hashes) . await ?;
731+ txpool:: flush ( todo ! ( ) , tx_hashes) . await ?;
742732
743733 Ok ( FlushTransactionPoolResponse { status : Status :: Ok } )
744734}
@@ -807,7 +797,7 @@ async fn get_version(
807797 _: GetVersionRequest ,
808798) -> Result < GetVersionResponse , Error > {
809799 let current_height = helper:: top_height ( & mut state) . await ?. 0 ;
810- let target_height = blockchain_manager:: target_height ( & mut state . blockchain_manager ) . await ?;
800+ let target_height = blockchain_manager:: target_height ( todo ! ( ) ) . await ?;
811801
812802 let mut hard_forks = Vec :: with_capacity ( HardFork :: COUNT ) ;
813803
@@ -880,7 +870,7 @@ async fn relay_tx(
880870 . map ( |h| h. 0 )
881871 . collect :: < Vec < [ u8 ; 32 ] > > ( ) ;
882872
883- txpool:: relay ( & mut state . txpool_manager , tx_hashes) . await ?;
873+ txpool:: relay ( todo ! ( ) , tx_hashes) . await ?;
884874
885875 Ok ( RelayTxResponse { status : Status :: Ok } )
886876}
@@ -892,20 +882,19 @@ async fn sync_info(
892882) -> Result < SyncInfoResponse , Error > {
893883 let height = usize_to_u64 ( state. blockchain_context . blockchain_context ( ) . chain_height ) ;
894884
895- let target_height = blockchain_manager:: target_height ( & mut state . blockchain_manager ) . await ?;
885+ let target_height = blockchain_manager:: target_height ( todo ! ( ) ) . await ?;
896886
897887 let peers = address_book:: connection_info :: < ClearNet > ( & mut DummyAddressBook )
898888 . await ?
899889 . into_iter ( )
900890 . map ( |info| SyncInfoPeer { info } )
901891 . collect ( ) ;
902892
903- let next_needed_pruning_seed =
904- blockchain_manager:: next_needed_pruning_seed ( & mut state. blockchain_manager )
905- . await ?
906- . compress ( ) ;
893+ let next_needed_pruning_seed = blockchain_manager:: next_needed_pruning_seed ( todo ! ( ) )
894+ . await ?
895+ . compress ( ) ;
907896
908- let spans = blockchain_manager:: spans :: < ClearNet > ( & mut state . blockchain_manager ) . await ?;
897+ let spans = blockchain_manager:: spans :: < ClearNet > ( todo ! ( ) ) . await ?;
909898
910899 // <https://github.com/Cuprate/cuprate/pull/320#discussion_r1811063772>
911900 let overview = String :: from ( FIELD_NOT_SUPPORTED ) ;
@@ -994,10 +983,8 @@ async fn prune_blockchain(
994983 mut state : CupratedRpcHandler ,
995984 request : PruneBlockchainRequest ,
996985) -> Result < PruneBlockchainResponse , Error > {
997- let pruned = blockchain_manager:: pruned ( & mut state. blockchain_manager ) . await ?;
998- let pruning_seed = blockchain_manager:: prune ( & mut state. blockchain_manager )
999- . await ?
1000- . compress ( ) ;
986+ let pruned = blockchain_manager:: pruned ( todo ! ( ) ) . await ?;
987+ let pruning_seed = blockchain_manager:: prune ( todo ! ( ) ) . await ?. compress ( ) ;
1001988
1002989 Ok ( PruneBlockchainResponse {
1003990 base : helper:: response_base ( false ) ,
0 commit comments