starlighttest

package
v0.1.0-alpha.0...-0b1224c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: Apache-2.0, Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package starlighttest contains agent-level integration tests for starlight.

Index

Constants

This section is empty.

Variables

View Source
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 SetDebug

func SetDebug(d bool)

func StartTestnetAgent

func StartTestnetAgent(ctx context.Context, t *testing.T, dbpath string) *starlight.Agent

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.

Jump to

Keyboard shortcuts

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