File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
mithril-aggregator/src/services
mithril-common/src/signable_builder Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,10 @@ impl ProverService for MithrilProverService {
51
51
let mut transactions_by_block_ranges: HashMap < BlockRange , Vec < TransactionHash > > =
52
52
HashMap :: new ( ) ;
53
53
for transaction in & transactions {
54
- let block_range_start =
55
- transaction. block_number / BLOCK_RANGE_LENGTH * BLOCK_RANGE_LENGTH ;
56
- let block_range_end = block_range_start + BLOCK_RANGE_LENGTH ;
54
+ let block_range_end = transaction
55
+ . block_number
56
+ . next_multiple_of ( BLOCK_RANGE_LENGTH ) ;
57
+ let block_range_start = block_range_end - BLOCK_RANGE_LENGTH ;
57
58
let block_range = BlockRange :: new ( block_range_start, block_range_end) ;
58
59
if transaction_hashes. contains ( & transaction. transaction_hash ) {
59
60
transactions_to_certify. push ( ( block_range. clone ( ) , transaction) ) ;
Original file line number Diff line number Diff line change @@ -73,9 +73,10 @@ impl CardanoTransactionsSignableBuilder {
73
73
let mut transactions_by_block_ranges: HashMap < BlockRange , Vec < TransactionHash > > =
74
74
HashMap :: new ( ) ;
75
75
for transaction in transactions {
76
- let block_range_start =
77
- transaction. block_number / BLOCK_RANGE_LENGTH * BLOCK_RANGE_LENGTH ;
78
- let block_range_end = block_range_start + BLOCK_RANGE_LENGTH ;
76
+ let block_range_end = transaction
77
+ . block_number
78
+ . next_multiple_of ( BLOCK_RANGE_LENGTH ) ;
79
+ let block_range_start = block_range_end - BLOCK_RANGE_LENGTH ;
79
80
let block_range = BlockRange :: new ( block_range_start, block_range_end) ;
80
81
transactions_by_block_ranges
81
82
. entry ( block_range)
You can’t perform that action at this time.
0 commit comments