Documentation ¶
Index ¶
- func GetPrivkeys(t *testing.T, n int) []*btcec.PrivateKey
- func GetPubkeys(t *testing.T, n int) []*btcec.PublicKey
- func MockBlindedRoute(m *mock.Mock, features []lndwire.FeatureBit, path *sphinx.BlindedPath, ...)
- func MockConnect(m *mock.Mock, peer route.Vertex, host string, perm bool, err error)
- func MockDeriveSharedKey(m *mock.Mock, ephemeral *btcec.PublicKey, locator *keychain.KeyLocator, ...)
- func MockGetInfo(m *mock.Mock, info *lndclient.Info, err error)
- func MockGetNodeInfo(m *mock.Mock, pubkey route.Vertex, includeChannels bool, ...)
- func MockListChannels(m *mock.Mock, activeOnly, publicOnly bool, channels []lndclient.ChannelInfo, ...)
- func MockListPeers(m *mock.Mock, peers []lndclient.Peer, err error)
- func MockQueryRoutes(m *mock.Mock, req lndclient.QueryRoutesRequest, ...)
- func MockSendAnyCustomMessage(m *mock.Mock, err error)
- func MockSubscribeCustomMessages(m *mock.Mock, msgChan <-chan lndclient.CustomMessage, errChan <-chan error, ...)
- type MockLND
- func (m *MockLND) Connect(ctx context.Context, peer route.Vertex, host string, permanent bool) error
- func (m *MockLND) DeriveSharedKey(ctx context.Context, ephemeralPubKey *btcec.PublicKey, ...) ([32]byte, error)
- func (m *MockLND) GetInfo(ctx context.Context) (*lndclient.Info, error)
- func (m *MockLND) GetNodeInfo(ctx context.Context, pubkey route.Vertex, includeChannels bool) (*lndclient.NodeInfo, error)
- func (m *MockLND) ListChannels(ctx context.Context, activeOnly, publicOnly bool) ([]lndclient.ChannelInfo, error)
- func (m *MockLND) ListPeers(ctx context.Context) ([]lndclient.Peer, error)
- func (m *MockLND) QueryRoutes(ctx context.Context, req lndclient.QueryRoutesRequest) (*lndclient.QueryRoutesResponse, error)
- func (m *MockLND) SendCustomMessage(ctx context.Context, msg lndclient.CustomMessage) error
- func (m *MockLND) SubscribeCustomMessages(ctx context.Context) (<-chan lndclient.CustomMessage, <-chan error, error)
- type MockRouteGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPrivkeys ¶
GetPrivkeys provides n private keys for testing.
func GetPubkeys ¶
GetPubkeys provides n public keys for testing.
func MockBlindedRoute ¶
func MockBlindedRoute(m *mock.Mock, features []lndwire.FeatureBit, path *sphinx.BlindedPath, err error)
MockBlindedRoute primes our mock to return the error provided when send custom message is called with any CustomMessage.
func MockConnect ¶
MockConnect primes our mock to return error specified on a call to Connect.
func MockDeriveSharedKey ¶
func MockDeriveSharedKey(m *mock.Mock, ephemeral *btcec.PublicKey, locator *keychain.KeyLocator, key [32]byte, err error)
MockDeriveSharedKey primes our mock to return the key and error provided when derive shared key is called.
func MockGetInfo ¶
MockGetInfo primes our mock to return the info and error provided when GetInfo is called.
func MockGetNodeInfo ¶
func MockGetNodeInfo(m *mock.Mock, pubkey route.Vertex, includeChannels bool, info *lndclient.NodeInfo, err error)
MockGetNodeInfo primes our mock to return the info and error provided when a call to get node info with the peer/include channels params is made.
func MockListChannels ¶
func MockListChannels(m *mock.Mock, activeOnly, publicOnly bool, channels []lndclient.ChannelInfo, err error)
MockListChannels primes our mock to return the channel list and error provided when ListChannels is called.
func MockListPeers ¶
MockListPeers primes our mock to return the peers and error specified on a call to ListPeers.
func MockQueryRoutes ¶
func MockQueryRoutes(m *mock.Mock, req lndclient.QueryRoutesRequest, resp *lndclient.QueryRoutesResponse, err error)
MockQueryRoutes primes our mock to return the response provided on a call to query routes.
func MockSendAnyCustomMessage ¶
MockSendAnyCustomMessage primes our mock to return the error provided when send custom message is called with any CustomMessage.
func MockSubscribeCustomMessages ¶
func MockSubscribeCustomMessages(m *mock.Mock, msgChan <-chan lndclient.CustomMessage, errChan <-chan error, err error)
MockSubscribeCustomMessages primes our mock to return the channels and error provided when we subscribe to custom messages.
Types ¶
type MockLND ¶
MockLND creates a mock that substitutes for an API connection to lnd.
func (*MockLND) Connect ¶
func (m *MockLND) Connect(ctx context.Context, peer route.Vertex, host string, permanent bool) error
Connect mocks a connection to the peer provided.
func (*MockLND) DeriveSharedKey ¶
func (m *MockLND) DeriveSharedKey(ctx context.Context, ephemeralPubKey *btcec.PublicKey, keyLocator *keychain.KeyLocator) ( [32]byte, error)
DeriveSharedKey mocks lnd's ECDH operations.
func (*MockLND) GetNodeInfo ¶
func (m *MockLND) GetNodeInfo(ctx context.Context, pubkey route.Vertex, includeChannels bool) (*lndclient.NodeInfo, error)
GetNodeInfo mocks looking up a node in the public ln graph.
func (*MockLND) ListChannels ¶
func (m *MockLND) ListChannels(ctx context.Context, activeOnly, publicOnly bool) ([]lndclient.ChannelInfo, error)
ListChannels mocks a call to lnd's list channels api.
func (*MockLND) QueryRoutes ¶
func (m *MockLND) QueryRoutes(ctx context.Context, req lndclient.QueryRoutesRequest) (*lndclient.QueryRoutesResponse, error)
QueryRoutes mocks a call to lnd's query routes api.
func (*MockLND) SendCustomMessage ¶
SendCustomMessage mocks sending a custom message to a peer.
func (*MockLND) SubscribeCustomMessages ¶
func (m *MockLND) SubscribeCustomMessages(ctx context.Context) ( <-chan lndclient.CustomMessage, <-chan error, error)
SubscribeCustomMessages mocks subscribing to custom messages from lnd.
type MockRouteGenerator ¶
MockRouteGenerator creates a mock that substitutes for blinded route generation.
func NewMockRouteGenerator ¶
func NewMockRouteGenerator() *MockRouteGenerator
NewMockRouteGenerator produces a mock for blinded path generation.
func (*MockRouteGenerator) ReplyPath ¶
func (m *MockRouteGenerator) ReplyPath(ctx context.Context, features []lndwire.FeatureBit) (*sphinx.BlindedPath, error)
ReplyPath mocks creation of a blinded route.