squeaknode/tests/node/test_squeak_controller.py
Jonathan Zernik 00fc72514f
Use squeaklib with ptlc (#502)
* Rename secret_key

* More work to convert to using PTLC

* Updated most code for PTLC

* More work to use ptlc with secret key

* Got itest passing

* Remove unused import

* Use version 0.5.0 of squeaklib

* Added simple unit test for squeak controller

* Use modular addition subtraction for secret key nonce tweak

* Move util to core folder

* Store secret key as hex in database

* Store nonce as hex in db
2020-12-25 20:17:54 -08:00

61 lines
1.3 KiB
Python

import pytest
from squeaknode.node.squeak_controller import SqueakController
from squeaknode.bitcoin.blockchain_client import BlockchainClient
from squeaknode.core.lightning_address import LightningAddressHostPort
from squeaknode.db.squeak_db import SqueakDb
@pytest.fixture
def squeak_db():
# return SqueakDb(None, None, None)
return Mock(spec=SqueakDb)
@pytest.fixture
def blockchain_client():
return Mock(spec=BlockchainClient)
@pytest.fixture
def lightning_client():
return Mock()
@pytest.fixture
def lightning_host_port():
return LightningAddressHostPort(
host="my_lightning_host",
port=8765
)
@pytest.fixture
def price_msat():
return 777
@pytest.fixture
def max_squeaks_per_address_per_hour():
return 5000
@pytest.fixture
def squeak_controller(squeak_db, blockchain_client, lightning_client, lightning_host_port, price_msat, max_squeaks_per_address_per_hour):
return SqueakController(
squeak_db,
blockchain_client,
lightning_client,
lightning_host_port,
price_msat,
max_squeaks_per_address_per_hour,
)
class SqueakControllerTest:
def test_nothing():
assert True
def test_get_buy_offer(squeak_controller):
assert squeak_controller.get_buy_offer is not None