Skip to content

Commit 234f22a

Browse files
committed
merge bitcoin#23037: fix confusing off-by-one nValue in feature_coinstatsindex.py
1 parent 3b9f935 commit 234f22a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/functional/feature_coinstatsindex.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def _test_coin_stats_index(self):
178178
# Generate and send another tx with an OP_RETURN output (which is unspendable)
179179
tx2 = CTransaction()
180180
tx2.vin.append(CTxIn(COutPoint(int(tx1_txid, 16), n), b''))
181-
tx2.vout.append(CTxOut(int(20.99 * COIN), CScript([OP_RETURN] + [OP_FALSE]*30)))
181+
tx2.vout.append(CTxOut(int(Decimal('20.99') * COIN), CScript([OP_RETURN] + [OP_FALSE]*30)))
182182
tx2_hex = self.nodes[0].signrawtransactionwithwallet(tx2.serialize().hex())['hex']
183183
self.nodes[0].sendrawtransaction(tx2_hex)
184184

@@ -189,16 +189,16 @@ def _test_coin_stats_index(self):
189189
for hash_option in index_hash_options:
190190
# Check all amounts were registered correctly
191191
res6 = index_node.gettxoutsetinfo(hash_option, 108)
192-
assert_equal(res6['total_unspendable_amount'], Decimal('70.98999999'))
192+
assert_equal(res6['total_unspendable_amount'], Decimal('70.99000000'))
193193
assert_equal(res6['block_info'], {
194-
'unspendable': Decimal('20.98999999'),
194+
'unspendable': Decimal('20.99000000'),
195195
'prevout_spent': 511,
196196
'new_outputs_ex_coinbase': Decimal('489.99999741'),
197-
'coinbase': Decimal('500.01000260'),
197+
'coinbase': Decimal('500.01000259'),
198198
'unspendables': {
199199
'genesis_block': 0,
200200
'bip30': 0,
201-
'scripts': Decimal('20.98999999'),
201+
'scripts': Decimal('20.99000000'),
202202
'unclaimed_rewards': 0
203203
}
204204
})
@@ -220,7 +220,7 @@ def _test_coin_stats_index(self):
220220

221221
for hash_option in index_hash_options:
222222
res7 = index_node.gettxoutsetinfo(hash_option, 109)
223-
assert_equal(res7['total_unspendable_amount'], Decimal('530.98999999'))
223+
assert_equal(res7['total_unspendable_amount'], Decimal('530.99000000'))
224224
assert_equal(res7['block_info'], {
225225
'unspendable': 460,
226226
'prevout_spent': 0,

0 commit comments

Comments
 (0)