e2e

package
v1.14.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

End-to-end Test

This module is basically for the automated end-to-end test. But if you want to execute by yourself for testing (test testing) purpose, this tests are also executable on your local. Please follow the step below:

Prerequisites

  • Docker >= 20.10
  • Docker compose >= 2.12

How to run

# 1. From the repo root, move to the tests/e2e, and execute docker compose
cd tests/e2e
docker compose up -d
# (or force rebuild once)
# docker compose up --build -d

# Note: e2e compose builds the shared image `xpla-localnet-e2e:latest` once
# and all validator/volunteer nodes reuse that same image.
# It also uses local image only (`pull_policy: never`) to avoid registry pull noise.

# 2. Wait for building. Once done without error, you may check the nodes running
docker ps

#CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS          PORTS                                                                             NAMES
#648b7146ce8c   xpla-localnet-e2e:latest   "sh -c 'MONIKER=vali…"   44 minutes ago   Up 44 minutes   0.0.0.0:8545->8545/tcp, 0.0.0.0:9090->9090/tcp, 0.0.0.0:26656->26656/tcp          xpla-localnet-validator1
#97279d567135   xpla-localnet-e2e:latest   "sh -c 'MONIKER=vali…"   44 minutes ago   Up 44 minutes   8545/tcp, 9090/tcp, 0.0.0.0:9100->9100/tcp, 26656/tcp, 0.0.0.0:26666->26666/tcp   xpla-localnet-validator2
#f604f68c3f82   xpla-localnet-e2e:latest   "sh -c 'MONIKER=vali…"   44 minutes ago   Up 44 minutes   8545/tcp, 9090/tcp, 0.0.0.0:9110->9110/tcp, 26656/tcp, 0.0.0.0:26676->26676/tcp   xpla-localnet-validator3
#c3d0d9daefd2   xpla-localnet-e2e:latest   "sh -c 'MONIKER=vali…"   44 minutes ago   Up 44 minutes   8545/tcp, 9090/tcp, 0.0.0.0:9120->9120/tcp, 26656/tcp, 0.0.0.0:26686->26686/tcp   xpla-localnet-validator4

# 3. Execute tests
go test

# Do not execute short mode
# (X) go test -short

# ...
# PASS
# ok      github.com/xpladev/xpla/tests/e2e        29.365s

# If you see the pass sign, you may down the nodes
docker compose down

Test scenario

WASM
  • Send delegation tx
  • Upload the contract binary and get a code ID
  • With the code ID above, try to instantiate the contract
  • Execute the contract
  • Assert from querying the contract in each test step by assertion

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastTx

func BroadcastTx(ctx context.Context, conn grpc.ClientConnInterface, txBytes []byte, mode txtypes.BroadcastMode) (*sdk.TxResponse, error)

BroadcastTx returns the full response, including nonzero CheckTx codes, so callers can assert either successful submission or the expected rejection.

func GetAccountNumber

func GetAccountNumber(ctx context.Context, conn grpc.ClientConnInterface, address string) (uint64, uint64, error)

Types

type EVMWalletInfo

type EVMWalletInfo struct {
	CosmosWalletInfo *WalletInfo

	EthAddress    common.Address
	StringAddress string
	Nonce         uint64
}

func (*EVMWalletInfo) NewTransactor

func (e *EVMWalletInfo) NewTransactor(ctx context.Context, chainID *big.Int) (*bind.TransactOpts, error)

NewTransactor creates a contract signer using the wallet's existing key. Nonce and gas options remain unset so callers can use RPC defaults or set them.

type WalletInfo

type WalletInfo struct {
	sync.Mutex

	IsSrc         bool
	ChainId       string
	Prefix        string
	StringAddress string
	ByteAddress   sdk.AccAddress
	PrivKey       cryptotypes.PrivKey
	PubKey        cryptotypes.PubKey
	AccountNumber uint64
	Sequence      uint64
	EncCfg        moduletestutil.TestEncodingConfig
}

func (*WalletInfo) SignTx

func (w *WalletInfo) SignTx(ctx context.Context, chainID string, builder client.TxBuilder) ([]byte, error)

SignTx signs and encodes a transaction using the wallet's account number and sequence. It leaves gas, fees, broadcasting and sequence updates to the caller.

Jump to

Keyboard shortcuts

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