coin moves: notify when we make deposits to external accounts

The blockheight is zero though, since these aren't included in a block
yet.

We also don't issue an 'external' deposit event if we can tell that the
address you're sending to actually belongs to our wallet (we'll issue a
deposit event when it gets included in a block)
This commit is contained in:
niftynei
2022-01-25 14:24:31 -06:00
committed by Rusty Russell
parent 7f511b9ba9
commit 4dafeede5c
9 changed files with 144 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ from pyln.testing.utils import (
wait_for, TailableProc, env
)
from utils import (
account_balance, scriptpubkey_addr
account_balance, scriptpubkey_addr, check_coin_moves
)
from ephemeral_port_reserve import reserve
from utils import EXPERIMENTAL_FEATURES
@@ -623,6 +623,16 @@ def test_withdraw_misc(node_factory, bitcoind, chainparams):
sync_blockheight(bitcoind, [l1])
assert account_balance(l1, 'wallet') == 0
external_moves = [
{'type': 'chain_mvt', 'credit': 2000000000, 'debit': 0, 'tags': ['deposit']},
{'type': 'chain_mvt', 'credit': 2000000000, 'debit': 0, 'tags': ['deposit']},
{'type': 'chain_mvt', 'credit': 2000000000, 'debit': 0, 'tags': ['deposit']},
{'type': 'chain_mvt', 'credit': 2000000000, 'debit': 0, 'tags': ['deposit']},
{'type': 'chain_mvt', 'credit': 11957603000, 'debit': 0, 'tags': ['deposit']},
]
check_coin_moves(l1, 'external', external_moves, chainparams)
def test_io_logging(node_factory, executor):
l1 = node_factory.get_node(options={'log-level': 'io'})