more fixing of wildcard imports

This commit is contained in:
Aaron Blankstein
2017-08-21 14:12:52 -04:00
parent 11b0908002
commit 6f62c78f67
12 changed files with 53 additions and 18 deletions

View File

@@ -78,6 +78,7 @@ from .namespacereveal import snv_consensus_extras as namespace_reveal_consensus_
from .namespaceready import snv_consensus_extras as namespace_ready_consensus_extras
from .announce import snv_consensus_extras as announce_consensus_extras
from ..constants import (NAME_IMPORT, NAME_PREORDER, OPFIELDS)
from ..config import *
# NOTE: these all have the same signatures

View File

@@ -23,6 +23,9 @@
from utilitybelt import is_hex
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE,
BLOCKSTACK_BURN_ADDRESS)
from ..config import *
from ..scripts import *
from ..logger import get_logger
@@ -32,15 +35,15 @@ log = get_logger("blockstack-client")
def build(message_hash):
"""
Record format:
0 2 3 23
|----|--|-----------------------------|
magic op message hash (160-bit)
"""
if len(message_hash) != 40:
raise Exception("Invalid hash: not 20 bytes")
@@ -50,8 +53,8 @@ def build(message_hash):
readable_script = "ANNOUNCE 0x%s" % (message_hash)
hex_script = blockstack_script_to_hex(readable_script)
packaged_script = add_magic_bytes(hex_script)
return packaged_script
return packaged_script
def make_outputs( data, inputs, change_address, tx_fee, pay_fee=True ):

View File

@@ -27,6 +27,9 @@ from binascii import hexlify, unhexlify
from ..config import *
from ..scripts import *
from ..logger import get_logger
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE,
LENGTH_VALUE_HASH)
import virtualchain
log = get_logger("blockstack-client")

View File

@@ -27,6 +27,10 @@ from ..b40 import is_b40
from ..config import *
from ..scripts import *
from ..logger import get_logger
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE,
BLOCKSTACK_BURN_ADDRESS,
LENGTH_CONSENSUS_HASH)
import virtualchain
log = get_logger("blockstack-client")

View File

@@ -23,6 +23,8 @@
from binascii import hexlify
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE)
from ..b40 import is_b40
from ..config import *
from ..scripts import *

View File

@@ -28,6 +28,9 @@ from ..b40 import is_b40
from ..config import *
from ..scripts import *
from ..logger import get_logger
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE,
BLOCKSTACK_VERSION)
import virtualchain
log = get_logger("blockstack-log")

View File

@@ -25,7 +25,10 @@
from ..b40 import is_b40
from ..config import *
from ..scripts import *
from ..constants import TX_MIN_CONFIRMATIONS
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE,
TX_MIN_CONFIRMATIONS, NAME_SCHEME, BLOCKSTACK_BURN_ADDRESS,
LENGTH_CONSENSUS_HASH)
from ..logger import get_logger
import virtualchain

View File

@@ -23,6 +23,9 @@
from binascii import hexlify
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE,
BLOCKSTACK_BURN_ADDRESS)
from ..config import *
from ..scripts import *
from ..logger import get_logger

View File

@@ -26,6 +26,8 @@ from binascii import hexlify
from ..config import *
from ..scripts import *
from ..logger import get_logger
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE)
import virtualchain
log = get_logger("blockstack-client")

View File

@@ -23,6 +23,11 @@
from binascii import hexlify
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE,
TRANSFER_KEEP_DATA, TRANSFER_REMOVE_DATA,
LENGTH_CONSENSUS_HASH, NAME_TRANSFER, NAME_PREORDER)
from ..b40 import is_b40
from ..config import *
from ..scripts import *

View File

@@ -23,6 +23,10 @@
from utilitybelt import is_hex
from ..constants import (
DEFAULT_DUST_FEE, DEFAULT_OP_RETURN_FEE,
LENGTH_VALUE_HASH,
LENGTH_CONSENSUS_HASH)
from ..b40 import is_b40
from ..config import *
from ..scripts import *

View File

@@ -20,23 +20,19 @@
You should have received a copy of the GNU General Public License
along with Blockstack-client. If not, see <http://www.gnu.org/licenses/>.
"""
import json
import json, re
from binascii import hexlify, unhexlify
from decimal import *
import virtualchain
from binascii import hexlify, unhexlify
from virtualchain.lib.ecdsalib import *
from virtualchain.lib.hashing import *
from virtualchain.lib.hashing import is_hex, hex_hash160, bin_sha256
from virtualchain import tx_extend, tx_sign_input
from .b40 import *
from .b40 import is_b40, b40_to_bin
from .constants import MAGIC_BYTES, NAME_OPCODES, LENGTH_MAX_NAME, LENGTH_MAX_NAMESPACE_ID, TX_MIN_CONFIRMATIONS
from .keys import *
from .utxo import get_unspents
from .utxo import get_unspents
from .logger import get_logger
log = get_logger('blockstack-client')
@@ -61,7 +57,7 @@ def common_checks(n):
if len(n) > LENGTH_MAX_NAME:
# too long
return False
return False
if not is_b40(n):
return False
@@ -116,6 +112,12 @@ def is_valid_hash(value):
return len(strvalue) == 64
def is_valid_int(value):
try:
int(value)
return True
except ValueError:
return False
def blockstack_script_to_hex(script):
""" Parse the readable version of a script, return the hex version.
@@ -176,9 +178,9 @@ def tx_get_address_and_utxos(private_key_info, utxo_client, address=None):
"""
if private_key_info is None:
# just go with the address
# just go with the address
unspents = get_unspents(address, utxo_client)
return addr, unspents
return address, unspents
addr = virtualchain.get_privkey_address(private_key_info)
payer_utxos = get_unspents(addr, utxo_client)