Changeset View
Changeset View
Standalone View
Standalone View
qa/rpc-tests/test_framework/util.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
Lint: Code style violation: '/home/sickpig/code/abc/bitcoin-abc/qa/rpc-tests/test_framework/util.py' has code style errors. | |||||
# Copyright (c) 2014-2016 The Bitcoin Core developers | # Copyright (c) 2014-2016 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
# | # | ||||
# Helpful routines for regression testing | # Helpful routines for regression testing | ||||
# | # | ||||
▲ Show 20 Lines • Show All 734 Lines • ▼ Show 20 Lines | |||||
def satoshi_round(amount): | def satoshi_round(amount): | ||||
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) | return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) | ||||
# Helper to create at least "count" utxos | # Helper to create at least "count" utxos | ||||
# Pass in a fee that is sufficient for relay and mining new transactions. | # Pass in a fee that is sufficient for relay and mining new transactions. | ||||
def create_confirmed_utxos(fee, node, count): | def create_confirmed_utxos(fee, node, count, age=101): | ||||
node.generate(int(0.5 * count) + 101) | node.generate(int(0.5 * count) + age) | ||||
utxos = node.listunspent() | utxos = node.listunspent() | ||||
iterations = count - len(utxos) | iterations = count - len(utxos) | ||||
addr1 = node.getnewaddress() | addr1 = node.getnewaddress() | ||||
addr2 = node.getnewaddress() | addr2 = node.getnewaddress() | ||||
if iterations <= 0: | if iterations <= 0: | ||||
return utxos | return utxos | ||||
for i in range(iterations): | for i in range(iterations): | ||||
t = utxos.pop() | t = utxos.pop() | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |
'/home/sickpig/code/abc/bitcoin-abc/qa/rpc-tests/test_framework/util.py' has code style errors.