Changeset View
Changeset View
Standalone View
Standalone View
test/functional/interface_rest.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2014-2016 The Bitcoin Core developers | # Copyright (c) 2014-2016 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 REST interface | # Test REST interface | ||||
# | # | ||||
from test_framework.test_framework import BitcoinTestFramework | |||||
from test_framework.util import * | |||||
from struct import * | |||||
from io import BytesIO | |||||
from codecs import encode | from codecs import encode | ||||
from decimal import Decimal | |||||
import http.client | import http.client | ||||
from io import BytesIO | |||||
import json | |||||
from struct import pack, unpack | |||||
import urllib.parse | import urllib.parse | ||||
from test_framework.test_framework import BitcoinTestFramework | |||||
from test_framework.util import ( | |||||
assert_equal, | |||||
assert_greater_than, | |||||
connect_nodes_bi, | |||||
hex_str_to_bytes, | |||||
) | |||||
def deser_uint256(f): | def deser_uint256(f): | ||||
r = 0 | r = 0 | ||||
for i in range(8): | for i in range(8): | ||||
t = unpack(b"<I", f.read(4))[0] | t = unpack(b"<I", f.read(4))[0] | ||||
r += t << (i * 32) | r += t << (i * 32) | ||||
return r | return r | ||||
▲ Show 20 Lines • Show All 365 Lines • Show Last 20 Lines |