smoke

package
v0.0.0-...-8acb6f8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(addr string, network ctypes.ChainNetwork, k keys.KeyManager) sdk.DexClient

Get Client, retry if we fail to get it (ie API Rate limited)

Types

type Binance

type Binance struct {
	// contains filtered or unexported fields
}

func NewBinance

func NewBinance(apiHost, chainId string, debug bool) Binance

NewBinance : new instnance of Binance.

func (Binance) CreateMsg

func (b Binance) CreateMsg(from btypes.AccAddress, fromCoins btypes.Coins, transfers []msg.Transfer) msg.SendMsg

CreateMsg : Create a new message to broadcast to Binance.

func (Binance) Input

func (b Binance) Input(addr btypes.AccAddress, coins btypes.Coins) msg.Input

Input : Prep our input message.

func (Binance) MsgToSend

func (b Binance) MsgToSend(in []msg.Input, out []msg.Output) msg.SendMsg

MsgToSend : Prep the message to send.

func (Binance) Output

func (b Binance) Output(addr btypes.AccAddress, coins btypes.Coins) msg.Output

Output : Prep our output message.

func (Binance) ParseTx

func (b Binance) ParseTx(key keys.KeyManager, transfers []msg.Transfer) msg.SendMsg

ParseTx : Parse the transaction.

func (Binance) SendTxn

func (b Binance) SendTxn(key keys.KeyManager, payload []msg.Transfer, memo string)

SendTxn : prep and broadcast the transaction to Binance.

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config : test config

type Network

type Network struct {
	Type    ctypes.ChainNetwork
	ChainID string
}

Network is the different between testnet and mainNet

func NewNetwork

func NewNetwork(network int) Network

type Smoke

type Smoke struct {
	Config     Config
	ApiAddr    string
	Network    ctypes.ChainNetwork
	FaucetKey  string
	PoolKey    string
	Binance    Binance
	Statechain Statechain
	Tests      types.Tests
	Results    []types.Output
}

Smoke : test instructions.

func NewSmoke

func NewSmoke(apiAddr, faucetKey, poolKey, env string, config string, network int, logFile string, debug bool) Smoke

NewSmoke : create a new Smoke instance.

func (*Smoke) ActorAmount

func (s *Smoke) ActorAmount(amount int64, output *types.Balance, actor string)

ActorAmount : Amount for a given actor

func (*Smoke) BinanceState

func (s *Smoke) BinanceState(tx int)

BinanceState : Compare expected vs actual Binance wallet values.

func (*Smoke) ClientKey

func (s *Smoke) ClientKey() (sdk.DexClient, keys.KeyManager)

ClientKey : instantiate Client and Keys Binance SDK objects.

func (*Smoke) GetBinance

func (s *Smoke) GetBinance(client sdk.DexClient, address ctypes.AccAddress) []ctypes.TokenBalance

GetBinance : Get Binance account balance.

func (*Smoke) GetClient

func (s *Smoke) GetClient(k keys.KeyManager) sdk.DexClient

Get Client, retry if we fail to get it (ie API Rate limited)

func (*Smoke) GetStatechain

func (s *Smoke) GetStatechain() types.StatechainPools

GetStatechain : Get the Statehcain pools.

func (*Smoke) LogResults

func (s *Smoke) LogResults(tx int, delay time.Duration)

LogResults : Log our results.

func (*Smoke) Run

func (s *Smoke) Run()

Run : Where there's smoke, there's fire!

func (*Smoke) SaveLog

func (s *Smoke) SaveLog()

SaveLog : Save the log file.

func (*Smoke) SendTxn

func (s *Smoke) SendTxn(client sdk.DexClient, key keys.KeyManager, payload []msg.Transfer, memo string)

SendTxn : Send the transaction to Binance.

func (*Smoke) Setup

func (s *Smoke) Setup()

Setup : Generate/setup our accounts.

func (*Smoke) StatechainState

func (s *Smoke) StatechainState(tx int)

StatechainState : Current Statechain state.

func (*Smoke) Summary

func (s *Smoke) Summary()

Summary : Private Keys

func (*Smoke) Sweep

func (s *Smoke) Sweep()

Sweep : Transfer all assets back to the faucet.

type Statechain

type Statechain struct {
	Env string
}

func NewStatechain

func NewStatechain(env string) Statechain

NewStatechain : Create a new Statechain instance.

func (Statechain) PoolURL

func (s Statechain) PoolURL() string

PoolURL : Return the Pool URL based on the selected environment.

func (Statechain) StakerURL

func (s Statechain) StakerURL(staker string) string

StakerURL : Return the Staker URL based on the selected environment.

type Sweep

type Sweep struct {
	ApiAddr    string
	Network    btypes.ChainNetwork
	Binance    Binance
	KeyManager keys.KeyManager
	Client     sdk.DexClient
	KeyList    []string
}

Sweep : our main sweep type.

func NewSweep

func NewSweep(apiAddr, masterPrivKey string, keyList []string, network int, debug bool) Sweep

NewHoover : Create a new instance of Sweep.

func (Sweep) Balances

func (s Sweep) Balances(address btypes.AccAddress) []btypes.TokenBalance

Balances : Get the account balances of a given wallet.

func (Sweep) EmptyWallets

func (s Sweep) EmptyWallets()

EmptyWallets : Empty and transfer all assets out of the wallet.

func (Sweep) SendTxn

func (s Sweep) SendTxn(client sdk.DexClient, key keys.KeyManager, payload []msg.Transfer, memo string)

SendTxn : Send our transaction to Binance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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