Documentation ¶
Index ¶
- type Config
- type MockStore
- func (m *MockStore) Account(addr crypto.Address) (*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) FindBlockHashByStamp(stamp hash.Stamp) (hash.Hash, bool)
- func (m *MockStore) FindBlockHeightByStamp(stamp hash.Stamp) (uint32, bool)
- 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) 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) 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 ¶
This section is empty.
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) AddTestAccount ¶
func (*MockStore) AddTestValidator ¶
func (*MockStore) FindBlockHashByStamp ¶
func (*MockStore) FindBlockHeightByStamp ¶
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) TotalAccounts ¶
func (*MockStore) TotalValidators ¶
func (*MockStore) UpdateAccount ¶
func (*MockStore) UpdateValidator ¶
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 // It only remembers most recent stamps FindBlockHashByStamp(stamp hash.Stamp) (hash.Hash, bool) // It only remembers most recent stamps FindBlockHeightByStamp(stamp hash.Stamp) (uint32, bool) Transaction(id tx.ID) (*StoredTx, error) HasAccount(crypto.Address) bool Account(addr crypto.Address) (*account.Account, error) TotalAccounts() int32 HasValidator(crypto.Address) bool 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.