evm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AdminRole = common.HexToHash("0xa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775")
View Source
var ExecutorRole = common.HexToHash("0xd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63")

Functions

func CancelBatch

func CancelBatch(
	t *testing.T,
	ctx context.Context, transactor *bind.TransactOpts, backend Backend,
	timelockContract *contracts.RBACTimelock, operationID [32]byte,
) (
	*types.Transaction, *types.Receipt,
)

func DeployCallProxy

func DeployCallProxy(
	t *testing.T, ctx context.Context, transactor *bind.TransactOpts, backend Backend, timelockAddress common.Address,
) (
	common.Address, *types.Transaction, *types.Receipt, *contracts.CallProxy,
)

func DeployStorage

func DeployStorage(
	t *testing.T, ctx context.Context, transactor *bind.TransactOpts, backend Backend,
) (
	common.Address, *types.Transaction, *types.Receipt, *test_contracts.StorageContract,
)

func DeployTimelock

func DeployTimelock(
	t *testing.T, ctx context.Context, transactor *bind.TransactOpts, backend Backend,
	adminAccount common.Address, minDelay *big.Int,
) (
	common.Address, *types.Transaction, *types.Receipt, *contracts.RBACTimelock,
)

func ExecuteBatch

func ExecuteBatch(
	t *testing.T, ctx context.Context, transactor *bind.TransactOpts, backend Backend,
	timelockContract *contracts.RBACTimelock, calls []contracts.RBACTimelockCall,
	predecessor [32]byte, salt [32]byte,
) (
	*types.Transaction, *types.Receipt,
)

func ScheduleBatch

func ScheduleBatch(
	t *testing.T,
	ctx context.Context, transactor *bind.TransactOpts, backend Backend,
	timelockContract *contracts.RBACTimelock, calls []contracts.RBACTimelockCall,
	predecessor [32]byte, salt [32]byte, delay *big.Int,
) (
	*types.Transaction, *types.Receipt,
)

func SendTransaction

func SendTransaction(
	t *testing.T, ctx context.Context, transactor *bind.TransactOpts, backend Backend,
	account TestAccount, chainID *big.Int, value *big.Int, to common.Address, data []byte,
)

func UpdateDelay

func UpdateDelay(
	t *testing.T, ctx context.Context, transactor *bind.TransactOpts, backend Backend,
	timelockContract *contracts.RBACTimelock, delay *big.Int,
) (
	*types.Transaction, *types.Receipt,
)

Types

type Backend

type Backend interface {
	simulated.Client
	Commit() common.Hash
}

func NewRPCBackend

func NewRPCBackend(t *testing.T, ctx context.Context, url string) Backend

func NewSimulatedBackend

func NewSimulatedBackend(t *testing.T, genesisAlloc types.GenesisAlloc) Backend

type TestAccount

type TestAccount struct {
	Address       common.Address
	HexAddress    string
	PrivateKey    *ecdsa.PrivateKey
	HexPrivateKey string
}

TestAccount is data type wrapping attributes typically needed when managing ethereum accounts.

func NewTestAccount

func NewTestAccount(t *testing.T) TestAccount

NewTestAccount generates a new ecdsa key and returns a TestAccount structure with the associated attributes.

func (TestAccount) String

func (ta TestAccount) String() string

Jump to

Keyboard shortcuts

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