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(balancer client.Balancer) error // FindERC20 finds the erc20 code FindERC20(address gethCommon.Address) (*model.ERC20, error) // InsertERC20 inserts the erc20 code InsertERC20(code *model.ERC20) error // InsertTd writes the total difficulty for a block InsertTd(block *types.Block, td *big.Int) error // LatestHeader returns a latest header from db LatestHeader() (*model.Header, error) // GetHeaderByNumber returns the header of the given block number GetHeaderByNumber(number int64) (*model.Header, error) // GetTd returns the TD of the given block hash GetTd(hash []byte) (*model.TotalDifficulty, error) // UpdateBlocks updates all block data. 'delete' indicates whether deletes all data before update. UpdateBlocks(ctx context.Context, blocks []*types.Block, receipts [][]*types.Receipt, events [][]*types.TransferLog, mode UpdateMode) error }
Manager is a wrapper interface to insert block, receipt and states quickly
func NewManager ¶
NewManager news a store manager to insert block, receipts and states.
type UpdateMode ¶
type UpdateMode = int
UpdateMode defines the mode to update blocks
const ( // ModeReOrg represents update blocks by reorg // Stop if any errors occur. ModeReOrg UpdateMode = iota // ModeSync represents update blocks by ethereum sync // Stop if any errors occur, but return nil error if it's a duplicate error ModeSync )
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
|
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 |
Click to show internal directories.
Click to hide internal directories.