testutils

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSDKTx added in v0.1.6

func BuildSDKTx(t *testing.T, chainID string, seqNum, accNum uint64, ethPrivKey *ecdsa.PrivateKey, msgs []protov1.Message) *sdktx.Tx

func GenerateBlock

func GenerateBlock(t *testing.T) *monomer.Block

GenerateBlock generates a valid block (up to stateless validation). The block is not meant to be executed.

func GenerateBlockFromEthTxs

func GenerateBlockFromEthTxs(t *testing.T, l1InfoTx *gethtypes.Transaction, depositTxs, cosmosEthTxs []*gethtypes.Transaction) *monomer.Block

func GenerateBlockWithParentAndTxs

func GenerateBlockWithParentAndTxs(t *testing.T, parent *monomer.Header, cosmosTxs ...bfttypes.Tx) *monomer.Block

GenerateBlockWithParentAndTxs generates a child block of parent with the cosmosTxs appended to the end of its transaction list. The genesis block is created if parent is nil.

func GenerateERC20DepositTx

func GenerateERC20DepositTx(t *testing.T, tokenAddr, userAddr common.Address, amount *big.Int) *gethtypes.Transaction

func GenerateEthBridgeDepositTx added in v0.1.5

func GenerateEthBridgeDepositTx(t *testing.T, userAddr common.Address, amount *big.Int) *gethtypes.Transaction

func GenerateEthTxs

GenerateEthTxs generates an L1 attributes tx, deposit tx, and cosmos tx packed in an Ethereum transaction. The transactions are not meant to be executed.

func GenerateL1Block

func GenerateL1Block() *gethtypes.Block

func NewCometMemDB

func NewCometMemDB(t *testing.T) cometdb.DB

func NewLocalMemDB

func NewLocalMemDB(t *testing.T) *localdb.DB

func NewMemDB

func NewMemDB(t *testing.T) dbm.DB

func TxToBytes

func TxToBytes(t *testing.T, tx *gethtypes.Transaction) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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