Documentation ¶
Index ¶
- func CreateKey(index int32) (*btcec.PrivateKey, *btcec.PublicKey)
- type MockLightning
- func (m *MockLightning) AddInvoice(_ context.Context, in *invoicesrpc.AddInvoiceData) (lntypes.Hash, string, error)
- func (m *MockLightning) ChannelBackup(_ context.Context, op wire.OutPoint) ([]byte, error)
- func (m *MockLightning) ChannelBackups(context.Context) ([]byte, error)
- func (m *MockLightning) CloseChannel(context.Context, *wire.OutPoint, bool, int32, btcutil.Address) (chan lndclient.CloseChannelUpdate, chan error, error)
- func (m *MockLightning) ClosedChannels(context.Context) ([]lndclient.ClosedChannel, error)
- func (m *MockLightning) ConfirmedWalletBalance(context.Context) (btcutil.Amount, error)
- func (m *MockLightning) Connect(_ context.Context, peer route.Vertex, host string, _ bool) error
- func (m *MockLightning) Connections() map[route.Vertex]string
- func (m *MockLightning) DecodePaymentRequest(context.Context, string) (*lndclient.PaymentRequest, error)
- func (m *MockLightning) EstimateFeeToP2WSH(context.Context, btcutil.Amount, int32) (btcutil.Amount, error)
- func (m *MockLightning) ForwardingHistory(context.Context, lndclient.ForwardingHistoryRequest) (*lndclient.ForwardingHistoryResponse, error)
- func (m *MockLightning) GetChanInfo(ctx context.Context, cid uint64) (*lndclient.ChannelEdge, error)
- func (m *MockLightning) GetInfo(context.Context) (*lndclient.Info, error)
- func (m *MockLightning) ListChannels(context.Context) ([]lndclient.ChannelInfo, error)
- func (m *MockLightning) ListInvoices(context.Context, lndclient.ListInvoicesRequest) (*lndclient.ListInvoicesResponse, error)
- func (m *MockLightning) ListPayments(context.Context, lndclient.ListPaymentsRequest) (*lndclient.ListPaymentsResponse, error)
- func (m *MockLightning) ListTransactions(context.Context, int32, int32) ([]lndclient.Transaction, error)
- func (m *MockLightning) LookupInvoice(_ context.Context, hash lntypes.Hash) (*lndclient.Invoice, error)
- func (m *MockLightning) OpenChannel(_ context.Context, peer route.Vertex, localSat, pushSat btcutil.Amount, _ bool) (*wire.OutPoint, error)
- func (m *MockLightning) PayInvoice(_ context.Context, invoice string, _ btcutil.Amount, _ *uint64) chan lndclient.PaymentResult
- func (m *MockLightning) PendingChannels(context.Context) (*lndclient.PendingChannels, error)
- func (m *MockLightning) SubscribeChannelBackups(ctx context.Context) (<-chan lnrpc.ChanBackupSnapshot, <-chan error, error)
- func (m *MockLightning) SubscribeChannelEvents(ctx context.Context) (<-chan *lndclient.ChannelEventUpdate, <-chan error, error)
- func (m *MockLightning) UpdateChanPolicy(ctx context.Context, req lndclient.PolicyUpdateRequest, ...) error
- func (m *MockLightning) WaitForFinished()
- type MockSigner
- func (s *MockSigner) ComputeInputScript(context.Context, *wire.MsgTx, []*lndclient.SignDescriptor) ([]*input.Script, error)
- func (s *MockSigner) DeriveSharedKey(context.Context, *btcec.PublicKey, *keychain.KeyLocator) ([32]byte, error)
- func (s *MockSigner) SignMessage(context.Context, []byte, keychain.KeyLocator) ([]byte, error)
- func (s *MockSigner) SignOutputRaw(_ context.Context, tx *wire.MsgTx, signDescriptors []*lndclient.SignDescriptor) ([][]byte, error)
- func (s *MockSigner) VerifyMessage(_ context.Context, msg, sig []byte, _ [33]byte) (bool, error)
- type MockWalletKit
- func (m *MockWalletKit) AddTx(tx *wire.MsgTx)
- func (m *MockWalletKit) BumpFee(context.Context, wire.OutPoint, chainfee.SatPerKWeight) error
- func (m *MockWalletKit) DeriveKey(_ context.Context, in *keychain.KeyLocator) (*keychain.KeyDescriptor, error)
- func (m *MockWalletKit) DeriveNextKey(_ context.Context, family int32) (*keychain.KeyDescriptor, error)
- func (m *MockWalletKit) EstimateFee(_ context.Context, confTarget int32) (chainfee.SatPerKWeight, error)
- func (m *MockWalletKit) LeaseOutput(context.Context, wtxmgr.LockID, wire.OutPoint, time.Duration) (time.Time, error)
- func (m *MockWalletKit) ListSweeps(_ context.Context) ([]string, error)
- func (m *MockWalletKit) ListUnspent(context.Context, int32, int32) ([]*lnwallet.Utxo, error)
- func (m *MockWalletKit) NextAddr(context.Context) (btcutil.Address, error)
- func (m *MockWalletKit) PublishTransaction(_ context.Context, tx *wire.MsgTx, label string) error
- func (m *MockWalletKit) ReleaseOutput(context.Context, wtxmgr.LockID, wire.OutPoint) error
- func (m *MockWalletKit) SendOutputs(_ context.Context, outputs []*wire.TxOut, _ chainfee.SatPerKWeight, ...) (*wire.MsgTx, error)
- type PaymentChannelMessage
- type ScbKeyRing
- type SignOutputRawRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MockLightning ¶
type MockLightning struct { lndclient.LightningClient SendPaymentChannel chan PaymentChannelMessage NodePubkey string ChainParams *chaincfg.Params ScbKeyRing *ScbKeyRing Transactions []lndclient.Transaction Sweeps []string // Invoices is a set of invoices that have been created by the mock, // keyed by hash string. Invoices map[lntypes.Hash]*lndclient.Invoice Channels []lndclient.ChannelInfo ChannelsClosed []lndclient.ClosedChannel ChannelsPending []lndclient.PendingChannel ForwardingEvents []lndclient.ForwardingEvent Payments []lndclient.Payment // contains filtered or unexported fields }
func NewMockLightning ¶
func NewMockLightning() *MockLightning
func (*MockLightning) AddInvoice ¶
func (m *MockLightning) AddInvoice(_ context.Context, in *invoicesrpc.AddInvoiceData) (lntypes.Hash, string, error)
func (*MockLightning) ChannelBackup ¶
ChannelBackup retrieves the backup for a particular channel. The backup is returned as an encrypted chanbackup.Single payload.
func (*MockLightning) ChannelBackups ¶
func (m *MockLightning) ChannelBackups(context.Context) ([]byte, error)
ChannelBackups retrieves backups for all existing pending open and open channels. The backups are returned as an encrypted chanbackup.Multi payload.
func (*MockLightning) CloseChannel ¶
func (*MockLightning) ClosedChannels ¶
func (m *MockLightning) ClosedChannels( context.Context) ([]lndclient.ClosedChannel, error)
ClosedChannels returns a list of our closed channels.
func (*MockLightning) ConfirmedWalletBalance ¶
func (*MockLightning) Connections ¶
func (m *MockLightning) Connections() map[route.Vertex]string
func (*MockLightning) DecodePaymentRequest ¶
func (m *MockLightning) DecodePaymentRequest(context.Context, string) (*lndclient.PaymentRequest, error)
func (*MockLightning) EstimateFeeToP2WSH ¶
func (*MockLightning) ForwardingHistory ¶
func (m *MockLightning) ForwardingHistory(context.Context, lndclient.ForwardingHistoryRequest) (*lndclient.ForwardingHistoryResponse, error)
ForwardingHistory returns the mock's set of forwarding events.
func (*MockLightning) GetChanInfo ¶
func (m *MockLightning) GetChanInfo(ctx context.Context, cid uint64) (*lndclient.ChannelEdge, error)
func (*MockLightning) ListChannels ¶
func (m *MockLightning) ListChannels(context.Context) ([]lndclient.ChannelInfo, error)
ListChannels retrieves all channels of the backing lnd node.
func (*MockLightning) ListInvoices ¶
func (m *MockLightning) ListInvoices(context.Context, lndclient.ListInvoicesRequest) (*lndclient.ListInvoicesResponse, error)
ListInvoices returns our mock's invoices.
func (*MockLightning) ListPayments ¶
func (m *MockLightning) ListPayments(context.Context, lndclient.ListPaymentsRequest) (*lndclient.ListPaymentsResponse, error)
ListPayments makes a paginated call to our list payments endpoint.
func (*MockLightning) ListTransactions ¶
func (m *MockLightning) ListTransactions(context.Context, int32, int32) ([]lndclient.Transaction, error)
ListTransactions returns all known transactions of the backing lnd node.
func (*MockLightning) LookupInvoice ¶
func (m *MockLightning) LookupInvoice(_ context.Context, hash lntypes.Hash) (*lndclient.Invoice, error)
LookupInvoice looks up an invoice in the mock's set of stored invoices. If it is not found, this call will fail. Note that these invoices should be settled using settleInvoice to have a preimage, settled state and settled date set.
func (*MockLightning) OpenChannel ¶
func (*MockLightning) PayInvoice ¶
func (m *MockLightning) PayInvoice(_ context.Context, invoice string, _ btcutil.Amount, _ *uint64) chan lndclient.PaymentResult
PayInvoice pays an invoice.
func (*MockLightning) PendingChannels ¶
func (m *MockLightning) PendingChannels( context.Context) (*lndclient.PendingChannels, error)
func (*MockLightning) SubscribeChannelBackups ¶
func (m *MockLightning) SubscribeChannelBackups(ctx context.Context, ) (<-chan lnrpc.ChanBackupSnapshot, <-chan error, error)
func (*MockLightning) SubscribeChannelEvents ¶
func (m *MockLightning) SubscribeChannelEvents(ctx context.Context) ( <-chan *lndclient.ChannelEventUpdate, <-chan error, error)
func (*MockLightning) UpdateChanPolicy ¶
func (m *MockLightning) UpdateChanPolicy(ctx context.Context, req lndclient.PolicyUpdateRequest, chanPoint *wire.OutPoint) error
func (*MockLightning) WaitForFinished ¶
func (m *MockLightning) WaitForFinished()
type MockSigner ¶
type MockSigner struct { SignOutputRawChannel chan SignOutputRawRequest Height int32 NodePubkey string Signature []byte SignatureMsg string }
func NewMockSigner ¶
func NewMockSigner() *MockSigner
func (*MockSigner) ComputeInputScript ¶
func (s *MockSigner) ComputeInputScript(context.Context, *wire.MsgTx, []*lndclient.SignDescriptor) ([]*input.Script, error)
func (*MockSigner) DeriveSharedKey ¶
func (s *MockSigner) DeriveSharedKey(context.Context, *btcec.PublicKey, *keychain.KeyLocator) ([32]byte, error)
func (*MockSigner) SignMessage ¶
func (s *MockSigner) SignMessage(context.Context, []byte, keychain.KeyLocator) ([]byte, error)
func (*MockSigner) SignOutputRaw ¶
func (s *MockSigner) SignOutputRaw(_ context.Context, tx *wire.MsgTx, signDescriptors []*lndclient.SignDescriptor) ([][]byte, error)
func (*MockSigner) VerifyMessage ¶
type MockWalletKit ¶
type MockWalletKit struct { TxPublishChannel chan *wire.MsgTx SendOutputsChannel chan wire.MsgTx Transactions []*wire.MsgTx Sweeps []string // contains filtered or unexported fields }
func NewMockWalletKit ¶
func NewMockWalletKit() *MockWalletKit
func (*MockWalletKit) AddTx ¶
func (m *MockWalletKit) AddTx(tx *wire.MsgTx)
AddRelevantTx marks the given transaction as relevant.
func (*MockWalletKit) BumpFee ¶
func (m *MockWalletKit) BumpFee(context.Context, wire.OutPoint, chainfee.SatPerKWeight) error
func (*MockWalletKit) DeriveKey ¶
func (m *MockWalletKit) DeriveKey(_ context.Context, in *keychain.KeyLocator) ( *keychain.KeyDescriptor, error)
func (*MockWalletKit) DeriveNextKey ¶
func (m *MockWalletKit) DeriveNextKey(_ context.Context, family int32) ( *keychain.KeyDescriptor, error)
func (*MockWalletKit) EstimateFee ¶
func (m *MockWalletKit) EstimateFee(_ context.Context, confTarget int32) ( chainfee.SatPerKWeight, error)
func (*MockWalletKit) LeaseOutput ¶
func (*MockWalletKit) ListSweeps ¶
func (m *MockWalletKit) ListSweeps(_ context.Context) ([]string, error)
ListSweeps returns a list of the sweep transaction ids known to our node.
func (*MockWalletKit) ListUnspent ¶
func (*MockWalletKit) PublishTransaction ¶
func (*MockWalletKit) ReleaseOutput ¶
func (*MockWalletKit) SendOutputs ¶
type PaymentChannelMessage ¶
type PaymentChannelMessage struct { PaymentRequest string Done chan lndclient.PaymentResult }
PaymentChannelMessage is the data that passed through SendPaymentChannel.
type ScbKeyRing ¶
type ScbKeyRing struct {
EncryptionKey keychain.KeyDescriptor
}
func (*ScbKeyRing) DeriveKey ¶
func (k *ScbKeyRing) DeriveKey( keychain.KeyLocator) (keychain.KeyDescriptor, error)
func (*ScbKeyRing) DeriveNextKey ¶
func (k *ScbKeyRing) DeriveNextKey( keychain.KeyFamily) (keychain.KeyDescriptor, error)
type SignOutputRawRequest ¶
type SignOutputRawRequest struct { Tx *wire.MsgTx SignDescriptors []*lndclient.SignDescriptor }
SignOutputRawRequest contains input data for a tx signing request.