Documentation
¶
Index ¶
- Constants
- func LndHubTestServiceInit(lndClientMock lnd.LightningClientWrapper) (svc *service.LndhubService, err error)
- type ExpectedAddInvoiceRequestBody
- type ExpectedAddInvoiceResponseBody
- type ExpectedAuthRequestBody
- type ExpectedAuthResponseBody
- type ExpectedBalanceResponse
- type ExpectedCheckPaymentResponseBody
- type ExpectedCreateUserRequestBody
- type ExpectedCreateUserResponseBody
- type ExpectedIncomingInvoice
- type ExpectedInvoiceEventWrapper
- type ExpectedKeySendRequestBody
- type ExpectedKeySendResponseBody
- type ExpectedOutgoingInvoice
- type ExpectedPayInvoiceRequestBody
- type ExpectedPayInvoiceResponseBody
- type ExpectedV2AddInvoiceRequestBody
- type HodlPaymentSubscriber
- type LNDMockHodlWrapperAsync
- func (wrapper *LNDMockHodlWrapperAsync) SendPaymentSync(ctx context.Context, req *lnrpc.SendRequest, options ...grpc.CallOption) (*lnrpc.SendResponse, error)
- func (wrapper *LNDMockHodlWrapperAsync) SettlePayment(payment lnrpc.Payment)
- func (wrapper *LNDMockHodlWrapperAsync) SubscribePayment(ctx context.Context, req *routerrpc.TrackPaymentRequest, ...) (lnd.SubscribePaymentWrapper, error)
- type LNDMockWrapper
- type LNDMockWrapperAsync
- type MockLND
- func (mlnd *MockLND) AddInvoice(ctx context.Context, req *lnrpc.Invoice, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error)
- func (mlnd *MockLND) DecodeBolt11(ctx context.Context, bolt11 string, options ...grpc.CallOption) (*lnrpc.PayReq, error)
- func (mlnd *MockLND) GetInfo(ctx context.Context, req *lnrpc.GetInfoRequest, options ...grpc.CallOption) (*lnrpc.GetInfoResponse, error)
- func (mlnd *MockLND) GetMainPubkey() (pubkey string)
- func (mlnd *MockLND) IsIdentityPubkey(pubkey string) (isOurPubkey bool)
- func (mlnd *MockLND) ListChannels(ctx context.Context, req *lnrpc.ListChannelsRequest, ...) (*lnrpc.ListChannelsResponse, error)
- func (mlnd *MockLND) SendPaymentSync(ctx context.Context, req *lnrpc.SendRequest, options ...grpc.CallOption) (*lnrpc.SendResponse, error)
- func (mlnd *MockLND) SubscribeInvoices(ctx context.Context, req *lnrpc.InvoiceSubscription, ...) (lnd.SubscribeInvoicesWrapper, error)
- func (mlnd *MockLND) SubscribePayment(ctx context.Context, req *routerrpc.TrackPaymentRequest, ...) (lnd.SubscribePaymentWrapper, error)
- func (mlnd *MockLND) TrackPayment(ctx context.Context, hash []byte, options ...grpc.CallOption) (*lnrpc.Payment, error)
- type MockSubscribeInvoices
- type TestSuite
Constants ¶
View Source
const SendPaymentMockError = "mocked send payment error"
Variables ¶
This section is empty.
Functions ¶
func LndHubTestServiceInit ¶
func LndHubTestServiceInit(lndClientMock lnd.LightningClientWrapper) (svc *service.LndhubService, err error)
Types ¶
type ExpectedAuthRequestBody ¶
type ExpectedBalanceResponse ¶
type ExpectedBalanceResponse struct { BTC struct { AvailableBalance int64 } }
type ExpectedCheckPaymentResponseBody ¶
type ExpectedCheckPaymentResponseBody struct {
IsPaid bool `json:"paid"`
}
type ExpectedIncomingInvoice ¶
type ExpectedIncomingInvoice struct { RHash interface{} `json:"r_hash"` PaymentHash interface{} `json:"payment_hash"` PaymentRequest string `json:"payment_request"` Description string `json:"description"` PayReq string `json:"pay_req"` Timestamp int64 `json:"timestamp"` Type string `json:"type"` ExpireTime int64 `json:"expire_time"` Amount int64 `json:"amt"` IsPaid bool `json:"ispaid"` Keysend bool `json:"keysend"` CustomRecords map[uint64][]byte `json:"custom_records"` }
type ExpectedInvoiceEventWrapper ¶
type ExpectedInvoiceEventWrapper struct { Type string `json:"type"` Invoice *ExpectedIncomingInvoice `json:"invoice,omitempty"` }
type ExpectedKeySendResponseBody ¶
type ExpectedKeySendResponseBody struct { RHash *lib.JavaScriptBuffer `json:"payment_hash,omitempty"` Amount int64 `json:"num_satoshis,omitempty"` Description string `json:"description,omitempty"` Destination string `json:"destination,omitempty"` DescriptionHashStr string `json:"description_hash,omitempty"` PaymentError string `json:"payment_error,omitempty"` PaymentPreimage *lib.JavaScriptBuffer `json:"payment_preimage,omitempty"` PaymentRoute *service.Route `json:"payment_route,omitempty"` }
type ExpectedOutgoingInvoice ¶
type ExpectedOutgoingInvoice struct { RHash interface{} `json:"r_hash"` PaymentHash interface{} `json:"payment_hash"` PaymentPreimage string `json:"payment_preimage"` Value int64 `json:"value"` Type string `json:"type"` Fee int64 `json:"fee"` Timestamp int64 `json:"timestamp"` Memo string `json:"memo"` }
type ExpectedPayInvoiceRequestBody ¶
type ExpectedPayInvoiceRequestBody struct { Invoice string `json:"invoice" validate:"required"` Amount interface{} `json:"amount" validate:"omitempty"` }
type ExpectedPayInvoiceResponseBody ¶
type ExpectedPayInvoiceResponseBody struct { RHash *lib.JavaScriptBuffer `json:"payment_hash,omitempty"` PaymentRequest string `json:"payment_request,omitempty"` PayReq string `json:"pay_req,omitempty"` Amount int64 `json:"num_satoshis,omitempty"` Description string `json:"description,omitempty"` DescriptionHashStr string `json:"description_hash,omitempty"` PaymentError string `json:"payment_error,omitempty"` PaymentPreimage *lib.JavaScriptBuffer `json:"payment_preimage,omitempty"` PaymentRoute *service.Route `json:"payment_route,omitempty"` }
type HodlPaymentSubscriber ¶
type HodlPaymentSubscriber struct {
// contains filtered or unexported fields
}
type LNDMockHodlWrapperAsync ¶
type LNDMockHodlWrapperAsync struct { lnd.LightningClientWrapper // contains filtered or unexported fields }
func NewLNDMockHodlWrapperAsync ¶
func NewLNDMockHodlWrapperAsync(lnd lnd.LightningClientWrapper) (result *LNDMockHodlWrapperAsync, err error)
func (*LNDMockHodlWrapperAsync) SendPaymentSync ¶
func (wrapper *LNDMockHodlWrapperAsync) SendPaymentSync(ctx context.Context, req *lnrpc.SendRequest, options ...grpc.CallOption) (*lnrpc.SendResponse, error)
func (*LNDMockHodlWrapperAsync) SettlePayment ¶
func (wrapper *LNDMockHodlWrapperAsync) SettlePayment(payment lnrpc.Payment)
func (*LNDMockHodlWrapperAsync) SubscribePayment ¶
func (wrapper *LNDMockHodlWrapperAsync) SubscribePayment(ctx context.Context, req *routerrpc.TrackPaymentRequest, options ...grpc.CallOption) (lnd.SubscribePaymentWrapper, error)
type LNDMockWrapper ¶
type LNDMockWrapper struct {
lnd.LightningClientWrapper
}
func NewLNDMockHodlWrapper ¶
func NewLNDMockHodlWrapper(lnd lnd.LightningClientWrapper) (result *LNDMockWrapper, err error)
func NewLNDMockWrapper ¶
func NewLNDMockWrapper(lnd lnd.LightningClientWrapper) (result *LNDMockWrapper, err error)
func (*LNDMockWrapper) SendPaymentSync ¶
func (wrapper *LNDMockWrapper) SendPaymentSync(ctx context.Context, req *lnrpc.SendRequest, options ...grpc.CallOption) (*lnrpc.SendResponse, error)
type LNDMockWrapperAsync ¶
type LNDMockWrapperAsync struct {
lnd.LightningClientWrapper
}
func NewLNDMockWrapperAsync ¶
func NewLNDMockWrapperAsync(lnd lnd.LightningClientWrapper) (result *LNDMockWrapperAsync, err error)
func (*LNDMockWrapperAsync) FailPayment ¶
func (wrapper *LNDMockWrapperAsync) FailPayment(message string)
func (*LNDMockWrapperAsync) SendPaymentSync ¶
func (wrapper *LNDMockWrapperAsync) SendPaymentSync(ctx context.Context, req *lnrpc.SendRequest, options ...grpc.CallOption) (*lnrpc.SendResponse, error)
type MockLND ¶
type MockLND struct { Sub *MockSubscribeInvoices GetInfoError error // contains filtered or unexported fields }
func NewMockLND ¶
func (*MockLND) AddInvoice ¶
func (mlnd *MockLND) AddInvoice(ctx context.Context, req *lnrpc.Invoice, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error)
func (*MockLND) DecodeBolt11 ¶
func (*MockLND) GetInfo ¶
func (mlnd *MockLND) GetInfo(ctx context.Context, req *lnrpc.GetInfoRequest, options ...grpc.CallOption) (*lnrpc.GetInfoResponse, error)
func (*MockLND) GetMainPubkey ¶
func (*MockLND) IsIdentityPubkey ¶
func (*MockLND) ListChannels ¶
func (mlnd *MockLND) ListChannels(ctx context.Context, req *lnrpc.ListChannelsRequest, options ...grpc.CallOption) (*lnrpc.ListChannelsResponse, error)
func (*MockLND) SendPaymentSync ¶
func (mlnd *MockLND) SendPaymentSync(ctx context.Context, req *lnrpc.SendRequest, options ...grpc.CallOption) (*lnrpc.SendResponse, error)
func (*MockLND) SubscribeInvoices ¶
func (mlnd *MockLND) SubscribeInvoices(ctx context.Context, req *lnrpc.InvoiceSubscription, options ...grpc.CallOption) (lnd.SubscribeInvoicesWrapper, error)
func (*MockLND) SubscribePayment ¶
func (mlnd *MockLND) SubscribePayment(ctx context.Context, req *routerrpc.TrackPaymentRequest, options ...grpc.CallOption) (lnd.SubscribePaymentWrapper, error)
type MockSubscribeInvoices ¶
type MockSubscribeInvoices struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.