Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrContractNotFound = errors.New("db: contract record not found") ErrFutureBlock = errors.New("db: block number is greater than last persisted block") )
Functions ¶
func NewSqliteDb ¶
Types ¶
type BlockChangeSet ¶
type BlockChangeSet struct {
BlockNumber *big.Int
GasPriceMinimum *big.Int
RegistryChanges []RegistryChange
}
type RegistryChange ¶
type RosettaDB ¶
type RosettaDB interface {
RosettaDBReader
RosettaDBWriter
}
type RosettaDBReader ¶
type RosettaDBReader interface {
// LastPersistedBlock will return the last block that was persisted
// In case of not block, it will return 0
LastPersistedBlock(ctx context.Context) (*big.Int, error)
// GasPriceMinimumOn return the gasPriceMinimum registered for that block
// In case of no value, will return with fallbackValue which is 0
GasPriceMinimumFor(ctx context.Context, block *big.Int) (*big.Int, error)
// RegistryAddressStartOf returns the address of the contract at the start of (block, tx)
// In case there's no record for that contract it will fail with ErrContractNotFound
RegistryAddressStartOf(ctx context.Context, block *big.Int, txIndex uint, contractName string) (common.Address, error)
// RegistryAddressesStartOf returns the address of the contracts at the start of (block, tx)
// For the case a contract is not yet deployed, that contract won't be in the result map
RegistryAddressesStartOf(ctx context.Context, block *big.Int, txIndex uint, contractName ...string) (map[string]common.Address, error)
}
type RosettaDBWriter ¶
type RosettaDBWriter interface {
ApplyChanges(ctx context.Context, changeSet *BlockChangeSet) error
}
Click to show internal directories.
Click to hide internal directories.