lntemp+itest: refactor testStatelessInit

This commit is contained in:
yyforyongyu committed 2023-01-17 07:26:57 +08:00
1 parent 4b469eb0c5
commit 8a4d2741a3
6 files changed
+71 -60

No files matched your search

+13
View File
@@ -488,6 +488,19 @@ func (hn *HarnessNode) InitNode(macBytes []byte) error {
return hn.initLightningClient()
}
// InitChangePassword initializes a harness node by passing the change password
// request via RPC. After the request is submitted, this method will block until
// a macaroon-authenticated RPC connection can be established to the harness
// node. Once established, the new connection is used to initialize the
// RPC clients and subscribes the HarnessNode to topology changes.
func (hn *HarnessNode) ChangePasswordAndInit(
req *lnrpc.ChangePasswordRequest) (
*lnrpc.ChangePasswordResponse, error) {
response := hn.RPC.ChangePassword(req)
return response, hn.InitNode(response.AdminMacaroon)
}
// waitTillServerState makes a subscription to the server's state change and
// blocks until the server is in the targeted state.
func (hn *HarnessNode) waitTillServerState(