Documentation ¶
Index ¶
- Constants
- Variables
- func CreateApp(svc *TestService) (app *db.App, ss []byte, err error)
- func RemoveTestService()
- type MockLn
- func (mln *MockLn) CloseChannel(ctx context.Context, closeChannelRequest *lnclient.CloseChannelRequest) (*lnclient.CloseChannelResponse, error)
- func (mln *MockLn) ConnectPeer(ctx context.Context, connectPeerRequest *lnclient.ConnectPeerRequest) error
- func (mln *MockLn) DisconnectPeer(ctx context.Context, peerId string) error
- func (mln *MockLn) GetBalance(ctx context.Context) (balance int64, err error)
- func (mln *MockLn) GetBalances(ctx context.Context) (*lnclient.BalancesResponse, error)
- func (mln *MockLn) GetInfo(ctx context.Context) (info *lnclient.NodeInfo, err error)
- func (mln *MockLn) GetLogOutput(ctx context.Context, maxLen int) ([]byte, error)
- func (mln *MockLn) GetNetworkGraph(nodeIds []string) (lnclient.NetworkGraphResponse, error)
- func (mln *MockLn) GetNewOnchainAddress(ctx context.Context) (string, error)
- func (mln *MockLn) GetNodeConnectionInfo(ctx context.Context) (nodeConnectionInfo *lnclient.NodeConnectionInfo, err error)
- func (mln *MockLn) GetNodeStatus(ctx context.Context) (nodeStatus *lnclient.NodeStatus, err error)
- func (mln *MockLn) GetOnchainBalance(ctx context.Context) (*lnclient.OnchainBalanceResponse, error)
- func (mln *MockLn) GetStorageDir() (string, error)
- func (mln *MockLn) GetSupportedNIP47Methods() []string
- func (mln *MockLn) GetSupportedNIP47NotificationTypes() []string
- func (mln *MockLn) ListChannels(ctx context.Context) (channels []lnclient.Channel, err error)
- func (mln *MockLn) ListPeers(ctx context.Context) ([]lnclient.PeerDetails, error)
- func (mln *MockLn) ListTransactions(ctx context.Context, from, until, limit, offset uint64, unpaid bool, ...) (invoices []lnclient.Transaction, err error)
- func (mln *MockLn) LookupInvoice(ctx context.Context, paymentHash string) (transaction *lnclient.Transaction, err error)
- func (mln *MockLn) MakeInvoice(ctx context.Context, amount int64, description string, descriptionHash string, ...) (transaction *lnclient.Transaction, err error)
- func (mln *MockLn) OpenChannel(ctx context.Context, openChannelRequest *lnclient.OpenChannelRequest) (*lnclient.OpenChannelResponse, error)
- func (mln *MockLn) RedeemOnchainFunds(ctx context.Context, toAddress string) (txId string, err error)
- func (mln *MockLn) ResetRouter(key string) error
- func (mln *MockLn) SendKeysend(ctx context.Context, amount uint64, destination, preimage string, ...) (preImage string, err error)
- func (mln *MockLn) SendPaymentProbes(ctx context.Context, invoice string) error
- func (mln *MockLn) SendPaymentSync(ctx context.Context, payReq string) (*lnclient.PayInvoiceResponse, error)
- func (mln *MockLn) SendSpontaneousPaymentProbes(ctx context.Context, amountMsat uint64, nodeId string) error
- func (mln *MockLn) Shutdown() error
- func (mln *MockLn) SignMessage(ctx context.Context, message string) (string, error)
- func (mln *MockLn) UpdateChannel(ctx context.Context, updateChannelRequest *lnclient.UpdateChannelRequest) error
- func (mln *MockLn) UpdateLastWalletSyncRequest()
- type TestService
Constants ¶
View Source
const MockInvoice = "" /* 263-byte string literal not displayed */
View Source
const MockPaymentHash = "320c2c5a1492ccfd5bc7aa4ad9b657d6aaec3cfcc0d1d98413a29af4ac772ccf" // for the above invoice
View Source
const MockPaymentHash500 = "be8ad5d0b82071d538dcd160e3a3af444bd890de68388a4d771ba23c01096f2a"
for the invoice: lnbcrt5u1pjuywzppp5h69dt59cypca2wxu69sw8ga0g39a3yx7dqug5nthrw3rcqgfdu4qdqqcqzzsxqyz5vqsp5gzlpzszyj2k30qmpme7jsfzr24wqlvt9xdmr7ay34lfelz050krs9qyyssq038x07nh8yuv8hdpjh5y8kqp7zcd62ql9na9xh7pla44htjyy02sz23q7qm2tza6ct4ypljk54w9k9qsrsu95usk8ce726ytep6vhhsq9mhf9a
Variables ¶
View Source
var MockNodeInfo = lnclient.NodeInfo{
Alias: "bob",
Color: "#3399FF",
Pubkey: "123pubkey",
Network: "testnet",
BlockHeight: 12,
BlockHash: "123blockhash",
}
View Source
var MockTime = time.Unix(1693876963, 0)
View Source
var MockTimeUnix = MockTime.Unix()
View Source
var MockTransaction = &MockTransactions[0]
View Source
var MockTransactions = []lnclient.Transaction{ { Type: "incoming", Invoice: MockInvoice, Description: "mock invoice 1", DescriptionHash: "hash1", Preimage: "preimage1", PaymentHash: "payment_hash_1", Amount: 1000, FeesPaid: 50, SettledAt: &MockTimeUnix, Metadata: map[string]interface{}{ "key1": "value1", "key2": 42, }, }, { Type: "incoming", Invoice: MockInvoice, Description: "mock invoice 2", DescriptionHash: "hash2", Preimage: "preimage2", PaymentHash: "payment_hash_2", Amount: 2000, FeesPaid: 75, SettledAt: &MockTimeUnix, }, }
Functions ¶
func RemoveTestService ¶
func RemoveTestService()
Types ¶
type MockLn ¶
type MockLn struct { }
func (*MockLn) CloseChannel ¶
func (mln *MockLn) CloseChannel(ctx context.Context, closeChannelRequest *lnclient.CloseChannelRequest) (*lnclient.CloseChannelResponse, error)
func (*MockLn) ConnectPeer ¶
func (*MockLn) DisconnectPeer ¶
func (*MockLn) GetBalance ¶
func (*MockLn) GetBalances ¶
func (*MockLn) GetLogOutput ¶
func (*MockLn) GetNetworkGraph ¶
func (mln *MockLn) GetNetworkGraph(nodeIds []string) (lnclient.NetworkGraphResponse, error)
func (*MockLn) GetNewOnchainAddress ¶
func (*MockLn) GetNodeConnectionInfo ¶
func (*MockLn) GetNodeStatus ¶
func (*MockLn) GetOnchainBalance ¶
func (*MockLn) GetStorageDir ¶
func (*MockLn) GetSupportedNIP47Methods ¶
func (*MockLn) GetSupportedNIP47NotificationTypes ¶
func (*MockLn) ListChannels ¶
func (*MockLn) ListTransactions ¶
func (*MockLn) LookupInvoice ¶
func (*MockLn) MakeInvoice ¶
func (*MockLn) OpenChannel ¶
func (mln *MockLn) OpenChannel(ctx context.Context, openChannelRequest *lnclient.OpenChannelRequest) (*lnclient.OpenChannelResponse, error)
func (*MockLn) RedeemOnchainFunds ¶
func (*MockLn) ResetRouter ¶
func (*MockLn) SendKeysend ¶
func (*MockLn) SendPaymentProbes ¶
func (*MockLn) SendPaymentSync ¶
func (*MockLn) SendSpontaneousPaymentProbes ¶
func (*MockLn) SignMessage ¶
func (*MockLn) UpdateChannel ¶
func (*MockLn) UpdateLastWalletSyncRequest ¶
func (mln *MockLn) UpdateLastWalletSyncRequest()
type TestService ¶
type TestService struct { Keys keys.Keys Cfg config.Config LNClient lnclient.LNClient EventPublisher events.EventPublisher DB *gorm.DB }
func CreateTestService ¶
func CreateTestService() (svc *TestService, err error)
Click to show internal directories.
Click to hide internal directories.