Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,984 changes: 1,068 additions & 916 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
black = "^23.12.1"
python = ">=3.9.2,<4.0"
black = "^24.3"
flake8 = "^7.0.0"
isort = "^5.13.2"
pre-commit = "^3.6.0"
pyln-testing = "^24.8.2"
pytest = "^7.1.2"
pyln-testing = "^25.12"
pyln-client = "^25.12"
pyln-proto = "^25.12"
pytest = ">=7.4,<9"
pytest-timeout = "^2.1.0"
pytest-xdist = "^3.6"

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ def ln_node(node_factory): # noqa: F811
"smaug_brpc_user": BITCOIND_CONFIG["rpcuser"],
"smaug_brpc_pass": BITCOIND_CONFIG["rpcpassword"],
"smaug_brpc_port": BITCOIND_CONFIG["rpcport"],
"log-level": ["trace", "info:plugin-bookkeeper"],
},
)[0]
4 changes: 2 additions & 2 deletions tests/test_bkpr_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def generate():
# this subtracts 1M sat (+141 sats for fee) from our bitcoind wallet
# this will generate 3 more bkpr events for our smaug wallet:
# 1 utxo_spend for our input and 2 utxo_deposits for the outputs
cln_addr = ln_node.rpc.newaddr()["bech32"]
cln_addr = ln_node.rpc.newaddr(addresstype="bech32")["bech32"]
bitcoind.rpc.sendtoaddress(cln_addr, sats_to_btc(CLN_INITIAL_AMOUNT_SAT))
generate()
# now we should have 100_000_000 - 10_000_141 sats
Expand Down Expand Up @@ -127,7 +127,7 @@ def generate():
# then grab CLN's 10_000_000 sat output
cln_utxo = only_one(ln_node.rpc.listfunds()["outputs"])
assert cln_utxo["amount_msat"] == CLN_INITIAL_AMOUNT_MSAT
cln_addr = ln_node.rpc.newaddr()["bech32"]
cln_addr = ln_node.rpc.newaddr(addresstype="bech32")["bech32"]
btc_addr = bitcoind.rpc.getnewaddress()

# total inputs = 10_000_000 + 89_999_859 = 99_999_859
Expand Down
14 changes: 5 additions & 9 deletions tests/test_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def test_rpc_add(bitcoind, ln_node):
wallet_name = wallet["name"]

asserted = {
"message": f"Wallet with deterministic name {wallet_name} "
"successfully added",
"message": f"Wallet with deterministic name {wallet_name} successfully added", # noqa: E501
"name": wallet_name,
}

Expand Down Expand Up @@ -186,14 +185,11 @@ def test_rpc_remove_failed(bitcoind, ln_node):
assert os.path.isfile(db_file_path)

# Try removing nonexistent wallet from smaug
with pytest.raises(RpcError) as e:
with pytest.raises(
RpcError,
match=r'RPC call failed: method: smaug, payload: \(\'remove\', \'NONEXISTENT_WALLET\'\), error: \{\'code\': -32700, \'data\': None, \'message\': "Can\'t find wallet \'NONEXISTENT_WALLET\'."\}', # noqa: E501
):
ln_node.rpc.smaug("remove", "NONEXISTENT_WALLET")
assert (
"RPC call failed: method: smaug, payload: ('remove', "
"'NONEXISTENT_WALLET'), error: {'code': -32700, 'data': None, \
'message': \"Can't find wallet 'NONEXISTENT_WALLET'.\"}"
in str(e.value)
)

smaug_wallets = ln_node.rpc.smaug("ls")
assert len(smaug_wallets) == 1
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def btc_to_sats(btc):


def get_bitcoind_wallet_bal_sats(bitcoind):
wi_res = bitcoind.rpc.getwalletinfo()
return int(btc_to_sats(wi_res["balance"] + wi_res["immature_balance"]))
wi_res = bitcoind.rpc.getbalances()["mine"]
return int(btc_to_sats(wi_res["trusted"] + wi_res["immature"]))


def get_bkpr_smaug_balance(name, bkpr_balances):
Expand Down