clboss/tests
Ken Sedgwick 2fd756da56
tests/boss/test_askrene_layer: unit tests for the shared helpers
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.
2026-05-22 10:52:11 -07:00
..
bitcoin Bitcoin/addr_to_scriptPubKey.cpp: Make a little more robust, add BIP173 test vectors. 2020-09-24 14:36:02 +08:00
boltz Boltz/Detail/match_lockscript.cpp: Function to check if the BOLTZ instance gave correct redeemscript. 2020-09-21 15:32:25 +08:00
boss tests/boss/test_askrene_layer: unit tests for the shared helpers 2026-05-22 10:52:11 -07:00
dnsseed Add test cases for DNS seed parser crash on SOA records (#309) 2026-03-23 11:06:27 -07:00
ev tests: Cover more paths to try_schedule_cleanup 2026-01-21 11:40:43 -08:00
graph Graph/Dijkstra.hpp: Shortest-path-tree algorithm. 2020-10-02 12:10:52 +08:00
jsmn add Jsmn::Object::operator== 2024-09-25 13:23:04 -05:00
json Json/Out.hpp: JSON output. 2020-09-07 16:03:21 +08:00
ln *: Use Ln::CommandId for command IDs for received commands and hook events. 2022-11-23 00:36:43 +08:00
net Net/IPAddrOrOnion.cpp: Data type that could be either an IP address or onion hidden service. 2020-12-30 23:14:10 +00:00
ripemd160 tests/ripemd160/test_ripemd160.cpp: Check our understanding of endianness is correct. 2020-09-21 15:44:33 +08:00
s Ev/Io.hpp: Avoid copying objects, just move things around. 2020-09-14 09:12:46 +08:00
sha256 Sha256/HasherStream.cpp: std::ostream implementation of hasher. 2020-09-20 13:53:02 +08:00
sqlite3 Sqlite3*: Complete SQLITE3 support. 2020-09-12 15:29:03 +08:00
stats Stats/ReservoirSampler.hpp: Reservoir sampler implementation. 2020-10-01 16:51:59 +08:00
util feat: add clang C++20 build job to CI 2026-03-04 11:24:31 -08:00
test_uuid.cpp Uuid.cpp: Universally-unique identifiers. 2020-09-27 19:16:57 +08:00