mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 01:04:43 +02:00
rpc: add nBits to getmininginfo
Also expands nBits test coverage.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2014-2022 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-present The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test RPCs related to blockchainstate.
|
||||
@@ -30,9 +30,11 @@ import textwrap
|
||||
from test_framework.blocktools import (
|
||||
MAX_FUTURE_BLOCK_TIME,
|
||||
TIME_GENESIS_BLOCK,
|
||||
REGTEST_N_BITS,
|
||||
create_block,
|
||||
create_coinbase,
|
||||
create_tx_with_script,
|
||||
nbits_str,
|
||||
)
|
||||
from test_framework.messages import (
|
||||
CBlockHeader,
|
||||
@@ -412,7 +414,7 @@ class BlockchainTest(BitcoinTestFramework):
|
||||
assert_is_hash_string(header['hash'])
|
||||
assert_is_hash_string(header['previousblockhash'])
|
||||
assert_is_hash_string(header['merkleroot'])
|
||||
assert_is_hash_string(header['bits'], length=None)
|
||||
assert_equal(header['bits'], nbits_str(REGTEST_N_BITS))
|
||||
assert isinstance(header['time'], int)
|
||||
assert_equal(header['mediantime'], TIME_RANGE_MTP)
|
||||
assert isinstance(header['nonce'], int)
|
||||
|
||||
Reference in New Issue
Block a user