Changeset View
Changeset View
Standalone View
Standalone View
test/functional/interface_rest.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2014-2019 The Bitcoin Core developers | # Copyright (c) 2014-2019 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Test the REST API.""" | """Test the REST API.""" | ||||
import binascii | import binascii | ||||
import http.client | |||||
import json | |||||
import urllib.parse | |||||
from decimal import Decimal | from decimal import Decimal | ||||
from enum import Enum | from enum import Enum | ||||
import http.client | |||||
from io import BytesIO | from io import BytesIO | ||||
import json | |||||
from struct import pack, unpack | from struct import pack, unpack | ||||
import urllib.parse | |||||
from test_framework.messages import BLOCK_HEADER_SIZE | |||||
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, | ||||
hex_str_to_bytes, | hex_str_to_bytes, | ||||
) | ) | ||||
from test_framework.messages import BLOCK_HEADER_SIZE | |||||
class ReqType(Enum): | class ReqType(Enum): | ||||
JSON = 1 | JSON = 1 | ||||
BIN = 2 | BIN = 2 | ||||
HEX = 3 | HEX = 3 | ||||
class RetType(Enum): | class RetType(Enum): | ||||
▲ Show 20 Lines • Show All 374 Lines • Show Last 20 Lines |