File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use std::{
1010 time:: { Duration , SystemTime , UNIX_EPOCH } ,
1111} ;
1212
13+
1314#[ test]
1415fn test_allocation_id_tracker ( ) {
1516 let allocation_id_0 = address ! ( "abababababababababababababababababababab" ) ;
@@ -268,11 +269,17 @@ fn test_ongoing_rav_requests() {
268269 assert_eq ! ( tracker. get_total_fee( ) , 30 ) ;
269270 assert_eq ! ( tracker. get_ravable_total_fee( ) , 30 ) ;
270271
272+ tracker. add ( allocation_id_2, 1 , get_current_timestamp_u64_ns ( ) ) ;
273+
274+ assert_eq ! ( tracker. get_heaviest_allocation_id( ) , Some ( allocation_id_1) ) ;
275+ assert_eq ! ( tracker. get_total_fee( ) , 31 ) ;
276+ assert_eq ! ( tracker. get_ravable_total_fee( ) , 31 ) ;
277+
271278 tracker. finish_rav_request ( allocation_id_2) ;
272279
273280 assert_eq ! ( tracker. get_heaviest_allocation_id( ) , Some ( allocation_id_2) ) ;
274- assert_eq ! ( tracker. get_total_fee( ) , 60 ) ;
275- assert_eq ! ( tracker. get_ravable_total_fee( ) , 60 ) ;
281+ assert_eq ! ( tracker. get_total_fee( ) , 61 ) ;
282+ assert_eq ! ( tracker. get_ravable_total_fee( ) , 61 ) ;
276283}
277284
278285#[ test]
You can’t perform that action at this time.
0 commit comments