diff options
author | John Newbery <john@johnnewbery.com> | 2019-05-20 14:58:09 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2019-08-13 15:53:02 -0400 |
commit | 3862e473f0cb71a762c0306b171b591341d58142 (patch) | |
tree | d7c981c6fc7292b289bce4fd22eb6f1c5c1a463c /test/functional | |
parent | 3a3d8b83571205b8329d4ee25537e3cc4397c3b8 (diff) | |
download | bitcoin-3862e473f0cb71a762c0306b171b591341d58142.tar.xz |
[rpc] Tidy up reporting of buried and ongoing softforks
This combines reporting of buried (formally ISM) softfork deployments
and BIP9 versionbits softfork deployments into one JSON object in the
getblockchaininfo return object.
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/feature_cltv.py | 17 | ||||
-rwxr-xr-x | test/functional/feature_dersig.py | 17 | ||||
-rwxr-xr-x | test/functional/rpc_blockchain.py | 1 | ||||
-rw-r--r-- | test/functional/test_framework/util.py | 2 |
4 files changed, 15 insertions, 22 deletions
diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py index af34f9f0db..e00219ca4a 100755 --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -69,14 +69,11 @@ class BIP65Test(BitcoinTestFramework): self.skip_if_no_wallet() def test_cltv_info(self, *, is_active): - assert_equal( - next(s for s in self.nodes[0].getblockchaininfo()['softforks'] if s['id'] == 'bip65'), + assert_equal(self.nodes[0].getblockchaininfo()['softforks']['bip65'], { - "id": "bip65", - "version": 4, - "reject": { - "status": is_active - } + "active": is_active, + "height": CLTV_HEIGHT, + "type": "buried", }, ) @@ -104,9 +101,9 @@ class BIP65Test(BitcoinTestFramework): block.hashMerkleRoot = block.calc_merkle_root() block.solve() - self.test_cltv_info(is_active=False) + self.test_cltv_info(is_active=False) # Not active as of current tip and next block does not need to obey rules self.nodes[0].p2p.send_and_ping(msg_block(block)) - self.test_cltv_info(is_active=False) # Not active as of current tip, but next block must obey rules + self.test_cltv_info(is_active=True) # Not active as of current tip, but next block must obey rules assert_equal(self.nodes[0].getbestblockhash(), block.hash) self.log.info("Test that blocks must now be at least version 4") @@ -155,7 +152,7 @@ class BIP65Test(BitcoinTestFramework): block.hashMerkleRoot = block.calc_merkle_root() block.solve() - self.test_cltv_info(is_active=False) # Not active as of current tip, but next block must obey rules + self.test_cltv_info(is_active=True) # Not active as of current tip, but next block must obey rules self.nodes[0].p2p.send_and_ping(msg_block(block)) self.test_cltv_info(is_active=True) # Active as of current tip assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.sha256) diff --git a/test/functional/feature_dersig.py b/test/functional/feature_dersig.py index 067e3be1f4..1bd9586364 100755 --- a/test/functional/feature_dersig.py +++ b/test/functional/feature_dersig.py @@ -52,14 +52,11 @@ class BIP66Test(BitcoinTestFramework): self.skip_if_no_wallet() def test_dersig_info(self, *, is_active): - assert_equal( - next(s for s in self.nodes[0].getblockchaininfo()['softforks'] if s['id'] == 'bip66'), + assert_equal(self.nodes[0].getblockchaininfo()['softforks']['bip66'], { - "id": "bip66", - "version": 3, - "reject": { - "status": is_active - } + "active": is_active, + "height": DERSIG_HEIGHT, + "type": "buried", }, ) @@ -88,9 +85,9 @@ class BIP66Test(BitcoinTestFramework): block.rehash() block.solve() - self.test_dersig_info(is_active=False) + self.test_dersig_info(is_active=False) # Not active as of current tip and next block does not need to obey rules self.nodes[0].p2p.send_and_ping(msg_block(block)) - self.test_dersig_info(is_active=False) # Not active as of current tip, but next block must obey rules + self.test_dersig_info(is_active=True) # Not active as of current tip, but next block must obey rules assert_equal(self.nodes[0].getbestblockhash(), block.hash) self.log.info("Test that blocks must now be at least version 3") @@ -144,7 +141,7 @@ class BIP66Test(BitcoinTestFramework): block.rehash() block.solve() - self.test_dersig_info(is_active=False) # Not active as of current tip, but next block must obey rules + self.test_dersig_info(is_active=True) # Not active as of current tip, but next block must obey rules self.nodes[0].p2p.send_and_ping(msg_block(block)) self.test_dersig_info(is_active=True) # Active as of current tip assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.sha256) diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index facb05b54c..a3063f4781 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -78,7 +78,6 @@ class BlockchainTest(BitcoinTestFramework): keys = [ 'bestblockhash', - 'bip9_softforks', 'blocks', 'chain', 'chainwork', diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index efd962ea93..c25698fe89 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -344,7 +344,7 @@ def delete_cookie_file(datadir): def get_bip9_status(node, key): info = node.getblockchaininfo() - return info['bip9_softforks'][key] + return info['softforks'][key]['bip9'] def set_node_times(nodes, t): for node in nodes: |