@@ -44,7 +44,7 @@ impl CardanoTransactionRepository {
44
44
}
45
45
46
46
/// Return all the [CardanoTransactionRecord]s in the database using chronological order.
47
- pub async fn get_transactions_between_blocks (
47
+ pub async fn get_transactions_in_range_blocks (
48
48
& self ,
49
49
range : Range < BlockNumber > ,
50
50
) -> StdResult < Vec < CardanoTransactionRecord > > {
@@ -118,7 +118,7 @@ impl CardanoTransactionRepository {
118
118
}
119
119
120
120
/// Create new [BlockRangeRootRecord]s in the database.
121
- pub async fn create_block_ranges < T : Into < BlockRangeRootRecord > > (
121
+ pub async fn create_block_range_roots < T : Into < BlockRangeRootRecord > > (
122
122
& self ,
123
123
block_ranges : Vec < T > ,
124
124
) -> StdResult < Vec < BlockRangeRootRecord > > {
@@ -226,23 +226,23 @@ impl TransactionStore for CardanoTransactionRepository {
226
226
}
227
227
}
228
228
229
- async fn get_transactions_between (
229
+ async fn get_transactions_in_range (
230
230
& self ,
231
231
range : Range < BlockNumber > ,
232
232
) -> StdResult < Vec < CardanoTransaction > > {
233
- self . get_transactions_between_blocks ( range) . await . map ( |v| {
233
+ self . get_transactions_in_range_blocks ( range) . await . map ( |v| {
234
234
v. into_iter ( )
235
235
. map ( |record| record. into ( ) )
236
236
. collect :: < Vec < CardanoTransaction > > ( )
237
237
} )
238
238
}
239
239
240
- async fn store_block_ranges (
240
+ async fn store_block_range_roots (
241
241
& self ,
242
242
block_ranges : Vec < ( BlockRange , MKTreeNode ) > ,
243
243
) -> StdResult < ( ) > {
244
244
if !block_ranges. is_empty ( ) {
245
- self . create_block_ranges ( block_ranges) . await ?;
245
+ self . create_block_range_roots ( block_ranges) . await ?;
246
246
}
247
247
Ok ( ( ) )
248
248
}
@@ -535,7 +535,7 @@ mod tests {
535
535
}
536
536
537
537
#[ tokio:: test]
538
- async fn repository_get_transactions_between_blocks ( ) {
538
+ async fn repository_get_transactions_in_range_blocks ( ) {
539
539
let connection = Arc :: new ( cardano_tx_db_connection ( ) . unwrap ( ) ) ;
540
540
let repository = CardanoTransactionRepository :: new ( connection) ;
541
541
@@ -550,23 +550,23 @@ mod tests {
550
550
. unwrap ( ) ;
551
551
552
552
{
553
- let transaction_result = repository. get_transactions_between ( 0 ..10 ) . await . unwrap ( ) ;
553
+ let transaction_result = repository. get_transactions_in_range ( 0 ..10 ) . await . unwrap ( ) ;
554
554
assert_eq ! ( Vec :: <CardanoTransaction >:: new( ) , transaction_result) ;
555
555
}
556
556
{
557
- let transaction_result = repository. get_transactions_between ( 13 ..21 ) . await . unwrap ( ) ;
557
+ let transaction_result = repository. get_transactions_in_range ( 13 ..21 ) . await . unwrap ( ) ;
558
558
assert_eq ! ( Vec :: <CardanoTransaction >:: new( ) , transaction_result) ;
559
559
}
560
560
{
561
- let transaction_result = repository. get_transactions_between ( 9 ..12 ) . await . unwrap ( ) ;
561
+ let transaction_result = repository. get_transactions_in_range ( 9 ..12 ) . await . unwrap ( ) ;
562
562
assert_eq ! ( transactions[ 0 ..=1 ] . to_vec( ) , transaction_result) ;
563
563
}
564
564
{
565
- let transaction_result = repository. get_transactions_between ( 10 ..13 ) . await . unwrap ( ) ;
565
+ let transaction_result = repository. get_transactions_in_range ( 10 ..13 ) . await . unwrap ( ) ;
566
566
assert_eq ! ( transactions. clone( ) , transaction_result) ;
567
567
}
568
568
{
569
- let transaction_result = repository. get_transactions_between ( 11 ..14 ) . await . unwrap ( ) ;
569
+ let transaction_result = repository. get_transactions_in_range ( 11 ..14 ) . await . unwrap ( ) ;
570
570
assert_eq ! ( transactions[ 1 ..=2 ] . to_vec( ) , transaction_result) ;
571
571
}
572
572
}
@@ -604,7 +604,7 @@ mod tests {
604
604
// The last block range give the lower bound
605
605
let last_block_range = BlockRange :: from_block_number ( 0 ) ;
606
606
repository
607
- . store_block_ranges ( vec ! [ (
607
+ . store_block_range_roots ( vec ! [ (
608
608
last_block_range. clone( ) ,
609
609
MKTreeNode :: from_hex( "AAAA" ) . unwrap( ) ,
610
610
) ] )
@@ -631,7 +631,7 @@ mod tests {
631
631
632
632
let last_block_range = BlockRange :: from_block_number ( BlockRange :: LENGTH * 10 ) ;
633
633
repository
634
- . store_block_ranges ( vec ! [ (
634
+ . store_block_range_roots ( vec ! [ (
635
635
last_block_range. clone( ) ,
636
636
MKTreeNode :: from_hex( "AAAA" ) . unwrap( ) ,
637
637
) ] )
@@ -672,7 +672,7 @@ mod tests {
672
672
let repository = CardanoTransactionRepository :: new ( connection. clone ( ) ) ;
673
673
674
674
repository
675
- . store_block_ranges ( vec ! [
675
+ . store_block_range_roots ( vec ! [
676
676
(
677
677
BlockRange :: from_block_number( 0 ) ,
678
678
MKTreeNode :: from_hex( "AAAA" ) . unwrap( ) ,
@@ -709,11 +709,11 @@ mod tests {
709
709
let range = BlockRange :: from_block_number ( 0 ) ;
710
710
711
711
repository
712
- . store_block_ranges ( vec ! [ ( range. clone( ) , MKTreeNode :: from_hex( "AAAA" ) . unwrap( ) ) ] )
712
+ . store_block_range_roots ( vec ! [ ( range. clone( ) , MKTreeNode :: from_hex( "AAAA" ) . unwrap( ) ) ] )
713
713
. await
714
714
. unwrap ( ) ;
715
715
repository
716
- . store_block_ranges ( vec ! [ ( range. clone( ) , MKTreeNode :: from_hex( "BBBB" ) . unwrap( ) ) ] )
716
+ . store_block_range_roots ( vec ! [ ( range. clone( ) , MKTreeNode :: from_hex( "BBBB" ) . unwrap( ) ) ] )
717
717
. await
718
718
. unwrap ( ) ;
719
719
0 commit comments