File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -566,20 +566,26 @@ pub fn query_transactions(
566
566
let account = Addr :: unchecked ( account) ;
567
567
let account_raw = deps. api . addr_canonicalize ( account. as_str ( ) ) ?;
568
568
569
+ let start = page * page_size;
570
+
569
571
// first check if there are any transactions in dwb
570
572
let dwb = DWB . load ( deps. storage ) ?;
571
573
let dwb_index = dwb. recipient_match ( & account_raw) ;
572
- let mut transactions_in_dwb = vec ! [ ] ;
573
- if dwb_index > 0 && dwb. entries [ dwb_index] . list_len ( ) ? > 0 {
574
+ let mut txs_in_dwb = vec ! [ ] ;
575
+ let txs_in_dwb_count = dwb. entries [ dwb_index] . list_len ( ) ?;
576
+ if dwb_index > 0 && txs_in_dwb_count > 0 && start < txs_in_dwb_count as u32 { // skip if start is after buffer entries
574
577
let head_node_index = dwb. entries [ dwb_index] . head_node ( ) ?;
575
578
if head_node_index > 0 {
576
579
let head_node = TX_NODES . add_suffix ( & head_node_index. to_be_bytes ( ) ) . load ( deps. storage ) ?;
577
- transactions_in_dwb = head_node. to_vec ( deps. storage , deps. api ) ?;
580
+ txs_in_dwb = head_node. to_vec ( deps. storage , deps. api ) ?;
578
581
}
579
582
}
580
583
581
584
// second get number of txs in account storage
582
-
585
+ let addr_store = ACCOUNT_TXS . add_suffix ( account_raw. as_slice ( ) ) ;
586
+ let len = addr_store. get_len ( deps. storage ) ? as u64 ;
587
+
588
+
583
589
/*
584
590
let (txs, total) =
585
591
StoredTx::get_txs(
You can’t perform that action at this time.
0 commit comments