store

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: LGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Init the store manager to load the erc20 list
	Init(ctx context.Context) error
	// FindERC20 finds the erc20 code
	FindERC20(ctx context.Context, address gethCommon.Address) (*model.ERC20, error)
	// InsertERC20 inserts the erc20 code
	InsertERC20(ctx context.Context, code *model.ERC20) error
	// InsertTd writes the total difficulty for a block
	InsertTd(ctx context.Context, data *model.TotalDifficulty) error
	// FindLatestBlock returns a latest header from db
	FindLatestBlock(ctx context.Context) (*model.Header, error)
	// FindBlockByNumber returns the header of the given block number
	FindBlockByNumber(ctx context.Context, number int64) (*model.Header, error)
	// FindTd returns the TD of the given block hash
	FindTd(ctx context.Context, hash []byte) (*model.TotalDifficulty, error)
	// UpdateBlocks updates all block data
	UpdateBlocks(ctx context.Context, balancer client.Balancer, blocks []*types.Block, receipts [][]*types.Receipt, events [][]*types.TransferLog, reorgEvent *model.Reorg) error
}

Manager is a wrapper interface to insert block, receipt and states quickly

func NewManager

func NewManager(db *sqlx.DB, chainConfig *params.ChainConfig) Manager

NewManager news a store manager to insert block, receipts and states.

Directories

Path Synopsis
mocks
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0
mocks
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0
mocks
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0
mocks
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0
mocks
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0
mocks
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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