mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-01 12:44:25 +01:00
Adds pisa conf for e2e testing and initial setup for the regtest node
This commit is contained in:
@@ -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()
|
||||
|
||||
31
test/pisa/e2e/pisa-conf.py
Normal file
31
test/pisa/e2e/pisa-conf.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# bitcoind
|
||||
BTC_RPC_USER = "user"
|
||||
BTC_RPC_PASSWD = "passwd"
|
||||
BTC_RPC_HOST = "localhost"
|
||||
BTC_RPC_PORT = 18445
|
||||
BTC_NETWORK = "regtest"
|
||||
|
||||
# CHAIN MONITOR
|
||||
POLLING_DELTA = 60
|
||||
BLOCK_WINDOW_SIZE = 10
|
||||
|
||||
# ZMQ
|
||||
FEED_PROTOCOL = "tcp"
|
||||
FEED_ADDR = "127.0.0.1"
|
||||
FEED_PORT = 28335
|
||||
|
||||
# PISA
|
||||
MAX_APPOINTMENTS = 100
|
||||
EXPIRY_DELTA = 6
|
||||
MIN_TO_SELF_DELAY = 20
|
||||
SERVER_LOG_FILE = "pisa.log"
|
||||
PISA_SECRET_KEY = "pisa_sk.der"
|
||||
|
||||
# PISA-CLI
|
||||
CLIENT_LOG_FILE = "pisa.log"
|
||||
|
||||
# TEST
|
||||
TEST_LOG_FILE = "test.log"
|
||||
|
||||
# LEVELDB
|
||||
DB_PATH = "appointments"
|
||||
Reference in New Issue
Block a user