Documentation ¶
Index ¶
- func CreateAddr(t *testing.T, name, password string, kb crkeys.Keybase) (sdk.AccAddress, string)
- func CreateAddrs(t *testing.T, kb crkeys.Keybase, numAddrs int) (addrs []sdk.AccAddress, seeds, names, passwords []string)
- func GetConfig() *tmcfg.Config
- func InitClientHome(t *testing.T, dir string) string
- func InitializeTestLCD(t *testing.T, nValidators int, initAddrs []sdk.AccAddress, minting bool) (cleanup func(), valConsPubKeys []crypto.PubKey, valOperAddrs []sdk.ValAddress, ...)
- func Request(t *testing.T, port, method, path string, payload []byte) (*http.Response, string)
- func ServeCommand(cdc *codec.Codec, registerRoutesFn func(*RestServer)) *cobra.Command
- type AddrSeed
- type AddrSeedSlice
- type RestServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAddr ¶
CreateAddr adds an address to the key store and returns an address and seed. It also requires that the key could be created.
func CreateAddrs ¶
func CreateAddrs(t *testing.T, kb crkeys.Keybase, numAddrs int) (addrs []sdk.AccAddress, seeds, names, passwords []string)
CreateAddr adds multiple address to the key store and returns the addresses and associated seeds in lexographical order by address. It also requires that the keys could be created.
func InitClientHome ¶
InitClientHome initialises client home dir.
func InitializeTestLCD ¶
func InitializeTestLCD(t *testing.T, nValidators int, initAddrs []sdk.AccAddress, minting bool) ( cleanup func(), valConsPubKeys []crypto.PubKey, valOperAddrs []sdk.ValAddress, port string)
TODO: Make InitializeTestLCD safe to call in multiple tests at the same time InitializeTestLCD starts Tendermint and the LCD in process, listening on their respective sockets where nValidators is the total number of validators and initAddrs are the accounts to initialize with some stake tokens. It returns a cleanup function, a set of validator public keys, and a port.
func Request ¶
Request makes a test LCD test request. It returns a response object and a stringified response body.
func ServeCommand ¶
func ServeCommand(cdc *codec.Codec, registerRoutesFn func(*RestServer)) *cobra.Command
ServeCommand will start a Gaia Lite REST service as a blocking process. It takes a codec to create a RestServer object and a function to register all necessary routes.
Types ¶
type AddrSeed ¶
type AddrSeed struct { Address sdk.AccAddress Seed string Name string Password string }
AddrSeed combines an Address with the mnemonic of the private key to that address
type AddrSeedSlice ¶
type AddrSeedSlice []AddrSeed
AddrSeedSlice implements `Interface` in sort package.
func (AddrSeedSlice) Len ¶
func (b AddrSeedSlice) Len() int
func (AddrSeedSlice) Less ¶
func (b AddrSeedSlice) Less(i, j int) bool
Less sorts lexicographically by Address
func (AddrSeedSlice) Swap ¶
func (b AddrSeedSlice) Swap(i, j int)
type RestServer ¶
type RestServer struct { Mux *mux.Router CliCtx context.CLIContext KeyBase keybase.Keybase Cdc *codec.Codec // contains filtered or unexported fields }
RestServer represents the Light Client Rest server
func NewRestServer ¶
func NewRestServer(cdc *codec.Codec) *RestServer
NewRestServer creates a new rest server instance