mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
9d1d629001
This commit performs the takeover that `lntemp` is now promoted to be `lntest`, and the scaffolding is now removed as all the refactoring is finished!
45 lines
1.3 KiB
Go
45 lines
1.3 KiB
Go
package rpc
|
|
|
|
import (
|
|
"github.com/lightningnetwork/lnd/lnrpc/chainrpc"
|
|
)
|
|
|
|
// =====================
|
|
// ChainClient related RPCs.
|
|
// =====================
|
|
|
|
type ConfNtfnClient chainrpc.ChainNotifier_RegisterConfirmationsNtfnClient
|
|
|
|
// RegisterConfirmationsNtfn creates a notification client to watch a given
|
|
// transaction being confirmed.
|
|
func (h *HarnessRPC) RegisterConfirmationsNtfn(
|
|
req *chainrpc.ConfRequest) ConfNtfnClient {
|
|
|
|
// RegisterConfirmationsNtfn needs to have the context alive for the
|
|
// entire test case as the returned client will be used for send and
|
|
// receive events stream. Thus we use runCtx here instead of a timeout
|
|
// context.
|
|
client, err := h.ChainClient.RegisterConfirmationsNtfn(
|
|
h.runCtx, req,
|
|
)
|
|
h.NoError(err, "RegisterConfirmationsNtfn")
|
|
|
|
return client
|
|
}
|
|
|
|
type SpendClient chainrpc.ChainNotifier_RegisterSpendNtfnClient
|
|
|
|
// RegisterSpendNtfn creates a notification client to watch a given
|
|
// transaction being spent.
|
|
func (h *HarnessRPC) RegisterSpendNtfn(req *chainrpc.SpendRequest) SpendClient {
|
|
// RegisterSpendNtfn needs to have the context alive for the entire
|
|
// test case as the returned client will be used for send and receive
|
|
// events stream. Thus we use runCtx here instead of a timeout context.
|
|
client, err := h.ChainClient.RegisterSpendNtfn(
|
|
h.runCtx, req,
|
|
)
|
|
h.NoError(err, "RegisterSpendNtfn")
|
|
|
|
return client
|
|
}
|