helpers

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproveTokens added in v0.0.2

func ApproveTokens(
	t *testing.T,
	ac *accounts.Account,
	spender common.Address,
	tokenABI abi.ABI,
) (*types.Transaction, common.Hash, error)

ApproveTokens approves max uint256 of tokens to the spender. It is used in normal tests for approving tokens from spawned accounts for the bridge contract.

func DefaultApproveTokens added in v0.0.2

func DefaultApproveTokens(
	ctx context.Context,
	ac *accounts.Account,
	spender common.Address,
	tokenABI abi.ABI,
) (*types.Transaction, common.Hash, error)

DefaultApproveTokens approves for the main accounts the maximum amount of tokens to the spender. It is used in config.go without testing context to be sure the main accounts always have the maximum amount of tokens approved.

func SendBridgeTx

func SendBridgeTx(
	t *testing.T,
	ac1 *accounts.Account,
	ac2 *accounts.Account,
	amount *big.Int,
	tokenABI abi.ABI,
	bridgeABI abi.ABI,
) (*types.Transaction, *types.Transaction, error)

SendBridgeTx sends a bridge transaction from ac1 to ac2 with the given amount

func SendBridgeTxWithNonce

func SendBridgeTxWithNonce(
	t *testing.T,
	ac1 *accounts.Account,
	ac1_nonce uint64,
	ac2 *accounts.Account,
	ac2_nonce uint64,
	amount *big.Int,
	tokenABI abi.ABI,
	bridgeABI abi.ABI,

) (*types.Transaction, *types.Transaction, error)

SendBridgeTxWithStartingNonce sends a bridge transaction from ac1 to ac2 with the given amount and starting nonce. Can be used to send multiple bridge txs from same account with different nonces.

func SendMintTx

func SendMintTx(t *testing.T, ac *accounts.Account, amount *big.Int, tokenABI abi.ABI) (*types.Transaction, common.Hash, error)

MintTokens mints tokens to the given account

func SendSelfMoveBalanceTx added in v0.0.2

func SendSelfMoveBalanceTx(ctx context.Context, ac *accounts.Account, amount *big.Int) (*types.Transaction, common.Hash, error)

func SendSelfMoveBalanceTxWithNonce added in v0.0.2

func SendSelfMoveBalanceTxWithNonce(ctx context.Context, ac *accounts.Account, nonce uint64, amount *big.Int) (*types.Transaction, common.Hash, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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