Documentation ¶
Overview ¶
Package starlighttest contains agent-level integration tests for starlight.
Index ¶
- Variables
- func CreateChannel(ctx context.Context, guest, host *Starlightd, channelFundingAmount xlm.Amount) (string, error)
- func GuestChannelPayHost(ctx context.Context, guest, host *Starlightd, channelID string, ...) error
- func GuestCoopClose(ctx context.Context, guest, host *Starlightd, channelID string, ...) error
- func HostChannelPayGuest(ctx context.Context, guest, host *Starlightd, channelID string, ...) error
- func HostTopUp(ctx context.Context, guest, host *Starlightd, channelID string, ...) error
- func SetDebug(d bool)
- func StartTestnetAgent(ctx context.Context, t *testing.T, dbpath string) *starlight.Agent
- func WalletPaySelf(ctx context.Context, self *Starlightd) error
- type Starlightd
Constants ¶
This section is empty.
Variables ¶
var ( // HorizonURL is the testnet Horizon URL used for testing. HorizonURL = flag.String("horizon", "https://horizon-testnet.stellar.org/", "horizon URL") )
Functions ¶
func CreateChannel ¶
func CreateChannel(ctx context.Context, guest, host *Starlightd, channelFundingAmount xlm.Amount) (string, error)
CreateChannel executes the API steps for creating a channel.
func GuestChannelPayHost ¶
func GuestChannelPayHost(ctx context.Context, guest, host *Starlightd, channelID string, payment xlm.Amount) error
GuestChannelPayHost executes the API steps for a guest-to-host channel payment.
func GuestCoopClose ¶
func GuestCoopClose(ctx context.Context, guest, host *Starlightd, channelID string, channelFundingAmount, settleWithGuestAmount xlm.Amount) error
GuestCoopClose executes the API steps for a guest cooperative close.
func HostChannelPayGuest ¶
func HostChannelPayGuest(ctx context.Context, guest, host *Starlightd, channelID string, payment xlm.Amount) error
HostChannelPayGuest executes the API steps for a host-to-guest channel payment.
func HostTopUp ¶
func HostTopUp(ctx context.Context, guest, host *Starlightd, channelID string, topUpAmount xlm.Amount) error
HostTopUp executes the API steps for a host top-up.
func StartTestnetAgent ¶
StartTestnetAgent starts an agent for testing purposes, but with requests made to a live testnet Horizon.
func WalletPaySelf ¶
func WalletPaySelf(ctx context.Context, self *Starlightd) error
WalletPaySelf executes a do-wallet-pay API action.
Types ¶
type Starlightd ¶
type Starlightd struct {
// contains filtered or unexported fields
}
Starlightd is an in-memory starlight agent with HTTP endpoints for protocol messages and UI commands.
func StartServer ¶
func StartServer(ctx context.Context, testdir, name string) *Starlightd
StartServer starts a Startlightd instance.
func (*Starlightd) Address ¶
func (s *Starlightd) Address() string
Address returns the (trimmed) URL of the Starlightd server.
func (*Starlightd) Close ¶
func (s *Starlightd) Close()
Close releases the resources associated with s.