diff --git a/module/src/lib.rs b/module/src/lib.rs index b0bf725ab49d9868f31ce563713db6028d2c1845..4186be1447f470a6f6a25813112c8ee041eab251 100644 --- a/module/src/lib.rs +++ b/module/src/lib.rs @@ -85,9 +85,9 @@ pub trait DuniterModule: 'static + Sized { async fn start(self) -> anyhow::Result<()>; - // Needed for BMA only + /// Get TX full history of a pubkey. Needed for BMA only #[doc(hidden)] - fn get_transactions_history_for_bma( + fn get_txs_history_bma( _dbs_pool: &fast_threadpool::ThreadPoolSyncHandler<SharedDbs<FileBackend>>, _profile_path_opt: Option<&Path>, _pubkey: PublicKey, @@ -95,20 +95,31 @@ pub trait DuniterModule: 'static + Sized { Ok(None) } - // Needed for BMA only + /// Get TX history of a pubkey from a block range. Needed for BMA only #[doc(hidden)] - fn get_written_transactions_for_bma( + fn get_tx_history_bma_written_by_blocks( _profile_path_opt: Option<&Path>, _pubkey: PublicKey, - _start_block: u32, - _end_block: u32, + _from: Option<u32>, + _to: Option<u32>, ) -> KvResult<Option<TxsHistoryForBma>> { Ok(None) } - // Needed for BMA only + /// Get TX history of a pubkey from a median_time range. Needed for BMA only + #[doc(hidden)] + fn get_tx_history_bma_written_by_times( + _profile_path_opt: Option<&Path>, + _pubkey: PublicKey, + _from: Option<u64>, + _to: Option<u64>, + ) -> KvResult<Option<TxsHistoryForBma>> { + Ok(None) + } + + /// Get TX inside the mempool of a pubkey. Needed for BMA only #[doc(hidden)] - fn get_pending_transactions_for_bma( + fn get_txs_history_bma_mempool( _dbs_pool: &fast_threadpool::ThreadPoolSyncHandler<SharedDbs<FileBackend>>, _pubkey: PublicKey, ) -> KvResult<Option<TxsHistoryForBma>> { @@ -293,13 +304,13 @@ macro_rules! plug_duniter_modules { // Needed for BMA only #[allow(dead_code)] #[doc(hidden)] - fn get_transactions_history_for_bma( + fn get_txs_history_bma( dbs_pool: &fast_threadpool::ThreadPoolSyncHandler<SharedDbs<FileBackend>>, profile_path_opt: Option<&Path>, pubkey: PublicKey, ) -> KvResult<TxsHistoryForBma> { $( - if let Some(txs_history) = <$M>::get_transactions_history_for_bma(dbs_pool, profile_path_opt, pubkey)? { + if let Some(txs_history) = <$M>::get_txs_history_bma(dbs_pool, profile_path_opt, pubkey)? { return Ok(txs_history); } )*