Documentation ¶
Index ¶
- Variables
- type CommittedBlock
- type CommittedTx
- type Config
- 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) AnyRecentTransaction(id tx.ID) bool
- func (m *MockStore) Block(height uint32) (*CommittedBlock, error)
- func (m *MockStore) BlockHash(height uint32) hash.Hash
- func (m *MockStore) BlockHeight(hash hash.Hash) uint32
- func (m *MockStore) Close() error
- func (m *MockStore) HasAccount(addr crypto.Address) bool
- func (m *MockStore) HasAnyBlock() bool
- func (m *MockStore) HasValidator(addr crypto.Address) 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.Certificate
- func (m *MockStore) PublicKey(addr crypto.Address) (*bls.PublicKey, error)
- func (m *MockStore) RandomTestAcc() (crypto.Address, *account.Account)
- func (m *MockStore) RandomTestVal() *validator.Validator
- func (m *MockStore) SaveBlock(b *block.Block, cert *certificate.Certificate)
- func (m *MockStore) TotalAccounts() int32
- func (m *MockStore) TotalValidators() int32
- func (m *MockStore) Transaction(id 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 (m *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"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) BasicCheck ¶ added in v0.15.0
BasicCheck performs basic checks on the configuration.
type MockStore ¶
type MockStore struct { Blocks map[uint32]*block.Block Accounts map[crypto.Address]*account.Account Validators map[crypto.Address]*validator.Validator LastCert *certificate.Certificate 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) AnyRecentTransaction ¶ added in v0.15.0
func (*MockStore) HasAnyBlock ¶
func (*MockStore) IterateAccounts ¶
func (*MockStore) IterateValidators ¶
func (*MockStore) LastCertificate ¶
func (m *MockStore) LastCertificate() *certificate.Certificate
func (*MockStore) RandomTestAcc ¶
func (*MockStore) RandomTestVal ¶
func (*MockStore) SaveBlock ¶
func (m *MockStore) SaveBlock(b *block.Block, cert *certificate.Certificate)
func (*MockStore) TotalAccounts ¶
func (*MockStore) TotalValidators ¶
func (*MockStore) Transaction ¶
func (m *MockStore) Transaction(id 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(hash hash.Hash) uint32 BlockHash(height uint32) hash.Hash Transaction(id tx.ID) (*CommittedTx, error) AnyRecentTransaction(id tx.ID) bool PublicKey(addr crypto.Address) (*bls.PublicKey, error) 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.Certificate }
Click to show internal directories.
Click to hide internal directories.