lnd/lntemp/rpc/wallet_unlocker.go
yyforyongyu d5abecbba9
lntemp/rpc: add new package lntemp/rpc to manage rpc clients
This commit starts the construction of the new package `lntemp`. This
package serves as the scaffolding while we migrate our old itest into
the new one. Once the migration is finished, the package will be put
back to `lntest`.
2022-10-14 07:25:29 +08:00

26 lines
536 B
Go

package rpc
import (
"context"
"github.com/lightningnetwork/lnd/lnrpc"
)
// =====================
// WalletUnlockerClient related RPCs.
// =====================
// UnlockWallet makes a RPC request to WalletUnlocker and asserts there's no
// error.
func (h *HarnessRPC) UnlockWallet(
req *lnrpc.UnlockWalletRequest) *lnrpc.UnlockWalletResponse {
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
defer cancel()
resp, err := h.WalletUnlocker.UnlockWallet(ctxt, req)
h.NoError(err, "UnlockWallet")
return resp
}