aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/bip9-softforks.py
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2016-04-12 15:44:18 +0930
committerRusty Russell <rusty@rustcorp.com.au>2016-04-13 16:53:52 +0930
commit85c807c9ead3215021503348e75851900dfa08db (patch)
tree6cbfafb99c6ecc71196f79e93b753b17a1701591 /qa/rpc-tests/bip9-softforks.py
parent934f2b5e769368d1a2407d41d53cafd5d51e6b36 (diff)
downloadbitcoin-85c807c9ead3215021503348e75851900dfa08db.tar.xz
getblockchaininfo: make bip9_softforks an object, not an array.
We can't change "softforks", but it seems far more logical to use tags in an object rather than using an "id" field in an array. For example, to get the csv status before, you need to iterate the array to find the entry with 'id' field equal to "csv": jq '.bip9_softforks | map(select(.id == "csv"))[] | .status' Now: jq '.bip9_softforks.csv.status' There is no issue with fork names being incompatible with JSON tags, since we're selecting them ourselves. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'qa/rpc-tests/bip9-softforks.py')
-rwxr-xr-xqa/rpc-tests/bip9-softforks.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/qa/rpc-tests/bip9-softforks.py b/qa/rpc-tests/bip9-softforks.py
index 98975e7193..e63343d352 100755
--- a/qa/rpc-tests/bip9-softforks.py
+++ b/qa/rpc-tests/bip9-softforks.py
@@ -79,11 +79,7 @@ class BIP9SoftForksTest(ComparisonTestFramework):
def get_bip9_status(self, key):
info = self.nodes[0].getblockchaininfo()
- for row in info['bip9_softforks']:
- if row['id'] == key:
- return row
- raise IndexError ('key:"%s" not found' % key)
-
+ return info['bip9_softforks'][key]
def test_BIP(self, bipName, activated_version, invalidate, invalidatePostSignature):
# generate some coins for later