Skip to content
Snippets Groups Projects
Commit d91ecb11 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] rename some BMA txs history functions ('get_tx_history__xxx()' into 'get_txs_history_xxx()')

parent c8f4e65f
No related branches found
No related tags found
1 merge request!2[enh] add `get_written_transactions_for_bma()` and `get_pending_transactions_for_bma()`
Pipeline #31889 passed
...@@ -320,14 +320,31 @@ macro_rules! plug_duniter_modules { ...@@ -320,14 +320,31 @@ macro_rules! plug_duniter_modules {
// Needed for BMA only // Needed for BMA only
#[allow(dead_code)] #[allow(dead_code)]
#[doc(hidden)] #[doc(hidden)]
fn get_written_transactions_for_bma( fn get_txs_history_bma_by_blocks(
profile_path_opt: Option<&Path>,
pubkey: PublicKey,
from: Option<u32>,
to: Option<u32>,
) -> KvResult<TxsHistoryForBma> {
$(
if let Some(txs_history) = <$M>::get_txs_history_bma_by_blocks(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_by_times(
profile_path_opt: Option<&Path>, profile_path_opt: Option<&Path>,
pubkey: PublicKey, pubkey: PublicKey,
start_block: u32, from: Option<u64>,
end_block: u32, to: Option<u64>,
) -> KvResult<TxsHistoryForBma> { ) -> 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_times(profile_path_opt, pubkey, from, to)? {
return Ok(txs_history); return Ok(txs_history);
} }
)* )*
...@@ -337,12 +354,12 @@ macro_rules! plug_duniter_modules { ...@@ -337,12 +354,12 @@ macro_rules! plug_duniter_modules {
// Needed for BMA only // Needed for BMA only
#[allow(dead_code)] #[allow(dead_code)]
#[doc(hidden)] #[doc(hidden)]
fn get_pending_transactions_for_bma( fn get_txs_history_bma_mempool(
dbs_pool: &fast_threadpool::ThreadPoolSyncHandler<SharedDbs<FileBackend>>, dbs_pool: &fast_threadpool::ThreadPoolSyncHandler<SharedDbs<FileBackend>>,
pubkey: PublicKey, pubkey: PublicKey,
) -> KvResult<TxsHistoryForBma> { ) -> 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); return Ok(txs_history);
} }
)* )*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment