testclient

package
v0.0.0-...-42803c1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const FriendbotAddress = "GAIH3ULLFQ4DGSECF2AR555KZ4KNDGEKN4AFI4SU2M7B43MGK3QJZNSR"

FriendbotAddress is the last known public address for the test network friendbot.

Variables

This section is empty.

Functions

func GetTestLumens

func GetTestLumens(t *testing.T, kp keypair.KP)

GetTestLumens will use the friendbot to get some lumens into kp's account. If not record or live, it is a no-op.

func IsLive

func IsLive() bool

IsLive returns true if the vcr is in live mode.

func IsPlayback

func IsPlayback() bool

IsPlayback returns true if the vcr is in play mode.

func IsRecording

func IsRecording() bool

IsRecording returns true if the vcr is in record mode.

func RandomAssetCode

func RandomAssetCode() string

Types

type Config

type Config struct {
	AliceSeed       string
	BobSeed         string
	CharlieSeed     string
	RebeccaSeed     string
	IssuerSeed      string
	DistributorSeed string
	AssetCode       string
}

Config contains the account seeds for the test users, and any other random data that might be needed (like AssetCode).

type Helper

type Helper struct {
	Config      *Config
	Alice       *keypair.Full
	Bob         *keypair.Full
	Charlie     *keypair.Full
	Rebecca     *keypair.Full
	Issuer      *keypair.Full
	Distributor *keypair.Full
}

Helper makes managing the test users and state easier.

func NewHelper

func NewHelper() *Helper

NewHelper creates a new Helper.

func Setup

func Setup(t *testing.T) (*Helper, *horizonclient.Client, string)

Setup is the primary entry point for testclient. It creates a Helper and the horizon client.

func (*Helper) Keypair

func (h *Helper) Keypair(t *testing.T, name string) *keypair.Full

Keypair deterministically generates keypair.Full from `name` and the config state.

func (*Helper) SetState

func (h *Helper) SetState(t *testing.T, name string)

SetState changes the directory where the http responses are stored. If record is on, it will clear out any existing files in the directory.

Jump to

Keyboard shortcuts

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