testutils

package
v0.0.0-...-1d04f91 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DepositEtherToL2

func DepositEtherToL2(s *ClientTestSuite, depositerPrivKey *ecdsa.PrivateKey)

func ProposeAndInsertEmptyBlocks

func ProposeAndInsertEmptyBlocks(
	s *ClientTestSuite,
	proposer Proposer,
	calldataSyncer CalldataSyncer,
) []*bindings.MxcL1ClientBlockProposed

func ProposeAndInsertValidBlock

func ProposeAndInsertValidBlock(
	s *ClientTestSuite,
	proposer Proposer,
	calldataSyncer CalldataSyncer,
) *bindings.MxcL1ClientBlockProposed

ProposeAndInsertValidBlock proposes an valid tx list and then insert it into L2 execution engine's local chain.

func ProposeInvalidTxListBytes

func ProposeInvalidTxListBytes(s *ClientTestSuite, proposer Proposer)

func RandomBytes

func RandomBytes(size int) (b []byte)

RandomBytes generates a random bytes.

func RandomHash

func RandomHash() common.Hash

RandomHash generates a random blob of data and returns it as a hash.

func SignatureFromRSV

func SignatureFromRSV(r, s string, v byte) []byte

SignatureFromRSV creates the signature bytes from r,s,v.

Types

type CalldataSyncer

type CalldataSyncer interface {
	ProcessL1Blocks(ctx context.Context, l1End *types.Header) error
}

type ClientTestSuite

type ClientTestSuite struct {
	suite.Suite

	RpcClient       *rpc.Client
	TestAddrPrivKey *ecdsa.PrivateKey
	TestAddr        common.Address
	// contains filtered or unexported fields
}

func (*ClientTestSuite) SetupTest

func (s *ClientTestSuite) SetupTest()

func (*ClientTestSuite) TearDownTest

func (s *ClientTestSuite) TearDownTest()

type Proposer

type Proposer interface {
	utils.SubcommandApplication
	ProposeOp(ctx context.Context) error
	ProposeEmptyBlockOp(ctx context.Context) error
	L2SuggestedFeeRecipient() common.Address
	ProposeTxList(
		ctx context.Context,
		meta *encoding.MxcL1BlockMetadataInput,
		txListBytes []byte,
		txNum uint,
		nonce *uint64,
	) error
}

Jump to

Keyboard shortcuts

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