itest

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

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WorkingToken = "hello"

Functions

func AddHopHint

func AddHopHint(n BreezClient, invoice string, lsp LspNode, chanid lntest.ShortChannelID, amountMsat *uint64, cltvDelta uint16) string

func AssertChannelCapacity

func AssertChannelCapacity(
	t *testing.T,
	outerAmountMsat uint64,
	capacityMsat uint64,
)

func ChannelInformation

func ChannelInformation(l LspNode) *lspd.ChannelInformationReply

func ContainsHopHint

func ContainsHopHint(t *testing.T, invoice string) bool

func GenerateInvoices

func GenerateInvoices(n BreezClient, req generateInvoicesRequest) (invoice, invoice)

func GenerateLsps2Invoices

func GenerateLsps2Invoices(n BreezClient, req generateInvoicesRequest, scid string) (invoice, invoice)

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

func NewMempoolApi

func NewMempoolApi(h *lntest.TestHarness) *mempoolApi

func RandStringBytes

func RandStringBytes(n int) string

func RegisterPayment

func RegisterPayment(l LspNode, paymentInfo *lspd.PaymentInformation, continueOnError bool) error

func SetFeeParams

func SetFeeParams(l LspNode, settings []*FeeParamSetting) error

func SubscribeNotifications

func SubscribeNotifications(l LspNode, b BreezClient, url string, continueOnError bool) error

func UnsubscribeNotifications

func UnsubscribeNotifications(l LspNode, b BreezClient, url string, continueOnError bool) error

Types

type AddressTxsChangedPayload

type AddressTxsChangedPayload struct {
	Template string `json:"template" binding:"required,eq=address_txs_changed"`
	Data     struct {
		Address string `json:"address" binding:"required"`
	} `json:"data"`
}

type BreezClient

type BreezClient interface {
	Name() string
	Harness() *lntest.TestHarness
	Node() lntest.LightningNode
	Start()
	Stop() error
	SetHtlcAcceptor(totalMsat uint64)
	ResetHtlcAcceptor()
	ReceiveCustomMessage() *lntest.CustomMsgRequest
}

type ClientFunc

type ClientFunc func(h *lntest.TestHarness, m *lntest.Miner) BreezClient

type ClnLspNode

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

func (*ClnLspNode) EciesPublicKey

func (c *ClnLspNode) EciesPublicKey() *ecies.PublicKey

func (*ClnLspNode) Harness

func (c *ClnLspNode) Harness() *lntest.TestHarness

func (*ClnLspNode) LightningNode

func (l *ClnLspNode) LightningNode() lntest.LightningNode

func (*ClnLspNode) NodeId

func (l *ClnLspNode) NodeId() []byte

func (*ClnLspNode) NotificationsRpc

func (c *ClnLspNode) NotificationsRpc() notifications.NotificationsClient

func (*ClnLspNode) PostgresBackend

func (l *ClnLspNode) PostgresBackend() *PostgresContainer

func (*ClnLspNode) PublicKey

func (c *ClnLspNode) PublicKey() *btcec.PublicKey

func (*ClnLspNode) Rpc

func (*ClnLspNode) Start

func (c *ClnLspNode) Start()

func (*ClnLspNode) Stop

func (c *ClnLspNode) Stop() error

type FeeParamSetting

type FeeParamSetting struct {
	Validity     time.Duration
	MinMsat      uint64
	Proportional uint32
}

type LndLspNode

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

func (*LndLspNode) EciesPublicKey

func (c *LndLspNode) EciesPublicKey() *ecies.PublicKey

func (*LndLspNode) Harness

func (c *LndLspNode) Harness() *lntest.TestHarness

func (*LndLspNode) LightningNode

func (l *LndLspNode) LightningNode() lntest.LightningNode

func (*LndLspNode) NodeId

func (l *LndLspNode) NodeId() []byte

func (*LndLspNode) NotificationsRpc

func (c *LndLspNode) NotificationsRpc() notifications.NotificationsClient

func (*LndLspNode) PostgresBackend

func (l *LndLspNode) PostgresBackend() *PostgresContainer

func (*LndLspNode) PublicKey

func (c *LndLspNode) PublicKey() *btcec.PublicKey

func (*LndLspNode) Rpc

func (*LndLspNode) Start

func (c *LndLspNode) Start()

func (*LndLspNode) Stop

func (c *LndLspNode) Stop() error

type LspFunc

type LspFunc func(h *lntest.TestHarness, m *lntest.Miner, mem *mempoolApi, c *config.NodeConfig) LspNode

type LspNode

type LspNode interface {
	Start()
	Stop() error
	Harness() *lntest.TestHarness
	PublicKey() *btcec.PublicKey
	EciesPublicKey() *ecies.PublicKey
	Rpc() lspd.ChannelOpenerClient
	NotificationsRpc() notifications.NotificationsClient
	NodeId() []byte
	LightningNode() lntest.LightningNode
	PostgresBackend() *PostgresContainer
}

func NewClnLspdNode

func NewClnLspdNode(h *lntest.TestHarness, m *lntest.Miner, mem *mempoolApi, name string, nodeConfig *config.NodeConfig) LspNode

func NewLndLspdNode

func NewLndLspdNode(h *lntest.TestHarness, m *lntest.Miner, mem *mempoolApi, name string, nodeConfig *config.NodeConfig) LspNode

type PaymentReceivedPayload

type PaymentReceivedPayload struct {
	Template string `json:"template" binding:"required,eq=payment_received"`
	Data     struct {
		PaymentHash string `json:"payment_hash" binding:"required"`
	} `json:"data"`
}

type PostgresContainer

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

func NewPostgresContainer

func NewPostgresContainer(logfile string) (*PostgresContainer, error)

func (*PostgresContainer) Cleanup

func (c *PostgresContainer) Cleanup(ctx context.Context) error

func (*PostgresContainer) ConnectionString

func (c *PostgresContainer) ConnectionString() string

func (*PostgresContainer) Pool

func (p *PostgresContainer) Pool() *pgxpool.Pool

func (*PostgresContainer) Start

func (c *PostgresContainer) Start(ctx context.Context) error

func (*PostgresContainer) Stop

func (c *PostgresContainer) Stop(ctx context.Context) error

type RecommendedFeesResponse

type RecommendedFeesResponse struct {
	FastestFee  float64 `json:"fastestFee"`
	HalfHourFee float64 `json:"halfHourFee"`
	HourFee     float64 `json:"hourFee"`
	EconomyFee  float64 `json:"economyFee"`
	MinimumFee  float64 `json:"minimumFee"`
}

type TxConfirmedPayload

type TxConfirmedPayload struct {
	Template string `json:"template" binding:"required,eq=tx_confirmed"`
	Data     struct {
		TxID string `json:"tx_id" binding:"required"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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