-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
wallet_unlocker.go
64 lines (46 loc) · 1.57 KB
/
wallet_unlocker.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
}
// InitWallet makes a RPC request to WalletUnlocker and asserts there's no
// error.
func (h *HarnessRPC) InitWallet(
req *lnrpc.InitWalletRequest) *lnrpc.InitWalletResponse {
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
defer cancel()
resp, err := h.WalletUnlocker.InitWallet(ctxt, req)
h.NoError(err, "InitWallet")
return resp
}
// GenSeed makes a RPC request to WalletUnlocker and asserts there's no error.
func (h *HarnessRPC) GenSeed(req *lnrpc.GenSeedRequest) *lnrpc.GenSeedResponse {
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
defer cancel()
resp, err := h.WalletUnlocker.GenSeed(ctxt, req)
h.NoError(err, "GenSeed")
return resp
}
// ChangePassword makes a RPC request to WalletUnlocker and asserts there's no
// error.
func (h *HarnessRPC) ChangePassword(
req *lnrpc.ChangePasswordRequest) *lnrpc.ChangePasswordResponse {
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
defer cancel()
resp, err := h.WalletUnlocker.ChangePassword(ctxt, req)
h.NoError(err, "ChangePassword")
return resp
}