Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_blockchain.py
Show All 13 Lines | Test the following RPCs: | ||||
- getblockheader | - getblockheader | ||||
- getchaintxstats | - getchaintxstats | ||||
- getnetworkhashps | - getnetworkhashps | ||||
- verifychain | - verifychain | ||||
Tests correspond to code in rpc/blockchain.cpp. | Tests correspond to code in rpc/blockchain.cpp. | ||||
""" | """ | ||||
from decimal import Decimal | |||||
import http.client | import http.client | ||||
import subprocess | import subprocess | ||||
from decimal import Decimal | |||||
from test_framework.blocktools import ( | from test_framework.blocktools import ( | ||||
TIME_GENESIS_BLOCK, | |||||
create_block, | create_block, | ||||
create_coinbase, | create_coinbase, | ||||
TIME_GENESIS_BLOCK, | |||||
) | |||||
from test_framework.messages import ( | |||||
msg_block, | |||||
) | ) | ||||
from test_framework.messages import msg_block | |||||
from test_framework.p2p import P2PInterface | from test_framework.p2p import P2PInterface | ||||
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_equal, | ||||
assert_greater_than, | assert_greater_than, | ||||
assert_greater_than_or_equal, | assert_greater_than_or_equal, | ||||
assert_is_hash_string, | |||||
assert_is_hex_string, | |||||
assert_raises, | assert_raises, | ||||
assert_raises_rpc_error, | assert_raises_rpc_error, | ||||
assert_is_hex_string, | |||||
assert_is_hash_string, | |||||
) | ) | ||||
class BlockchainTest(BitcoinTestFramework): | class BlockchainTest(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
▲ Show 20 Lines • Show All 374 Lines • Show Last 20 Lines |