Adds pisa conf for e2e testing and initial setup for the regtest node

This commit is contained in:
Sergi Delgado Segura
2020-01-20 16:24:33 +01:00
parent 396c56e5db
commit 18cd2a7499
2 changed files with 38 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ def bitcoin_cli():
@pytest.fixture()
def create_txs(bitcoin_cli):
set_up_node(bitcoin_cli)
utxos = bitcoin_cli.listunspent()
if len(utxos) == 0:
@@ -54,6 +55,12 @@ def create_txs(bitcoin_cli):
return signed_commitment_tx.get("hex"), signed_penalty_tx.get("hex")
def set_up_node(bitcoin_cli):
# This method will create a new address a mine bitcoin so the node can be used for testing
new_addr = bitcoin_cli.getnewaddress()
bitcoin_cli.generatetoaddress(101, new_addr)
def build_appointment_data(bitcoin_cli, commitment_tx, penalty_tx):
commitment_tx_id = bitcoin_cli.decoderawtransaction(commitment_tx).get("txid")
current_height = bitcoin_cli.getblockcount()