Documentation ¶
Index ¶
- Variables
- type CommittedBlock
- type CommittedTx
- type Config
- type ConfigError
- type MockStore
- func (m *MockStore) Account(addr crypto.Address) (*account.Account, error)
- func (m *MockStore) AccountByNumber(number int32) (*account.Account, error)
- func (m *MockStore) AddTestAccount() (*account.Account, crypto.Address)
- func (m *MockStore) AddTestBlock(height uint32) *block.Block
- func (m *MockStore) AddTestValidator() *validator.Validator
- func (m *MockStore) Block(height uint32) (*CommittedBlock, error)
- func (m *MockStore) BlockHash(height uint32) hash.Hash
- func (m *MockStore) BlockHeight(h hash.Hash) uint32
- func (*MockStore) Close()
- func (m *MockStore) HasAccount(addr crypto.Address) bool
- func (m *MockStore) HasAnyBlock() bool
- func (m *MockStore) HasPublicKey(addr crypto.Address) bool
- func (m *MockStore) HasValidator(addr crypto.Address) bool
- func (*MockStore) IsBanned(_ crypto.Address) bool
- func (*MockStore) IsPruned() bool
- func (m *MockStore) IterateAccounts(consumer func(crypto.Address, *account.Account) (stop bool))
- func (m *MockStore) IterateValidators(consumer func(*validator.Validator) (stop bool))
- func (m *MockStore) LastCertificate() *certificate.BlockCertificate
- func (*MockStore) Prune(_ func(_ bool, _ uint32) bool) error
- func (*MockStore) PruningHeight() uint32
- func (m *MockStore) PublicKey(addr crypto.Address) (crypto.PublicKey, error)
- func (m *MockStore) RandomTestAcc() (crypto.Address, *account.Account)
- func (m *MockStore) RandomTestVal() *validator.Validator
- func (m *MockStore) RecentTransaction(txID tx.ID) bool
- func (m *MockStore) SaveBlock(blk *block.Block, cert *certificate.BlockCertificate)
- func (m *MockStore) SortitionSeed(blockHeight uint32) *sortition.VerifiableSeed
- func (m *MockStore) TotalAccounts() int32
- func (m *MockStore) TotalValidators() int32
- func (m *MockStore) Transaction(txID tx.ID) (*CommittedTx, error)
- func (m *MockStore) UpdateAccount(addr crypto.Address, acc *account.Account)
- func (m *MockStore) UpdateValidator(val *validator.Validator)
- func (m *MockStore) Validator(addr crypto.Address) (*validator.Validator, error)
- func (m *MockStore) ValidatorAddresses() []crypto.Address
- func (m *MockStore) ValidatorByNumber(num int32) (*validator.Validator, error)
- func (*MockStore) WriteBatch() error
- type PublicKeyNotFoundError
- type Reader
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrBadOffset = errors.New("offset is out of range") )
Functions ¶
This section is empty.
Types ¶
type CommittedBlock ¶ added in v0.15.0
type CommittedTx ¶ added in v0.15.0
type Config ¶
type Config struct { Path string `toml:"path"` RetentionDays uint32 `toml:"retention_days"` // Private configs TxCacheWindow uint32 `toml:"-"` SeedCacheWindow uint32 `toml:"-"` AccountCacheSize int `toml:"-"` PublicKeyCacheSize int `toml:"-"` BannedAddrs map[crypto.Address]bool `toml:"-"` }
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) BasicCheck ¶ added in v0.15.0
BasicCheck performs basic checks on the configuration.
func (*Config) RetentionBlocks ¶ added in v1.4.0
type ConfigError ¶ added in v1.1.0
type ConfigError struct {
Reason string
}
ConfigError is returned when the store configuration is invalid.
func (ConfigError) Error ¶ added in v1.1.0
func (e ConfigError) Error() string
type MockStore ¶
type MockStore struct { Blocks map[uint32]*block.Block Accounts map[crypto.Address]*account.Account Validators map[crypto.Address]*validator.Validator LastCert *certificate.BlockCertificate LastHeight uint32 // contains filtered or unexported fields }
func MockingStore ¶
func (*MockStore) AccountByNumber ¶ added in v0.12.0
func (*MockStore) AddTestAccount ¶
func (*MockStore) AddTestValidator ¶
func (*MockStore) HasAnyBlock ¶
func (*MockStore) HasPublicKey ¶ added in v1.6.0
func (*MockStore) IterateAccounts ¶
func (*MockStore) IterateValidators ¶
func (*MockStore) LastCertificate ¶
func (m *MockStore) LastCertificate() *certificate.BlockCertificate
func (*MockStore) PruningHeight ¶ added in v1.4.0
func (*MockStore) RandomTestAcc ¶
func (*MockStore) RandomTestVal ¶
func (*MockStore) RecentTransaction ¶ added in v1.5.0
func (*MockStore) SaveBlock ¶
func (m *MockStore) SaveBlock(blk *block.Block, cert *certificate.BlockCertificate)
func (*MockStore) SortitionSeed ¶ added in v0.19.0
func (m *MockStore) SortitionSeed(blockHeight uint32) *sortition.VerifiableSeed
func (*MockStore) TotalAccounts ¶
func (*MockStore) TotalValidators ¶
func (*MockStore) Transaction ¶
func (m *MockStore) Transaction(txID tx.ID) (*CommittedTx, error)
func (*MockStore) UpdateAccount ¶
func (*MockStore) UpdateValidator ¶
func (*MockStore) ValidatorAddresses ¶ added in v0.12.0
func (*MockStore) ValidatorByNumber ¶
func (*MockStore) WriteBatch ¶
type PublicKeyNotFoundError ¶ added in v0.15.0
PublicKeyNotFoundError is returned when the public key associated with an address is not found in the store.
func (PublicKeyNotFoundError) Error ¶ added in v0.15.0
func (e PublicKeyNotFoundError) Error() string
type Reader ¶
type Reader interface { Block(height uint32) (*CommittedBlock, error) BlockHeight(h hash.Hash) uint32 BlockHash(height uint32) hash.Hash SortitionSeed(blockHeight uint32) *sortition.VerifiableSeed Transaction(txID tx.ID) (*CommittedTx, error) RecentTransaction(txID tx.ID) bool PublicKey(addr crypto.Address) (crypto.PublicKey, error) HasPublicKey(addr crypto.Address) bool HasAccount(crypto.Address) bool Account(addr crypto.Address) (*account.Account, error) TotalAccounts() int32 HasValidator(addr crypto.Address) bool ValidatorAddresses() []crypto.Address Validator(addr crypto.Address) (*validator.Validator, error) ValidatorByNumber(num int32) (*validator.Validator, error) IterateValidators(consumer func(*validator.Validator) (stop bool)) IterateAccounts(consumer func(crypto.Address, *account.Account) (stop bool)) TotalValidators() int32 LastCertificate() *certificate.BlockCertificate IsBanned(addr crypto.Address) bool IsPruned() bool PruningHeight() uint32 }
type Store ¶
Click to show internal directories.
Click to hide internal directories.