Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_feature_minerfund.py
Show All 19 Lines | |||||
class MinerFundTest(BitcoinTestFramework): | class MinerFundTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 2 | self.num_nodes = 2 | ||||
self.extra_args = [[ | self.extra_args = [[ | ||||
'-enableminerfund', | '-enableminerfund', | ||||
'-wellingtonactivationtime={}'.format(WELLINGTON_ACTIVATION_TIME), | f'-wellingtonactivationtime={WELLINGTON_ACTIVATION_TIME}', | ||||
], [ | ], [ | ||||
'-wellingtonactivationtime={}'.format(WELLINGTON_ACTIVATION_TIME), | f'-wellingtonactivationtime={WELLINGTON_ACTIVATION_TIME}', | ||||
]] | ]] | ||||
def run_test(self): | def run_test(self): | ||||
node = self.nodes[0] | node = self.nodes[0] | ||||
self.log.info('Create some history') | self.log.info('Create some history') | ||||
self.generate(node, 10) | self.generate(node, 10) | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
node, nblocks=1, address=address)[0] | node, nblocks=1, address=address)[0] | ||||
check_miner_fund_output(MINER_FUND_ADDR) | check_miner_fund_output(MINER_FUND_ADDR) | ||||
# Invalidate it | # Invalidate it | ||||
for n in self.nodes: | for n in self.nodes: | ||||
n.invalidateblock(first_block_has_miner_fund) | n.invalidateblock(first_block_has_miner_fund) | ||||
# node1 mines a block without a coinbase output to the miner fund. | # node1 mines a block without a coinbase output to the miner fund. | ||||
with node.assert_debug_log(expected_msgs=['policy-bad-miner-fund']): | |||||
first_block_no_miner_fund = self.generatetoaddress( | first_block_no_miner_fund = self.generatetoaddress( | ||||
self.nodes[1], | self.nodes[1], | ||||
nblocks=1, | nblocks=1, | ||||
address=address, | address=address, | ||||
sync_fun=self.no_op)[0] | sync_fun=self.no_op)[0] | ||||
coinbase = get_best_coinbase(self.nodes[1]) | coinbase = get_best_coinbase(self.nodes[1]) | ||||
assert_equal(len(coinbase['vout']), 1) | assert_equal(len(coinbase['vout']), 1) | ||||
# node0 parks the block since the miner fund is enforced by policy. | # node0 parks the block since the miner fund is enforced by policy. | ||||
def parked_block(blockhash): | def parked_block(blockhash): | ||||
for tip in node.getchaintips(): | for tip in node.getchaintips(): | ||||
if tip["hash"] == blockhash: | if tip["hash"] == blockhash: | ||||
assert tip["status"] != "active" | assert tip["status"] != "active" | ||||
Show All 20 Lines |