agglayer

package
v0.5.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAgglayerRateLimitExceeded = errors.New("agglayer rate limit exceeded")

Functions

This section is empty.

Types

type AggLayerClient

type AggLayerClient struct {
	// contains filtered or unexported fields
}

AggLayerClient is the client that will be used to interact with the AggLayer

func NewAggLayerClient

func NewAggLayerClient(url string) *AggLayerClient

NewAggLayerClient returns a client ready to be used

func (*AggLayerClient) SendTx

func (c *AggLayerClient) SendTx(signedTx SignedTx) (common.Hash, error)

SendTx sends a signed transaction to the AggLayer

func (*AggLayerClient) WaitTxToBeMined

func (c *AggLayerClient) WaitTxToBeMined(hash common.Hash, ctx context.Context) error

WaitTxToBeMined waits for a transaction to be mined

type AggLayerClientGetEpochConfiguration

type AggLayerClientGetEpochConfiguration interface {
	GetEpochConfiguration(ctx context.Context) (*types.ClockConfiguration, error)
}

type AggLayerClientRecoveryQuerier added in v0.0.2

type AggLayerClientRecoveryQuerier interface {
	GetLatestSettledCertificateHeader(ctx context.Context, networkID uint32) (*types.CertificateHeader, error)
	GetLatestPendingCertificateHeader(ctx context.Context, networkID uint32) (*types.CertificateHeader, error)
}

type AgglayerClientInterface

type AgglayerClientInterface interface {
	SendCertificate(ctx context.Context, certificate *types.Certificate) (common.Hash, error)
	GetCertificateHeader(ctx context.Context, certificateHash common.Hash) (*types.CertificateHeader, error)
	AggLayerClientGetEpochConfiguration
	AggLayerClientRecoveryQuerier
}

AgglayerClientInterface is the interface that defines the methods that the AggLayerClient will implement

type AgglayerClientMock

type AgglayerClientMock struct {
	mock.Mock
}

AgglayerClientMock is an autogenerated mock type for the AgglayerClientInterface type

func NewAgglayerClientMock

func NewAgglayerClientMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *AgglayerClientMock

NewAgglayerClientMock creates a new instance of AgglayerClientMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*AgglayerClientMock) EXPECT

func (*AgglayerClientMock) GetCertificateHeader

func (_m *AgglayerClientMock) GetCertificateHeader(ctx context.Context, certificateHash common.Hash) (*types.CertificateHeader, error)

GetCertificateHeader provides a mock function with given fields: ctx, certificateHash

func (*AgglayerClientMock) GetEpochConfiguration

func (_m *AgglayerClientMock) GetEpochConfiguration(ctx context.Context) (*types.ClockConfiguration, error)

GetEpochConfiguration provides a mock function with given fields: ctx

func (*AgglayerClientMock) GetLatestPendingCertificateHeader added in v0.0.2

func (_m *AgglayerClientMock) GetLatestPendingCertificateHeader(ctx context.Context, networkID uint32) (*types.CertificateHeader, error)

GetLatestPendingCertificateHeader provides a mock function with given fields: ctx, networkID

func (*AgglayerClientMock) GetLatestSettledCertificateHeader added in v0.0.2

func (_m *AgglayerClientMock) GetLatestSettledCertificateHeader(ctx context.Context, networkID uint32) (*types.CertificateHeader, error)

GetLatestSettledCertificateHeader provides a mock function with given fields: ctx, networkID

func (*AgglayerClientMock) SendCertificate

func (_m *AgglayerClientMock) SendCertificate(ctx context.Context, certificate *types.Certificate) (common.Hash, error)

SendCertificate provides a mock function with given fields: ctx, certificate

type AgglayerClientMock_Expecter

type AgglayerClientMock_Expecter struct {
	// contains filtered or unexported fields
}

func (*AgglayerClientMock_Expecter) GetCertificateHeader

func (_e *AgglayerClientMock_Expecter) GetCertificateHeader(ctx interface{}, certificateHash interface{}) *AgglayerClientMock_GetCertificateHeader_Call

GetCertificateHeader is a helper method to define mock.On call

  • ctx context.Context
  • certificateHash common.Hash

func (*AgglayerClientMock_Expecter) GetEpochConfiguration

func (_e *AgglayerClientMock_Expecter) GetEpochConfiguration(ctx interface{}) *AgglayerClientMock_GetEpochConfiguration_Call

GetEpochConfiguration is a helper method to define mock.On call

  • ctx context.Context

func (*AgglayerClientMock_Expecter) GetLatestPendingCertificateHeader added in v0.0.2

func (_e *AgglayerClientMock_Expecter) GetLatestPendingCertificateHeader(ctx interface{}, networkID interface{}) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call

GetLatestPendingCertificateHeader is a helper method to define mock.On call

  • ctx context.Context
  • networkID uint32

func (*AgglayerClientMock_Expecter) GetLatestSettledCertificateHeader added in v0.0.2

func (_e *AgglayerClientMock_Expecter) GetLatestSettledCertificateHeader(ctx interface{}, networkID interface{}) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call

GetLatestSettledCertificateHeader is a helper method to define mock.On call

  • ctx context.Context
  • networkID uint32

func (*AgglayerClientMock_Expecter) SendCertificate

func (_e *AgglayerClientMock_Expecter) SendCertificate(ctx interface{}, certificate interface{}) *AgglayerClientMock_SendCertificate_Call

SendCertificate is a helper method to define mock.On call

  • ctx context.Context
  • certificate *types.Certificate

type AgglayerClientMock_GetCertificateHeader_Call

type AgglayerClientMock_GetCertificateHeader_Call struct {
	*mock.Call
}

AgglayerClientMock_GetCertificateHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCertificateHeader'

func (*AgglayerClientMock_GetCertificateHeader_Call) Return

func (*AgglayerClientMock_GetCertificateHeader_Call) Run

func (*AgglayerClientMock_GetCertificateHeader_Call) RunAndReturn

type AgglayerClientMock_GetEpochConfiguration_Call

type AgglayerClientMock_GetEpochConfiguration_Call struct {
	*mock.Call
}

AgglayerClientMock_GetEpochConfiguration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEpochConfiguration'

func (*AgglayerClientMock_GetEpochConfiguration_Call) Return

func (*AgglayerClientMock_GetEpochConfiguration_Call) Run

func (*AgglayerClientMock_GetEpochConfiguration_Call) RunAndReturn

type AgglayerClientMock_GetLatestPendingCertificateHeader_Call added in v0.0.2

type AgglayerClientMock_GetLatestPendingCertificateHeader_Call struct {
	*mock.Call
}

AgglayerClientMock_GetLatestPendingCertificateHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestPendingCertificateHeader'

func (*AgglayerClientMock_GetLatestPendingCertificateHeader_Call) Return added in v0.0.2

func (*AgglayerClientMock_GetLatestPendingCertificateHeader_Call) Run added in v0.0.2

func (*AgglayerClientMock_GetLatestPendingCertificateHeader_Call) RunAndReturn added in v0.0.2

type AgglayerClientMock_GetLatestSettledCertificateHeader_Call added in v0.0.2

type AgglayerClientMock_GetLatestSettledCertificateHeader_Call struct {
	*mock.Call
}

AgglayerClientMock_GetLatestSettledCertificateHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestSettledCertificateHeader'

func (*AgglayerClientMock_GetLatestSettledCertificateHeader_Call) Return added in v0.0.2

func (*AgglayerClientMock_GetLatestSettledCertificateHeader_Call) Run added in v0.0.2

func (*AgglayerClientMock_GetLatestSettledCertificateHeader_Call) RunAndReturn added in v0.0.2

type AgglayerClientMock_SendCertificate_Call

type AgglayerClientMock_SendCertificate_Call struct {
	*mock.Call
}

AgglayerClientMock_SendCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCertificate'

func (*AgglayerClientMock_SendCertificate_Call) Return

func (*AgglayerClientMock_SendCertificate_Call) Run

func (*AgglayerClientMock_SendCertificate_Call) RunAndReturn

type SignedTx

type SignedTx struct {
	Tx        Tx             `json:"tx"`
	Signature types.ArgBytes `json:"signature"`
}

SignedTx is the struct that contains the signed batch transaction

func (*SignedTx) Signer

func (s *SignedTx) Signer() (common.Address, error)

Signer returns the address of the signer

type Tx

type Tx struct {
	RollupID          uint32
	LastVerifiedBatch types.ArgUint64 `json:"lastVerifiedBatch"`
	NewVerifiedBatch  types.ArgUint64 `json:"newVerifiedBatch"`
	ZKP               ZKP             `json:"ZKP"`
}

Tx is the struct that contains the verified batch transaction

func (*Tx) Hash

func (t *Tx) Hash() common.Hash

Hash returns a hash that uniquely identifies the tx

func (*Tx) Sign

func (t *Tx) Sign(privateKey *ecdsa.PrivateKey) (*SignedTx, error)

Sign returns a signed batch by the private key

type ZKP

type ZKP struct {
	NewStateRoot     common.Hash    `json:"newStateRoot"`
	NewLocalExitRoot common.Hash    `json:"newLocalExitRoot"`
	Proof            types.ArgBytes `json:"proof"`
}

ZKP is the struct that contains the zero-knowledge proof

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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