mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-02 05:04:23 +01:00
Fixes bitcoin_cli
bitcoin_cli as a global variable in the main __init__.py was creating issues related to http.client.CannotSendRequest: Request-sent and connection re-usage. Define a new connection per request.
This commit is contained in:
@@ -3,7 +3,7 @@ from time import sleep
|
||||
from threading import Thread
|
||||
|
||||
from pisa.api import start_api
|
||||
from test.simulator.bitcoind_sim import run_simulator
|
||||
from test2.simulator.bitcoind_sim import run_simulator
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
|
||||
@@ -9,7 +9,7 @@ from binascii import unhexlify
|
||||
from apps.cli.blob import Blob
|
||||
from pisa import HOST, PORT, logging
|
||||
from pisa.utils.auth_proxy import AuthServiceProxy
|
||||
from test.simulator.bitcoind_sim import TIME_BETWEEN_BLOCKS
|
||||
from test2.simulator.bitcoind_sim import TIME_BETWEEN_BLOCKS, create_dummy_transaction
|
||||
from pisa.conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT, MAX_APPOINTMENTS
|
||||
|
||||
logging.getLogger().disabled = True
|
||||
@@ -25,7 +25,7 @@ def generate_dummy_appointment(dispute_txid):
|
||||
|
||||
current_height = r.json().get("block_count")
|
||||
|
||||
dummy_appointment_data = {"tx": os.urandom(32).hex(), "tx_id": dispute_txid, "start_time": current_height + 5,
|
||||
dummy_appointment_data = {"tx": create_dummy_transaction(), "tx_id": dispute_txid, "start_time": current_height + 5,
|
||||
"end_time": current_height + 30, "dispute_delta": 20}
|
||||
|
||||
cipher = "AES-GCM-128"
|
||||
|
||||
@@ -5,7 +5,7 @@ from time import sleep
|
||||
|
||||
from pisa.carrier import Carrier
|
||||
from pisa.rpc_errors import RPC_VERIFY_ALREADY_IN_CHAIN, RPC_DESERIALIZATION_ERROR
|
||||
from test.simulator.bitcoind_sim import TIME_BETWEEN_BLOCKS
|
||||
from test2.simulator.bitcoind_sim import TIME_BETWEEN_BLOCKS
|
||||
|
||||
logging.getLogger().disabled = True
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from pisa.conf import MAX_APPOINTMENTS
|
||||
from pisa.appointment import Appointment
|
||||
from pisa.tools import check_txid_format
|
||||
from pisa.utils.auth_proxy import AuthServiceProxy
|
||||
from test.simulator.bitcoind_sim import TIME_BETWEEN_BLOCKS
|
||||
from test2.simulator.bitcoind_sim import TIME_BETWEEN_BLOCKS
|
||||
from pisa.conf import EXPIRY_DELTA, BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT
|
||||
|
||||
logging.getLogger().disabled = True
|
||||
|
||||
Reference in New Issue
Block a user