lightning

package
v0.0.0-...-9a829fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package lightning is a generated GoMock package.

Index

Constants

View Source
const DefaultCltvExpiry uint64 = 144

Variables

View Source
var (
	TestPaymentHash = [32]byte{
		0xd7, 0x8a, 0x8b, 0xa8, 0xb6, 0x25, 0x10, 0x27,
		0xf3, 0x7f, 0xd6, 0xfe, 0xbf, 0xf0, 0x31, 0x5f,
		0x2d, 0x45, 0xbe, 0x83, 0x1b, 0xa3, 0x13, 0xfb,
		0x23, 0xc6, 0xe0, 0x3a, 0x2a, 0xbe, 0x3c, 0xa5,
	}
	TestPreimage = [32]byte{
		0x01, 0xda, 0x5d, 0x7d, 0x74, 0x0a, 0xc5, 0x7f,
		0xcd, 0xc1, 0x5f, 0xd4, 0x7b, 0x9c, 0x8c, 0x0c,
		0x3b, 0xa3, 0xb7, 0xb7, 0x62, 0xd1, 0x26, 0xdf,
		0x10, 0xfa, 0xb4, 0xad, 0x95, 0xd9, 0x84, 0x00,
	}

	TestPrivKeyBytes, _ = hex.DecodeString("e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734")

	TestPrivKey, _ = btcec.PrivKeyFromBytes(TestPrivKeyBytes)

	TestMessageSigner = zpay32.MessageSigner{
		SignCompact: func(msg []byte) ([]byte, error) {
			hash := chainhash.HashB(msg)
			sig := ecdsa.SignCompact(TestPrivKey, hash, true)

			return sig, nil
		},
	}

	Description   = "test description"
	EmptyFeatures = lnwire.NewFeatureVector(nil, lnwire.Features)
)
View Source
var ErrInvoiceCanceled = fmt.Errorf("invoice canceled")

Functions

func CreateMockInvoice

func CreateMockInvoice(t *testing.T, amsats int64, opts ...InvoiceOption) string

func ToChainCfgNetwork

func ToChainCfgNetwork(network Network) *chaincfg.Params

Types

type Client

type Client interface {
	PayInvoice(ctx context.Context, paymentRequest string, feeLimitRatio float64) error
	MonitorPaymentRequest(ctx context.Context, paymentHash string) (Preimage, NetworkFeeSats, error)
	MonitorPaymentReception(ctx context.Context, rhash []byte) (Preimage, error)
	GenerateInvoice(ctx context.Context, amountSats decimal.Decimal, expiry time.Duration, memo string) (paymentRequest string, rhash []byte, e error)
	GenerateAddress(ctx context.Context) (string, error)
	GetChannelLocalBalance(ctx context.Context) (decimal.Decimal, error)
	GetInfo(ctx context.Context) (*lnrpc.GetInfoResponse, error)
}

type GraphStatus

type GraphStatus struct {
	GraphSynced bool
	ChainSynced bool
}

type InvoiceOption

type InvoiceOption func(*zpay32.Invoice)

type MockClient

type MockClient struct {
	// contains filtered or unexported fields
}

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) GenerateAddress

func (m *MockClient) GenerateAddress(ctx context.Context) (string, error)

GenerateAddress mocks base method.

func (*MockClient) GenerateInvoice

func (m *MockClient) GenerateInvoice(ctx context.Context, amountSats decimal.Decimal, expiry time.Duration, memo string) (string, []byte, error)

GenerateInvoice mocks base method.

func (*MockClient) GetChannelLocalBalance

func (m *MockClient) GetChannelLocalBalance(ctx context.Context) (decimal.Decimal, error)

GetChannelLocalBalance mocks base method.

func (*MockClient) GetInfo

func (m *MockClient) GetInfo(ctx context.Context) (*lnrpc.GetInfoResponse, error)

GetInfo mocks base method.

func (*MockClient) MonitorPaymentReception

func (m *MockClient) MonitorPaymentReception(ctx context.Context, rhash []byte) (Preimage, error)

MonitorPaymentReception mocks base method.

func (*MockClient) MonitorPaymentRequest

func (m *MockClient) MonitorPaymentRequest(ctx context.Context, paymentHash string) (Preimage, NetworkFeeSats, error)

MonitorPaymentRequest mocks base method.

func (*MockClient) PayInvoice

func (m *MockClient) PayInvoice(ctx context.Context, paymentRequest string, feeLimitRatio float64) error

PayInvoice mocks base method.

type MockClientMockRecorder

type MockClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) GenerateAddress

func (mr *MockClientMockRecorder) GenerateAddress(ctx any) *gomock.Call

GenerateAddress indicates an expected call of GenerateAddress.

func (*MockClientMockRecorder) GenerateInvoice

func (mr *MockClientMockRecorder) GenerateInvoice(ctx, amountSats, expiry, memo any) *gomock.Call

GenerateInvoice indicates an expected call of GenerateInvoice.

func (*MockClientMockRecorder) GetChannelLocalBalance

func (mr *MockClientMockRecorder) GetChannelLocalBalance(ctx any) *gomock.Call

GetChannelLocalBalance indicates an expected call of GetChannelLocalBalance.

func (*MockClientMockRecorder) GetInfo

func (mr *MockClientMockRecorder) GetInfo(ctx any) *gomock.Call

GetInfo indicates an expected call of GetInfo.

func (*MockClientMockRecorder) MonitorPaymentReception

func (mr *MockClientMockRecorder) MonitorPaymentReception(ctx, rhash any) *gomock.Call

MonitorPaymentReception indicates an expected call of MonitorPaymentReception.

func (*MockClientMockRecorder) MonitorPaymentRequest

func (mr *MockClientMockRecorder) MonitorPaymentRequest(ctx, paymentHash any) *gomock.Call

MonitorPaymentRequest indicates an expected call of MonitorPaymentRequest.

func (*MockClientMockRecorder) PayInvoice

func (mr *MockClientMockRecorder) PayInvoice(ctx, paymentRequest, feeLimitRatio any) *gomock.Call

PayInvoice indicates an expected call of PayInvoice.

type Network

type Network string
const (
	Mainnet Network = "mainnet"
	Testnet Network = "testnet"
	Regtest Network = "regtest"
)

type NetworkFeeSats

type NetworkFeeSats = int64

type Preimage

type Preimage = string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL