e2e

package
v0.0.0-...-e883f13 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CometHome                  = filepath.Join(os.TempDir(), "cometbft-home")
	CometBFT         *exec.Cmd = nil
	CometURL         string    = "github.com/cometbft/cometbft/cmd/cometbft@v0.38.0"
	CometGrpcPort    int       = 26657
	CometGrpcAddress string    = fmt.Sprintf("127.0.0.1:%d", CometGrpcPort)
	CometGrpcURL     string    = fmt.Sprintf("tcp://%s", CometGrpcAddress)
)
View Source
var (
	BlockTime time.Duration = time.Second * 3
)

Functions

func Client

func Client(ip, proxyPort string) (*rpchttp.HTTP, error)

func CreateConfigFromChain

func CreateConfigFromChain(home string, apps []ChainApp) string

func CreateHomeDirectory

func CreateHomeDirectory(dirPath string) (string, error)

func CreateMegablocksHeader

func CreateMegablocksHeader(chainID string) []byte

createMegablocksHeader creates the header needed for all transactions of megablocks applications.

func DumpLog

func DumpLog(logfile string)

DumpLog prints tail of a given logfile to stdout

func SendTx

func SendTx(client *http.HTTP, tx comettypes.Tx) error

SendTx broadcast a transaction on a client connection

Types

type Balance

type Balance struct {
	Balance struct {
		Amount string `json:"amount"`
		Denom  string `json:"denom"`
	} `json:"balance"`
}

type ChainApp

type ChainApp interface {
	Init() error
	Start() error
	Stop() error
	GetChainID() string
	GetAddress() string
	GetAddressType() string
	GetHome() string
}

type CosMux

type CosMux struct {
	Home       string
	Binary     string
	LogFile    *os.File
	Command    *exec.Cmd
	Config     string
	ConfigFile string
}

func (*CosMux) Init

func (app *CosMux) Init() error

func (*CosMux) Start

func (app *CosMux) Start() error

Start starts the Multiplexer shim

func (*CosMux) Stop

func (app *CosMux) Stop() error

type KeyValEntry

type KeyValEntry struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type KvApp

type KvApp struct {
	ChainID     string
	Home        string
	Binary      string
	Address     string
	AddressType string
	LogFile     *os.File
	Command     *exec.Cmd
}

func (*KvApp) GetAddress

func (app *KvApp) GetAddress() string

func (*KvApp) GetAddressType

func (app *KvApp) GetAddressType() string

func (*KvApp) GetChainID

func (app *KvApp) GetChainID() string

func (*KvApp) GetHome

func (app *KvApp) GetHome() string

func (*KvApp) Init

func (app *KvApp) Init() error

func (*KvApp) Start

func (app *KvApp) Start() error

func (*KvApp) Stop

func (app *KvApp) Stop() error

type RpcResponse

type RpcResponse struct {
	Result RpcResult `json: "result"`
}

type RpcResult

type RpcResult struct {
	Response KeyValEntry `json: "response"`
}

type SdkApp

type SdkApp struct {
	ChainID     string
	Home        string
	Binary      string
	Address     string
	AddressType string
	LogFile     *os.File
	Command     *exec.Cmd
	Moniker     string
	NodeKey     string
	Keys        []string
}

func (*SdkApp) AddKey

func (app *SdkApp) AddKey(name string) error

AddKey adds a key to the keyring

func (*SdkApp) Configure

func (app *SdkApp) Configure() error

func (*SdkApp) GetAddress

func (app *SdkApp) GetAddress() string

func (*SdkApp) GetAddressType

func (app *SdkApp) GetAddressType() string

func (*SdkApp) GetBalance

func (app *SdkApp) GetBalance(address, denom string) (int, error)

GetBalance returns bank balance for a given address

func (*SdkApp) GetBalanceWithChainID

func (app *SdkApp) GetBalanceWithChainID(address, denom, chainID string) (int, error)

func (*SdkApp) GetChainID

func (app *SdkApp) GetChainID() string

func (*SdkApp) GetHome

func (app *SdkApp) GetHome() string

func (*SdkApp) GetLatestBlockHeight

func (app *SdkApp) GetLatestBlockHeight() (int, error)

func (*SdkApp) GetUserAddress

func (app *SdkApp) GetUserAddress(user string) (string, error)

GetUserAddress returns the addrs for given user

func (*SdkApp) Init

func (app *SdkApp) Init() error

func (*SdkApp) SendBankTransaction

func (app *SdkApp) SendBankTransaction(fromAddress, toAddress, amount string) error

func (*SdkApp) Start

func (app *SdkApp) Start() error

func (*SdkApp) Stop

func (app *SdkApp) Stop() error

func (*SdkApp) UpdateGenesis

func (app *SdkApp) UpdateGenesis() error

Jump to

Keyboard shortcuts

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