From 720d98cc1521e1a02349dc7b5262b833b01dfb19 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 4 Mar 2025 18:18:02 -0800 Subject: [PATCH] msgmux: fix arg expectation for mock in unit test --- log.go | 2 ++ msgmux/msg_router.go | 2 +- msgmux/msg_router_test.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/log.go b/log.go index e4c1d2ebe..5d1f2567f 100644 --- a/log.go +++ b/log.go @@ -44,6 +44,7 @@ import ( "github.com/lightningnetwork/lnd/lnwallet/chanfunding" "github.com/lightningnetwork/lnd/lnwallet/rpcwallet" "github.com/lightningnetwork/lnd/monitoring" + "github.com/lightningnetwork/lnd/msgmux" "github.com/lightningnetwork/lnd/netann" "github.com/lightningnetwork/lnd/peer" "github.com/lightningnetwork/lnd/peernotifier" @@ -202,6 +203,7 @@ func SetupLoggers(root *build.SubLoggerManager, interceptor signal.Interceptor) ) AddV1SubLogger(root, graphdb.Subsystem, interceptor, graphdb.UseLogger) AddSubLogger(root, chainio.Subsystem, interceptor, chainio.UseLogger) + AddSubLogger(root, msgmux.Subsystem, interceptor, msgmux.UseLogger) } // AddSubLogger is a helper method to conveniently create and register the diff --git a/msgmux/msg_router.go b/msgmux/msg_router.go index 9aac3bc64..823fed668 100644 --- a/msgmux/msg_router.go +++ b/msgmux/msg_router.go @@ -244,7 +244,7 @@ func (p *MultiMsgRouter) msgRouter(ctx context.Context) { var err error if !couldSend { log.Tracef("MsgRouter: unable to route "+ - "msg %T", msg) + "msg %T", msg.Message) err = ErrUnableToRouteMsg } diff --git a/msgmux/msg_router_test.go b/msgmux/msg_router_test.go index d6262a7ab..8ecad778e 100644 --- a/msgmux/msg_router_test.go +++ b/msgmux/msg_router_test.go @@ -26,7 +26,7 @@ func (m *mockEndpoint) CanHandle(msg PeerMsg) bool { } func (m *mockEndpoint) SendMessage(ctx context.Context, msg PeerMsg) bool { - args := m.Called(msg) + args := m.Called(ctx, msg) return args.Bool(0) }