mirror of
https://github.com/ZmnSCPxj/clboss.git
synced 2026-08-15 12:50:42 +02:00
New test binary covering Boss::Mod::AskreneLayer's three free
functions and the silent-RpcError-swallow contract. Same
MockRpcServer pattern used by test_invoicepayer_decodepay (a
socketpair'd unix socket with a non-blocking server end that
reads requests, asserts their JSON shape, and writes back
results or RPC errors).
Cases:
1. inform_channel_constrained: assert method is
"askrene-inform-channel", layer matches, the
scid+direction is encoded as "100x1x0/1" in
short_channel_id_dir, amount_msat is correct, and inform
is "constrained".
2. inform_channel_succeeded: same shape but inform is
"succeeded". Anticipating the open-question commit where
ActiveProber feeds positive lower-bound observations on
probed channels.
3. disable_node: method is "askrene-disable-node", layer and
node fields are present and correct.
4. Silent RpcError swallow: server replies with a JSON-RPC
error response. The helper's Ev::Io<void> must still
complete cleanly without propagating the exception --
verified by checking that the next .then() in the main
chain fires. This is the "degraded learning, not crashed
plugin" contract documented in AskreneLayer.cpp.
Test-execution-pattern note: the test pattern follows
test_rpc.cpp (server task as Ev::concurrent, helper as the
main chain, Boss::Shutdown raised after all tests complete to
let the event loop terminate cleanly) rather than the
flag-polling pattern from test_invoicepayer_decodepay. Both
work; the test_rpc style is shorter and matches the natural
flow of "make N RPC calls, server replies to each, exit when
done."
Registered in Makefile.am alphabetically among the
tests/boss/* entries.
|
||
|---|---|---|
| .. | ||
| bitcoin | ||
| boltz | ||
| boss | ||
| dnsseed | ||
| ev | ||
| graph | ||
| jsmn | ||
| json | ||
| ln | ||
| net | ||
| ripemd160 | ||
| s | ||
| sha256 | ||
| sqlite3 | ||
| stats | ||
| util | ||
| test_uuid.cpp | ||