Documentation
¶
Index ¶
- type Batch
- type DummySequencer
- func (s *DummySequencer) GetNextBatch(ctx context.Context, req GetNextBatchRequest) (*GetNextBatchResponse, error)
- func (s *DummySequencer) SubmitBatchTxs(ctx context.Context, req SubmitBatchTxsRequest) (*SubmitBatchTxsResponse, error)
- func (s *DummySequencer) VerifyBatch(ctx context.Context, req VerifyBatchRequest) (*VerifyBatchResponse, error)
- type GetNextBatchRequest
- type GetNextBatchResponse
- type Sequencer
- type SubmitBatchTxsRequest
- type SubmitBatchTxsResponse
- type VerifyBatchRequest
- type VerifyBatchResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummySequencer ¶
type DummySequencer struct {
// contains filtered or unexported fields
}
DummySequencer is a dummy implementation of the Sequencer interface for testing
func NewDummySequencer ¶
func NewDummySequencer() *DummySequencer
NewDummySequencer creates a new dummy Sequencer instance
func (*DummySequencer) GetNextBatch ¶
func (s *DummySequencer) GetNextBatch(ctx context.Context, req GetNextBatchRequest) (*GetNextBatchResponse, error)
GetNextBatch gets the next batch from the sequencer
func (*DummySequencer) SubmitBatchTxs ¶
func (s *DummySequencer) SubmitBatchTxs(ctx context.Context, req SubmitBatchTxsRequest) (*SubmitBatchTxsResponse, error)
SubmitBatchTxs submits a batch of transactions to the sequencer
func (*DummySequencer) VerifyBatch ¶
func (s *DummySequencer) VerifyBatch(ctx context.Context, req VerifyBatchRequest) (*VerifyBatchResponse, error)
VerifyBatch verifies a batch of transactions received from the sequencer
type GetNextBatchRequest ¶
GetNextBatchRequest is a request to get the next batch of transactions from sequencer to chain
type GetNextBatchResponse ¶
GetNextBatchResponse is a response to getting the next batch of transactions from sequencer to chain
type Sequencer ¶
type Sequencer interface {
// SubmitBatchTxs submits a batch of transactions from to sequencer
// Id is the unique identifier for the target chain
// Batch is the batch of transactions to submit
// returns an error if any from the sequencer
SubmitBatchTxs(ctx context.Context, req SubmitBatchTxsRequest) (*SubmitBatchTxsResponse, error)
// GetNextBatch returns the next batch of transactions from sequencer to
// Id is the unique identifier for the target chain
// LastBatchHash is the cryptographic hash of the last batch received by the
// MaxBytes is the maximum number of bytes to return in the batch
// returns the next batch of transactions and an error if any from the sequencer
GetNextBatch(ctx context.Context, req GetNextBatchRequest) (*GetNextBatchResponse, error)
// VerifyBatch verifies a batch of transactions received from the sequencer
// Id is the unique identifier for the target chain
// BatchHash is the cryptographic hash of the batch to verify
// returns a boolean indicating if the batch is valid and an error if any from the sequencer
VerifyBatch(ctx context.Context, req VerifyBatchRequest) (*VerifyBatchResponse, error)
}
Sequencer is a generic interface for a sequencer
type SubmitBatchTxsRequest ¶
SubmitBatchTxsRequest is a request to submit a batch of transactions from chain to sequencer
type SubmitBatchTxsResponse ¶
type SubmitBatchTxsResponse struct {
}
SubmitBatchTxsResponse is a response to submitting a batch of transactions from chain to sequencer
type VerifyBatchRequest ¶
VerifyBatchRequest is a request to verify a batch of transactions received from the sequencer
type VerifyBatchResponse ¶
type VerifyBatchResponse struct {
Status bool
}
VerifyBatchResponse is a response to verifying a batch of transactions received from the sequencer