mock

package
v0.4.5-sdk Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 18 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 {
	*settlement.Config
	DBPath         string `json:"db_path"`
	RootDir        string `json:"root_dir"`
	ProposerPubKey string `json:"proposer_pub_key"`
	// contains filtered or unexported fields
}

Config for the HubClient

type HubClient

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

HubClient implements The HubClient interface

func (*HubClient) GetBatchAtIndex

func (c *HubClient) GetBatchAtIndex(rollappID string, index uint64) (*settlement.ResultRetrieveBatch, error)

GetBatchAtIndex returns the batch at the given index

func (*HubClient) GetLatestBatch

func (c *HubClient) GetLatestBatch(rollappID string) (*settlement.ResultRetrieveBatch, error)

GetLatestBatch returns the latest batch from the kv store

func (*HubClient) GetSequencers

func (c *HubClient) GetSequencers(rollappID string) ([]*types.Sequencer, error)

GetSequencers returns a list of sequencers. Currently only returns a single sequencer

func (*HubClient) PostBatch

func (c *HubClient) PostBatch(batch *types.Batch, daClient da.Client, daResult *da.ResultSubmitBatch) (settlement.PostBatchResp, error)

PostBatch saves the batch to the kv store

func (*HubClient) Start

func (c *HubClient) Start() error

Start starts the mock client

func (*HubClient) Stop

func (c *HubClient) Stop() error

Stop stops the mock client

type PostBatchResp

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

PostBatchResp is the response from saving the batch

func (PostBatchResp) GetCode

func (s PostBatchResp) GetCode() uint32

GetCode returns the code

func (PostBatchResp) GetTxHash

func (s PostBatchResp) GetTxHash() string

GetTxHash returns the tx hash

type SettlementLayerClient

type SettlementLayerClient struct {
	*settlement.BaseLayerClient
}

SettlementLayerClient is an extension of the base settlement layer client for usage in tests and local development.

func (*SettlementLayerClient) Init

func (m *SettlementLayerClient) Init(config []byte, pubsub *pubsub.Server, logger log.Logger, options ...settlement.Option) error

Init initializes the mock layer client.

Jump to

Keyboard shortcuts

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