itest: fix RPC middleware itest

This commit is contained in:
Oliver Gugger 2022-01-05 12:57:17 +01:00 committed by yyforyongyu
parent 587273174e
commit 10d876ae98
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868
2 changed files with 6 additions and 5 deletions

View File

@ -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),

View File

@ -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)