mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 23:21:12 +02:00
itest: fix RPC middleware itest
This commit is contained in:
committed by
yyforyongyu
parent
587273174e
commit
10d876ae98
@@ -655,7 +655,7 @@ func (hn *HarnessNode) start(lndBinary string, lndError chan<- error,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Init all the RPC clients.
|
// Init all the RPC clients.
|
||||||
hn.initRPCClients(conn)
|
hn.InitRPCClients(conn)
|
||||||
|
|
||||||
if err := hn.WaitUntilStarted(); err != nil {
|
if err := hn.WaitUntilStarted(); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -717,7 +717,7 @@ func (hn *HarnessNode) WaitUntilLeader(timeout time.Duration) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Init all the RPC clients.
|
// Init all the RPC clients.
|
||||||
hn.initRPCClients(conn)
|
hn.InitRPCClients(conn)
|
||||||
|
|
||||||
if err := hn.WaitUntilStarted(); err != nil {
|
if err := hn.WaitUntilStarted(); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -772,7 +772,7 @@ func (hn *HarnessNode) initClientWhenReady(stateless bool,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Init all the RPC clients.
|
// Init all the RPC clients.
|
||||||
hn.initRPCClients(conn)
|
hn.InitRPCClients(conn)
|
||||||
|
|
||||||
return hn.initLightningClient()
|
return hn.initLightningClient()
|
||||||
}
|
}
|
||||||
@@ -897,8 +897,8 @@ func (hn *HarnessNode) waitTillServerState(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// initRPCClients initializes a list of RPC clients for the node.
|
// InitRPCClients initializes a list of RPC clients for the node.
|
||||||
func (hn *HarnessNode) initRPCClients(c *grpc.ClientConn) {
|
func (hn *HarnessNode) InitRPCClients(c *grpc.ClientConn) {
|
||||||
hn.rpc = &RPCClients{
|
hn.rpc = &RPCClients{
|
||||||
conn: c,
|
conn: c,
|
||||||
LN: lnrpc.NewLightningClient(c),
|
LN: lnrpc.NewLightningClient(c),
|
||||||
|
@@ -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.
|
// test case. So we need to do the wait and client setup manually here.
|
||||||
conn, err := node.ConnectRPC(true)
|
conn, err := node.ConnectRPC(true)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
node.InitRPCClients(conn)
|
||||||
err = node.WaitUntilStateReached(lnrpc.WalletState_RPC_ACTIVE)
|
err = node.WaitUntilStateReached(lnrpc.WalletState_RPC_ACTIVE)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
node.LightningClient = lnrpc.NewLightningClient(conn)
|
node.LightningClient = lnrpc.NewLightningClient(conn)
|
||||||
|
Reference in New Issue
Block a user