Documentation ¶
Index ¶
- Variables
- 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.Signer)
- func (m *MockStore) AddTestBlock(height uint32) *block.Block
- func (m *MockStore) AddTestValidator() *validator.Validator
- func (m *MockStore) Block(height uint32) (*StoredBlock, 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() (uint32, *block.Certificate)
- func (m *MockStore) RandomTestAcc() (crypto.Address, *account.Account)
- func (m *MockStore) RandomTestVal() *validator.Validator
- func (m *MockStore) RecentBlockByStamp(stamp hash.Stamp) (uint32, *block.Block)
- func (m *MockStore) SaveBlock(height uint32, b *block.Block, cert *block.Certificate)
- func (m *MockStore) TotalAccounts() int32
- func (m *MockStore) TotalValidators() int32
- func (m *MockStore) Transaction(id tx.ID) (*StoredTx, 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 Reader
- type Store
- type StoredBlock
- type StoredTx
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 Config ¶
type Config struct {
Path string `toml:"path"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) SanityCheck ¶
SanityCheck 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 *block.Certificate LastHeight uint32 }
func MockingStore ¶
func MockingStore() *MockStore
func (*MockStore) AccountByNumber ¶ added in v0.12.0
func (*MockStore) AddTestAccount ¶
func (*MockStore) AddTestValidator ¶
func (*MockStore) HasAnyBlock ¶
func (*MockStore) IterateAccounts ¶
func (*MockStore) IterateValidators ¶
func (*MockStore) LastCertificate ¶
func (m *MockStore) LastCertificate() (uint32, *block.Certificate)
func (*MockStore) RandomTestAcc ¶
func (*MockStore) RandomTestVal ¶
func (*MockStore) RecentBlockByStamp ¶ added in v0.12.0
func (*MockStore) TotalAccounts ¶
func (*MockStore) TotalValidators ¶
func (*MockStore) UpdateAccount ¶
func (*MockStore) UpdateValidator ¶
func (*MockStore) ValidatorAddresses ¶ added in v0.12.0
func (*MockStore) ValidatorByNumber ¶
func (*MockStore) WriteBatch ¶
type Reader ¶
type Reader interface { Block(height uint32) (*StoredBlock, error) BlockHeight(hash hash.Hash) uint32 BlockHash(height uint32) hash.Hash RecentBlockByStamp(stamp hash.Stamp) (uint32, *block.Block) Transaction(id tx.ID) (*StoredTx, error) HasAccount(crypto.Address) bool Account(addr crypto.Address) (*account.Account, error) AccountByNumber(number int32) (*account.Account, error) TotalAccounts() int32 HasValidator(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() (uint32, *block.Certificate) }
type Store ¶
type StoredBlock ¶
func (*StoredBlock) ToBlock ¶
func (s *StoredBlock) ToBlock() *block.Block
Click to show internal directories.
Click to hide internal directories.