mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
looprpc: map custom channel reason
Static autoloop testing surfaced a SuggestSwaps failure when the planner disqualified a custom asset channel. Add the missing AutoReason enum value and handle ReasonCustomChannelData.
This commit is contained in:
parent
58ebb042ff
commit
8ea9adbd35
6 changed files with 33 additions and 4 deletions
|
|
@ -2442,6 +2442,9 @@ func rpcAutoloopReason(reason liquidity.Reason) (looprpc.AutoReason, error) {
|
|||
return looprpc.AutoReason_AUTO_REASON_STATIC_LOOP_IN_NO_CANDIDATE,
|
||||
nil
|
||||
|
||||
case liquidity.ReasonCustomChannelData:
|
||||
return looprpc.AutoReason_AUTO_REASON_CUSTOM_CHANNEL_DATA, nil
|
||||
|
||||
default:
|
||||
return 0, fmt.Errorf("unknown autoloop reason: %v", reason)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,6 +295,16 @@ func TestRPCAutoloopReasonStaticLoopInNoCandidate(t *testing.T) {
|
|||
)
|
||||
}
|
||||
|
||||
// TestRPCAutoloopReasonCustomChannelData verifies that custom-channel
|
||||
// disqualifications are exposed over rpc instead of failing the whole dry run.
|
||||
func TestRPCAutoloopReasonCustomChannelData(t *testing.T) {
|
||||
reason, err := rpcAutoloopReason(liquidity.ReasonCustomChannelData)
|
||||
require.NoError(t, err)
|
||||
require.Equal(
|
||||
t, looprpc.AutoReason_AUTO_REASON_CUSTOM_CHANNEL_DATA, reason,
|
||||
)
|
||||
}
|
||||
|
||||
// TestSwapClientServerStopDaemon ensures that calling StopDaemon triggers the
|
||||
// daemon shutdown.
|
||||
func TestSwapClientServerStopDaemon(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue