Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/script.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2016 The Bitcoin Core developers | # Copyright (c) 2015-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. | ||||
"""Functionality to build scripts, as well as SignatureHash(). | """Functionality to build scripts, as well as SignatureHash(). | ||||
This file is modified from python-bitcoinlib. | This file is modified from python-bitcoinlib. | ||||
""" | """ | ||||
from .mininode import CTransaction, CTxOut, sha256, hash256, uint256_from_str, ser_uint256, ser_string | |||||
from .bignum import bn2vch | from .bignum import bn2vch | ||||
from binascii import hexlify | from binascii import hexlify | ||||
import hashlib | import hashlib | ||||
import struct | import struct | ||||
import sys | import sys | ||||
from .messages import ( | |||||
CTransaction, | |||||
CTxOut, | |||||
hash256, | |||||
ser_string, | |||||
ser_uint256, | |||||
sha256, | |||||
uint256_from_str, | |||||
) | |||||
bchr = chr | bchr = chr | ||||
bord = ord | bord = ord | ||||
if sys.version > '3': | if sys.version > '3': | ||||
long = int | long = int | ||||
def bchr(x): return bytes([x]) | def bchr(x): return bytes([x]) | ||||
def bord(x): return x | def bord(x): return x | ||||
▲ Show 20 Lines • Show All 701 Lines • Show Last 20 Lines |