Documentation
¶
Index ¶
- Constants
- func ParseChannelPoint(channelPoint string) (*lnrpc.ChannelPoint, error)
- type BlockedStreamMock
- type Client
- type ClientMock
- func (c *ClientMock) BatchOpenChannel(ctx context.Context, req *lnrpc.BatchOpenChannelRequest) (string, error)
- func (c *ClientMock) CloseChannel(ctx context.Context, req *lnrpc.CloseChannelRequest) (Stream[*lnrpc.CloseStatusUpdate], error)
- func (c *ClientMock) ClosedChannels(ctx context.Context) ([]*lnrpc.ChannelCloseSummary, error)
- func (c *ClientMock) ConnectPeer(ctx context.Context, publicKey string, addresses []string) error
- func (c *ClientMock) DescribeGraph(ctx context.Context) (*lnrpc.ChannelGraph, error)
- func (c *ClientMock) EstimateRouteFee(ctx context.Context, publicKey string) (*routerrpc.RouteFeeResponse, error)
- func (c *ClientMock) EstimateTxFee(ctx context.Context, targetConf int32) (uint64, error)
- func (c *ClientMock) GetChanInfo(ctx context.Context, channelID uint64) (*lnrpc.ChannelEdge, error)
- func (c *ClientMock) GetInfo(ctx context.Context) (*lnrpc.GetInfoResponse, error)
- func (c *ClientMock) ListChannels(ctx context.Context) ([]*lnrpc.Channel, error)
- func (c *ClientMock) ListForwards(ctx context.Context, startTime, endTime uint64, indexOffset uint32) (*lnrpc.ForwardingHistoryResponse, error)
- func (c *ClientMock) ListPeers(ctx context.Context) ([]*lnrpc.Peer, error)
- func (c *ClientMock) QueryRoute(ctx context.Context, publicKey string) (*lnrpc.QueryRoutesResponse, error)
- func (c *ClientMock) UpdateChannelPolicy(ctx context.Context, channelPoint string, ...) error
- func (c *ClientMock) WalletBalance(ctx context.Context, minConf int32) (*lnrpc.WalletBalanceResponse, error)
- type Stream
Constants ¶
View Source
const (
// MaxForwardingEvents is the maximum number of forwarding events to get per RPC call.
MaxForwardingEvents = 50_000
)
Variables ¶
This section is empty.
Functions ¶
func ParseChannelPoint ¶ added in v0.2.0
func ParseChannelPoint(channelPoint string) (*lnrpc.ChannelPoint, error)
ParseChannelPoint parses a channel point string into the object used by LND.
Types ¶
type BlockedStreamMock ¶
type BlockedStreamMock[T any] struct{}
BlockedStreamMock is a stream of events that blocks to let the test execution end without failures.
func (BlockedStreamMock[T]) Recv ¶
func (s BlockedStreamMock[T]) Recv() (T, error)
Recv blocks forever.
type Client ¶
type Client interface {
BatchOpenChannel(ctx context.Context, req *lnrpc.BatchOpenChannelRequest) (string, error)
CloseChannel(ctx context.Context, req *lnrpc.CloseChannelRequest) (Stream[*lnrpc.CloseStatusUpdate], error)
ClosedChannels(ctx context.Context) ([]*lnrpc.ChannelCloseSummary, error)
ConnectPeer(ctx context.Context, publicKey string, addresses []string) error
DescribeGraph(ctx context.Context) (*lnrpc.ChannelGraph, error)
EstimateTxFee(ctx context.Context, targetConf int32) (uint64, error)
EstimateRouteFee(ctx context.Context, publicKey string) (*routerrpc.RouteFeeResponse, error)
GetChanInfo(ctx context.Context, channelID uint64) (*lnrpc.ChannelEdge, error)
GetInfo(ctx context.Context) (*lnrpc.GetInfoResponse, error)
ListChannels(ctx context.Context) ([]*lnrpc.Channel, error)
ListForwards(ctx context.Context, startTime, endTime uint64, indexOffset uint32) (*lnrpc.ForwardingHistoryResponse, error)
ListPeers(ctx context.Context) ([]*lnrpc.Peer, error)
QueryRoute(ctx context.Context, publicKey string) (*lnrpc.QueryRoutesResponse, error)
UpdateChannelPolicy(ctx context.Context, channelPoint string, baseFeeMsat, feeRatePPM, maxHTLCMsat, timeLockDelta uint64) error
WalletBalance(ctx context.Context, minConf int32) (*lnrpc.WalletBalanceResponse, error)
}
Client represents a Lightning Network node client.
type ClientMock ¶
ClientMock is a mocked implementation of a lightning client.
func NewClientMock ¶
func NewClientMock() *ClientMock
NewClientMock returns a mocked lightning network node client.
func (*ClientMock) BatchOpenChannel ¶
func (c *ClientMock) BatchOpenChannel(ctx context.Context, req *lnrpc.BatchOpenChannelRequest) (string, error)
BatchOpenChannel mock.
func (*ClientMock) CloseChannel ¶
func (c *ClientMock) CloseChannel(ctx context.Context, req *lnrpc.CloseChannelRequest) (Stream[*lnrpc.CloseStatusUpdate], error)
CloseChannel mock.
func (*ClientMock) ClosedChannels ¶
func (c *ClientMock) ClosedChannels(ctx context.Context) ([]*lnrpc.ChannelCloseSummary, error)
ClosedChannels mock.
func (*ClientMock) ConnectPeer ¶
ConnectPeer mock.
func (*ClientMock) DescribeGraph ¶
func (c *ClientMock) DescribeGraph(ctx context.Context) (*lnrpc.ChannelGraph, error)
DescribeGraph mock.
func (*ClientMock) EstimateRouteFee ¶
func (c *ClientMock) EstimateRouteFee(ctx context.Context, publicKey string) (*routerrpc.RouteFeeResponse, error)
EstimateRouteFee mock.
func (*ClientMock) EstimateTxFee ¶
EstimateTxFee mock.
func (*ClientMock) GetChanInfo ¶ added in v0.2.0
func (c *ClientMock) GetChanInfo(ctx context.Context, channelID uint64) (*lnrpc.ChannelEdge, error)
GetChanInfo mock.
func (*ClientMock) GetInfo ¶
func (c *ClientMock) GetInfo(ctx context.Context) (*lnrpc.GetInfoResponse, error)
GetInfo mock.
func (*ClientMock) ListChannels ¶
ListChannels mock.
func (*ClientMock) ListForwards ¶
func (c *ClientMock) ListForwards( ctx context.Context, startTime, endTime uint64, indexOffset uint32, ) (*lnrpc.ForwardingHistoryResponse, error)
ListForwards mock.
func (*ClientMock) QueryRoute ¶
func (c *ClientMock) QueryRoute(ctx context.Context, publicKey string) (*lnrpc.QueryRoutesResponse, error)
QueryRoute mock.
func (*ClientMock) UpdateChannelPolicy ¶ added in v0.2.0
func (c *ClientMock) UpdateChannelPolicy( ctx context.Context, channelPoint string, baseFeeMsat, feeRatePPM, maxHTLCMsat, timeLockDelta uint64, ) error
UpdateChannelPolicy mock.
func (*ClientMock) WalletBalance ¶
func (c *ClientMock) WalletBalance(ctx context.Context, minConf int32) (*lnrpc.WalletBalanceResponse, error)
WalletBalance mock.
Click to show internal directories.
Click to hide internal directories.