Changes code to use bitcoin_cli from pisa/tools

This commit is contained in:
Sergi Delgado Segura
2019-11-07 17:36:10 +00:00
parent eb0417858e
commit c384bc78c2
3 changed files with 12 additions and 32 deletions

View File

@@ -3,9 +3,9 @@ import pytest
import requests
from pisa import HOST, PORT, c_logger
from pisa.utils.auth_proxy import AuthServiceProxy
from pisa.tools import bitcoin_cli
from test.unit.conftest import generate_blocks, get_random_value_hex, generate_dummy_appointment_data
from pisa.conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT, MAX_APPOINTMENTS
from pisa.conf import MAX_APPOINTMENTS
c_logger.disabled = True
@@ -117,12 +117,10 @@ def test_get_all_appointments_watcher():
def test_get_all_appointments_responder():
# Trigger all disputes
bitcoin_cli = AuthServiceProxy("http://%s:%s@%s:%d" % (BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT))
locators = [appointment["locator"] for appointment in appointments]
for locator, dispute_tx in locator_dispute_tx_map.items():
if locator in locators:
bitcoin_cli.sendrawtransaction(dispute_tx)
bitcoin_cli().sendrawtransaction(dispute_tx)
# Confirm transactions
generate_blocks(6)