testutils

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalRandomProverEndpoint

func LocalRandomProverEndpoint() *url.URL

LocalRandomProverEndpoint returns a local free random prover endpoint.

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 RandomPort

func RandomPort() int

RandomPort returns a local free random port.

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
	ProverEndpoints []*url.URL
	AddressManager  *bindings.AddressManager
	// contains filtered or unexported fields
}

func (*ClientTestSuite) IncreaseTime

func (s *ClientTestSuite) IncreaseTime(time uint64)

func (*ClientTestSuite) MineL1Block added in v0.20.0

func (s *ClientTestSuite) MineL1Block()

func (*ClientTestSuite) NewTestProverServer added in v0.20.0

func (s *ClientTestSuite) NewTestProverServer(
	proverPrivKey *ecdsa.PrivateKey,
	url *url.URL,
) *server.ProverServer

NewTestProverServer starts a new prover server that has channel listeners to respond and react to requests for capacity, which provers can call.

func (*ClientTestSuite) ProposeAndInsertEmptyBlocks added in v0.20.0

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

func (*ClientTestSuite) ProposeAndInsertValidBlock added in v0.20.0

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

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

func (*ClientTestSuite) ProposeInvalidTxListBytes added in v0.20.0

func (s *ClientTestSuite) ProposeInvalidTxListBytes(proposer Proposer)

func (*ClientTestSuite) ProposeValidBlock added in v0.20.0

func (s *ClientTestSuite) ProposeValidBlock(
	proposer Proposer,
) *bindings.TaikoL1ClientBlockProposed

func (*ClientTestSuite) RevertL1Snapshot added in v0.20.0

func (s *ClientTestSuite) RevertL1Snapshot(snapshotID string)

func (*ClientTestSuite) SetL1Automine

func (s *ClientTestSuite) SetL1Automine(automine bool)

func (*ClientTestSuite) SetL1Snapshot added in v0.20.0

func (s *ClientTestSuite) SetL1Snapshot() string

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
	ProposeTxList(
		ctx context.Context,
		txListBytes []byte,
		txNum uint,
	) error
}

Jump to

Keyboard shortcuts

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