Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mempool_spend_coinbase.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# 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. | ||||
# | # | ||||
# Test spending coinbase transactions. | # Test spending coinbase transactions. | ||||
# The coinbase transaction in block N can appear in block | # The coinbase transaction in block N can appear in block | ||||
# N+100... so is valid in the mempool when the best block | # N+100... so is valid in the mempool when the best block | ||||
# height is N+99. | # height is N+99. | ||||
# This test makes sure coinbase spends that will be mature | # This test makes sure coinbase spends that will be mature | ||||
# in the next block are accepted into the memory pool, | # in the next block are accepted into the memory pool, | ||||
# but less mature coinbase spends are NOT. | # but less mature coinbase spends are NOT. | ||||
# | # | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import * | from test_framework.util import assert_equal, assert_raises_rpc_error, create_tx | ||||
# Create one-input, one-output, no-fee transaction: | # Create one-input, one-output, no-fee transaction: | ||||
class MempoolSpendCoinbaseTest(BitcoinTestFramework): | class MempoolSpendCoinbaseTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.extra_args = [["-checkmempool"]] | self.extra_args = [["-checkmempool"]] | ||||
Show All 33 Lines |