From 10d876ae9853ede61fb34fcca37c303ca9c8dcda Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 5 Jan 2022 12:57:17 +0100 Subject: [PATCH] itest: fix RPC middleware itest --- lntest/harness_node.go | 10 +++++----- lntest/itest/lnd_rpc_middleware_interceptor_test.go | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lntest/harness_node.go b/lntest/harness_node.go index 0ee4ef6f7..add14a85c 100644 --- a/lntest/harness_node.go +++ b/lntest/harness_node.go @@ -655,7 +655,7 @@ func (hn *HarnessNode) start(lndBinary string, lndError chan<- error, } // Init all the RPC clients. - hn.initRPCClients(conn) + hn.InitRPCClients(conn) if err := hn.WaitUntilStarted(); err != nil { return err @@ -717,7 +717,7 @@ func (hn *HarnessNode) WaitUntilLeader(timeout time.Duration) error { } // Init all the RPC clients. - hn.initRPCClients(conn) + hn.InitRPCClients(conn) if err := hn.WaitUntilStarted(); err != nil { return err @@ -772,7 +772,7 @@ func (hn *HarnessNode) initClientWhenReady(stateless bool, } // Init all the RPC clients. - hn.initRPCClients(conn) + hn.InitRPCClients(conn) return hn.initLightningClient() } @@ -897,8 +897,8 @@ func (hn *HarnessNode) waitTillServerState( } } -// initRPCClients initializes a list of RPC clients for the node. -func (hn *HarnessNode) initRPCClients(c *grpc.ClientConn) { +// InitRPCClients initializes a list of RPC clients for the node. +func (hn *HarnessNode) InitRPCClients(c *grpc.ClientConn) { hn.rpc = &RPCClients{ conn: c, LN: lnrpc.NewLightningClient(c), diff --git a/lntest/itest/lnd_rpc_middleware_interceptor_test.go b/lntest/itest/lnd_rpc_middleware_interceptor_test.go index 0ada62954..48be71fca 100644 --- a/lntest/itest/lnd_rpc_middleware_interceptor_test.go +++ b/lntest/itest/lnd_rpc_middleware_interceptor_test.go @@ -403,6 +403,7 @@ func middlewareMandatoryTest(t *testing.T, node *lntest.HarnessNode, // test case. So we need to do the wait and client setup manually here. conn, err := node.ConnectRPC(true) require.NoError(t, err) + node.InitRPCClients(conn) err = node.WaitUntilStateReached(lnrpc.WalletState_RPC_ACTIVE) require.NoError(t, err) node.LightningClient = lnrpc.NewLightningClient(conn)