diff --git a/module/src/lib.rs b/module/src/lib.rs index f8bd7d43215df503283d8551e532ba381c054279..841b1ebfb248cb7bf4f1c5f61e0a425a93a3dff2 100644 --- a/module/src/lib.rs +++ b/module/src/lib.rs @@ -320,14 +320,14 @@ macro_rules! plug_duniter_modules { // Needed for BMA only #[allow(dead_code)] #[doc(hidden)] - fn get_written_transactions_for_bma( + fn get_txs_history_bma_by_blocks( profile_path_opt: Option<&Path>, pubkey: PublicKey, - start_block: u32, - end_block: u32, + from: Option<u32>, + to: Option<u32>, ) -> KvResult<TxsHistoryForBma> { $( - if let Some(txs_history) = <$M>::get_written_transactions_for_bma(profile_path_opt, pubkey, start_block, end_block)? { + if let Some(txs_history) = <$M>::get_txs_history_bma_by_blocks(profile_path_opt, pubkey, from, to)? { return Ok(txs_history); } )* @@ -337,12 +337,29 @@ macro_rules! plug_duniter_modules { // Needed for BMA only #[allow(dead_code)] #[doc(hidden)] - fn get_pending_transactions_for_bma( + fn get_txs_history_bma_by_times( + profile_path_opt: Option<&Path>, + pubkey: PublicKey, + from: Option<u64>, + to: Option<u64>, + ) -> KvResult<TxsHistoryForBma> { + $( + if let Some(txs_history) = <$M>::get_txs_history_bma_by_times(profile_path_opt, pubkey, from, to)? { + return Ok(txs_history); + } + )* + Ok(TxsHistoryForBma::default()) + } + + // Needed for BMA only + #[allow(dead_code)] + #[doc(hidden)] + fn get_txs_history_bma_mempool( dbs_pool: &fast_threadpool::ThreadPoolSyncHandler<SharedDbs<FileBackend>>, pubkey: PublicKey, ) -> KvResult<TxsHistoryForBma> { $( - if let Some(txs_history) = <$M>::get_pending_transactions_for_bma(dbs_pool, pubkey)? { + if let Some(txs_history) = <$M>::get_txs_history_bma_mempool(dbs_pool, pubkey)? { return Ok(txs_history); } )*