@@ -136,6 +136,7 @@ def run_test(self):
136
136
'fee_rate_groups' : dict ( (
137
137
(str (n ), {
138
138
'from' : n ,
139
+ 'to' : n ,
139
140
'count' : 0 ,
140
141
'fees' : 0 ,
141
142
'size' : 0 ,
@@ -144,6 +145,7 @@ def run_test(self):
144
145
'total_fees' : tx1_info ['fee' ] + tx2_info ['fee' ] + tx3_info ['fee' ],
145
146
}
146
147
expected_frg = expected_histogram ['fee_rate_groups' ]
148
+ expected_frg ['15' ]['to' ] = None
147
149
tx1p2p3_feerate = get_actual_fee_rate (expected_histogram ['total_fees' ], tx1_info ['vsize' ] + tx2_info ['vsize' ] + tx3_info ['vsize' ])
148
150
def inc_expected (feerate , txinfo ):
149
151
this_frg = expected_frg [feerate ]
@@ -163,10 +165,18 @@ def inc_expected(feerate, txinfo):
163
165
for collapse_n in (9 , 11 , 13 , 15 ):
164
166
for field in ('count' , 'size' , 'fees' ):
165
167
expected_frg [str (collapse_n - 1 )][field ] += expected_frg [str (collapse_n )][field ]
168
+ expected_frg [str (collapse_n - 1 )]['to' ] += 1
166
169
del expected_frg [str (collapse_n )]
170
+ expected_frg ['14' ]['to' ] += 1 # 16 is also skipped
167
171
168
172
for new_n in (17 , 20 , 25 ) + tuple (range (30 , 90 , 10 )) + (100 , 120 , 140 , 170 , 200 , 250 ) + tuple (range (300 , 900 , 100 )) + (1000 , 1200 , 1400 , 1700 , 2000 , 2500 ) + tuple (range (3000 , 9000 , 1000 )) + (10000 ,):
169
- assert (info ['fee_histogram' ]['fee_rate_groups' ][str (new_n )] == {
173
+ frinfo = info ['fee_histogram' ]['fee_rate_groups' ][str (new_n )]
174
+ if new_n == 10000 :
175
+ assert frinfo ['to' ] is None
176
+ else :
177
+ assert frinfo ['to' ] > frinfo ['from' ]
178
+ del frinfo ['to' ]
179
+ assert_equal (frinfo , {
170
180
'from' : new_n ,
171
181
'count' : 0 ,
172
182
'fees' : 0 ,
@@ -191,6 +201,8 @@ def histogram_stats(self, histogram):
191
201
assert_equal (bin ['count' ], 0 )
192
202
assert_greater_than_or_equal (bin ['fees' ], 0 )
193
203
assert_greater_than_or_equal (bin ['size' ], 0 )
204
+ if bin ['to' ] is not None :
205
+ assert_greater_than_or_equal (bin ['to' ], bin ['from' ])
194
206
total_fees += bin ['fees' ]
195
207
196
208
if bin ['count' ] == 0 :
0 commit comments