testutils

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProposeAndInsertEmptyBlocks added in v0.1.7

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

func ProposeAndInsertThrowawayBlock

func ProposeAndInsertThrowawayBlock(
	s *ClientTestSuite,
	proposer Proposer,
	calldataSyncer CalldataSyncer,
) *bindings.TaikoL1ClientBlockProposed

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

func ProposeAndInsertValidBlock

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

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

func ProposeInvalidTxListBytes added in v0.1.6

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 added in v0.1.6

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

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

Types

type CalldataSyncer added in v0.2.3

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) MineL1Confirmations

func (s *ClientTestSuite) MineL1Confirmations() error

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
	CommitTxList(ctx context.Context, txListBytes []byte, gasLimit uint64, splittedIdx int) (
		*bindings.TaikoDataBlockMetadata,
		*types.Transaction,
		error,
	)
	ProposeTxList(
		ctx context.Context,
		meta *bindings.TaikoDataBlockMetadata,
		commitTx *types.Transaction,
		txListBytes []byte,
		txNum uint,
	) error
}

Jump to

Keyboard shortcuts

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