mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-13 06:44:41 +02:00
Use COINBASE_MATURITY constant in functional tests.
This commit is contained in:
@ -11,6 +11,7 @@ RPCs tested are:
|
||||
"""
|
||||
from collections import defaultdict
|
||||
|
||||
from test_framework.blocktools import COINBASE_MATURITY
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_raises_rpc_error
|
||||
from test_framework.wallet_util import test_address
|
||||
@ -32,7 +33,7 @@ class WalletLabelsTest(BitcoinTestFramework):
|
||||
# Note each time we call generate, all generated coins go into
|
||||
# the same address, so we call twice to get two addresses w/50 each
|
||||
node.generatetoaddress(nblocks=1, address=node.getnewaddress(label='coinbase'))
|
||||
node.generatetoaddress(nblocks=101, address=node.getnewaddress(label='coinbase'))
|
||||
node.generatetoaddress(nblocks=COINBASE_MATURITY + 1, address=node.getnewaddress(label='coinbase'))
|
||||
assert_equal(node.getbalance(), 100)
|
||||
|
||||
# there should be 2 address groups
|
||||
@ -104,7 +105,7 @@ class WalletLabelsTest(BitcoinTestFramework):
|
||||
label.verify(node)
|
||||
assert_equal(node.getreceivedbylabel(label.name), 2)
|
||||
label.verify(node)
|
||||
node.generate(101)
|
||||
node.generate(COINBASE_MATURITY + 1)
|
||||
|
||||
# Check that setlabel can assign a label to a new unused address.
|
||||
for label in labels:
|
||||
@ -124,7 +125,7 @@ class WalletLabelsTest(BitcoinTestFramework):
|
||||
label.add_address(multisig_address)
|
||||
label.purpose[multisig_address] = "send"
|
||||
label.verify(node)
|
||||
node.generate(101)
|
||||
node.generate(COINBASE_MATURITY + 1)
|
||||
|
||||
# Check that setlabel can change the label of an address from a
|
||||
# different label.
|
||||
|
Reference in New Issue
Block a user