sql

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetATXs

func GetATXs(db sql.Executor, atxIds []types.ATXID) (map[types.ATXID]*types.ActivationTx, []types.ATXID)

func Setup

func Setup(path string) (db sql.StateDatabase, err error)

Types

type Client

type Client struct{}

func (*Client) AccountsSnapshot

func (c *Client) AccountsSnapshot(db sql.Executor, lid types.LayerID) (rst []*types.Account, err error)

func (*Client) CountAtxsByEpoch added in v1.6.1

func (c *Client) CountAtxsByEpoch(db sql.Executor, epoch int64) (int, error)

func (*Client) GetAllRewards added in v1.4.0

func (c *Client) GetAllRewards(db sql.Executor) (rst []*types.Reward, err error)

func (*Client) GetAtxById added in v1.6.1

func (c *Client) GetAtxById(db sql.Executor, id string) (*types.ActivationTx, error)

func (*Client) GetAtxsByEpoch added in v1.5.7

func (c *Client) GetAtxsByEpoch(db sql.Executor, epoch int64, fn func(tx *types.ActivationTx) bool) error

func (*Client) GetAtxsByEpochPaginated added in v1.6.1

func (c *Client) GetAtxsByEpochPaginated(db sql.Executor, epoch, limit, offset int64, fn func(tx *types.ActivationTx) bool) error

func (*Client) GetAtxsReceivedAfter added in v1.5.0

func (c *Client) GetAtxsReceivedAfter(db sql.Executor, ts int64, fn func(tx *types.ActivationTx) bool) error

func (*Client) GetLayer

func (c *Client) GetLayer(db sql.Executor, lid types.LayerID, numLayers uint32) (*pb.Layer, error)

func (*Client) GetLayerRewards

func (c *Client) GetLayerRewards(db sql.Executor, lid types.LayerID) (rst []*types.Reward, err error)

type DatabaseClient

type DatabaseClient interface {
	GetLayer(db sql.Executor, lid types.LayerID, numLayers uint32) (*pb.Layer, error)
	GetLayerRewards(db sql.Executor, lid types.LayerID) (rst []*types.Reward, err error)
	GetAllRewards(db sql.Executor) (rst []*types.Reward, err error)
	AccountsSnapshot(db sql.Executor, lid types.LayerID) (rst []*types.Account, err error)
	GetAtxsReceivedAfter(db sql.Executor, ts int64, fn func(tx *types.ActivationTx) bool) error
	GetAtxsByEpoch(db sql.Executor, epoch int64, fn func(tx *types.ActivationTx) bool) error
	CountAtxsByEpoch(db sql.Executor, epoch int64) (int, error)
	GetAtxsByEpochPaginated(db sql.Executor, epoch, limit, offset int64, fn func(tx *types.ActivationTx) bool) error
	GetAtxById(db sql.Executor, id string) (*types.ActivationTx, error)
}

Jump to

Keyboard shortcuts

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