@@ -0,0 +1,2863 @@
+#!/usr/bin/env python3%0A# Copyright (c) 2020 The Bitcoin developers%0A# Distributed under the MIT software license, see the accompanying%0A# file COPYING or http://www.opensource.org/licenses/mit-license.php.%0A%22%22%22%0ATests for Bitcoin ABC mining RPCs%0A%22%22%22%0A%0Afrom test_framework.messages import (%0A    COIN,%0A)%0Afrom test_framework.test_framework import BitcoinTestFramework%0Afrom test_framework.util import (%0A    assert_equal,%0A    assert_greater_than_or_equal,%0A)%0A%0Afrom decimal import Decimal%0A%0AAXION_ACTIVATION_TIME = 2000000600%0A%0A%0Aclass AbcMiningRPCTest(BitcoinTestFramework):%0A    def set_test_params(self):%0A        self.num_nodes = 2%0A        self.extra_args = %5B%5B%0A            '-enableminerfund',%0A            '-axionactivationtime=%7B%7D'.format(AXION_ACTIVATION_TIME),%0A        %5D, %5B%5D%5D%0A%0A    def run_test(self):%0A        node = self.nodes%5B0%5D%0A        address = node.get_deterministic_priv_key().address%0A%0A        # Move MTP forward to axion activation%0A        node.setmocktime(AXION_ACTIVATION_TIME)%0A        node.generatetoaddress(6, address)%0A        assert_equal(%0A            node.getblockchaininfo()%5B'mediantime'%5D,%0A            AXION_ACTIVATION_TIME)%0A%0A        # Assert the results of getblocktemplate have expected values. Keys not%0A        # in 'expected' are not checked.%0A        def assert_getblocktemplate(expected):%0A            blockTemplate = node.getblocktemplate()%0A            for key, value in expected.items():%0A                assert_equal(blockTemplate%5Bkey%5D, value)%0A%0A        def get_best_coinbase():%0A            return node.getblock(node.getbestblockhash(), 2)%5B'tx'%5D%5B0%5D%0A%0A        coinbase = get_best_coinbase()%0A        assert_equal(len(coinbase%5B'vout'%5D), 1)%0A        block_reward = coinbase%5B'vout'%5D%5B0%5D%5B'value'%5D%0A%0A        # We don't need to test all fields in getblocktemplate since many of%0A        # them are covered in mining_basic.py%0A        assert_equal(node.getmempoolinfo()%5B'size'%5D, 0)%0A        assert_getblocktemplate(%7B%0A            # Although the coinbase value need not necessarily be the same as%0A            # the last block due to halvings and fees, we know this to be true%0A            # since we are not crossing a halving boundary and there are no%0A            # transactions in the mempool.%0A            'coinbasevalue': block_reward * COIN,%0A        %7D)%0A%0A        # First block with the new rules%0A        node.generatetoaddress(1, address)%0A%0A        # We expect the coinbase to have multiple outputs now%0A        coinbase = get_best_coinbase()%0A        assert_greater_than_or_equal(len(coinbase%5B'vout'%5D), 2)%0A        total = Decimal()%0A        for o in coinbase%5B'vout'%5D:%0A            total += o%5B'value'%5D%0A%0A        assert_equal(total, block_reward)%0A        assert_getblocktemplate(%7B%0A            # Again, we assume the coinbase value is the same as prior blocks.%0A            'coinbasevalue': block_reward * COIN,%0A        %7D)%0A%0A%0Aif __name__ == '__main__':%0A    AbcMiningRPCTest().main()%0A

Add a test for ABC-specific getblocktemplate behavior