mock

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AutoUpdateBatches       bool          `json:"auto_update_batches"`
	AutoUpdateBatchInterval time.Duration `json:"auto_update_batch_interval"`
	BatchSize               uint64        `json:"batch_size"`
	LatestHeight            uint64        `json:"latest_height"`
	// The height at which the new batchSize started
	BatchOffsetHeight uint64 `json:"batch_offset_height"`
	DBPath            string `json:"db_path"`
	RootDir           string `json:"root_dir"`
	// contains filtered or unexported fields
}

Config for the SettlementLayerClient mock

type SettlementLayerClient

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

SettlementLayerClient is intended only for usage in tests.

func (*SettlementLayerClient) Init

func (s *SettlementLayerClient) Init(config []byte, pubsub *pubsub.Server, logger log.Logger) error

Init is called once. it initializes the struct members.

func (*SettlementLayerClient) RetrieveBatch

func (s *SettlementLayerClient) RetrieveBatch(slStateIndex ...uint64) (*settlement.ResultRetrieveBatch, error)

RetrieveBatch Gets the batch which contains the given stateIndex. Empty stateIndex returns the latest batch.

func (*SettlementLayerClient) Start

func (s *SettlementLayerClient) Start() error

Start is called once, after init. If configured so, it will start producing batches every interval.

func (*SettlementLayerClient) Stop

func (s *SettlementLayerClient) Stop() error

Stop is called once, after Start. it cancels the auto batches created, if such was started.

func (*SettlementLayerClient) SubmitBatch

func (s *SettlementLayerClient) SubmitBatch(batch *types.Batch, daClient da.Client, daResult *da.ResultSubmitBatch) *settlement.ResultSubmitBatch

SubmitBatch submits the batch to the settlement layer. This should create a transaction which (potentially) triggers a state transition in the settlement layer.

Jump to

Keyboard shortcuts

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