import sys import logging import time import dateutil.parser import calendar import traceback import binascii import socket import signal import appdirs import platform from urllib.parse import quote_plus as urlencode from counterpartylib.lib import log logger = logging.getLogger(__name__) log.set_logger(logger) # set root logger from counterpartylib.lib import api, config, util, exceptions, blocks, check, backend, database, transaction, script D = decimal.Decimal class ConfigurationError(Exception): pass def sigterm_handler(_signo, _stack_frame): if _signo == 15: signal_name = 'SIGTERM' elif _signo == 2: signal_name = 'SIGINT'
""" Test suite configuration """ import json import apsw import time from datetime import datetime import pytest import bitcoin as bitcoinlib import logging from counterpartylib.lib import log log.set_logger(logging.getLogger()) from counterpartylib.test import util_test from counterpartylib.test.fixtures.vectors import UNITTEST_VECTOR from counterpartylib.test.fixtures.params import DEFAULT_PARAMS from counterpartylib.test.fixtures.scenarios import INTEGRATION_SCENARIOS from counterpartylib.lib import config, util, database, api # we swap out util.enabled with a custom one which has the option to mock the protocol changes MOCK_PROTOCOL_CHANGES = { 'bytespersigop': False # default to False to avoid all old vectors breaking } MOCK_PROTOCOL_CHANGES_AT_BLOCK = { 'subassets': {'block_index': 310495, 'enabled': True}, # override to be true only after block 310495 } ENABLE_MOCK_PROTOCOL_CHANGES_AT_BLOCK = False
#! /usr/bin/env python3 import os import sys import argparse import logging logger = logging.getLogger() from counterpartylib.lib import log log.set_logger(logger) from counterpartylib import server from counterpartylib.lib import config from counterpartycli.util import add_config_arguments, bootstrap from counterpartycli.setup import generate_config_files from counterpartycli import APP_VERSION APP_NAME = 'counterparty-server' CONFIG_ARGS = [ [('-v', '--verbose'), { 'dest': 'verbose', 'action': 'store_true', 'default': False, 'help': 'sets log level to DEBUG instead of WARNING' }], [('--testnet', ), { 'action': 'store_true', 'default': False,
""" Test suite configuration """ import json import apsw import time from datetime import datetime import pytest import bitcoin as bitcoinlib import logging from counterpartylib.lib import log log.set_logger(logging.getLogger()) from counterpartylib.test import util_test from counterpartylib.test.fixtures.vectors import UNITTEST_VECTOR from counterpartylib.test.fixtures.params import DEFAULT_PARAMS from counterpartylib.test.fixtures.scenarios import INTEGRATION_SCENARIOS from counterpartylib.lib import config, util, database, api # we swap out util.enabled with a custom one which has the option to mock the protocol changes MOCK_PROTOCOL_CHANGES = { 'bytespersigop': False # default to False to avoid all old vectors breaking } ALWAYS_LATEST_PROTOCOL_CHANGES = False _enabled = util.enabled def enabled(change_name, block_index=None): if change_name in MOCK_PROTOCOL_CHANGES:
import os from datetime import datetime import pytest import bitcoin as bitcoinlib import pycoin from pycoin.tx import Tx import pprint import binascii import logging from Crypto.Cipher import ARC4 logger = logging.getLogger() from counterpartylib.lib import log from counterpartylib import server log.set_logger(logger) from counterpartylib.test import util_test from counterpartylib.test.fixtures.vectors import UNITTEST_VECTOR from counterpartylib.test.fixtures.params import DEFAULT_PARAMS from counterpartylib.test.fixtures.scenarios import INTEGRATION_SCENARIOS from counterpartylib.lib import config, util, database, api, script, arc4 # used to increment RPC port between test modules to avoid conflicts TEST_RPC_PORT = 9999 # we swap out util.enabled with a custom one which has the option to mock the protocol changes MOCK_PROTOCOL_CHANGES = { 'bytespersigop': False, # default to False to avoid all old vectors breaking }