Documentation ¶
Index ¶
- type Facade
- type MockState
- func (m *MockState) AccountByAddress(addr crypto.Address) *account.Account
- func (m *MockState) AddPendingTx(trx *tx.Tx) error
- func (m *MockState) AddPendingTxAndBroadcast(trx *tx.Tx) error
- func (m *MockState) BlockHash(height uint32) hash.Hash
- func (m *MockState) BlockHeight(hash hash.Hash) uint32
- func (m *MockState) BlockTime() time.Duration
- func (m *MockState) Close() error
- func (m *MockState) CommitBlock(h uint32, b *block.Block, cert *block.Certificate) error
- func (m *MockState) CommitTestBlocks(num int)
- func (m *MockState) CommitteePower() int64
- func (m *MockState) CommitteeValidators() []*validator.Validator
- func (m *MockState) Fingerprint() string
- func (m *MockState) GenesisHash() hash.Hash
- func (m *MockState) IsInCommittee(addr crypto.Address) bool
- func (m *MockState) IsProposer(addr crypto.Address, round int16) bool
- func (m *MockState) IsValidator(addr crypto.Address) bool
- func (m *MockState) LastBlockHash() hash.Hash
- func (m *MockState) LastBlockHeight() uint32
- func (m *MockState) LastBlockTime() time.Time
- func (m *MockState) LastCertificate() *block.Certificate
- func (m *MockState) Params() param.Params
- func (m *MockState) PendingTx(id tx.ID) *tx.Tx
- func (m *MockState) ProposeBlock(_ crypto.Signer, _ crypto.Address, _ int16) (*block.Block, error)
- func (m *MockState) Proposer(round int16) *validator.Validator
- func (m *MockState) StoredBlock(height uint32) *store.StoredBlock
- func (m *MockState) StoredTx(id tx.ID) *store.StoredTx
- func (m *MockState) TotalAccounts() int32
- func (m *MockState) TotalPower() int64
- func (m *MockState) TotalValidators() int32
- func (m *MockState) UpdateLastCertificate(cert *block.Certificate) error
- func (m *MockState) ValidateBlock(_ *block.Block) error
- func (m *MockState) ValidatorByAddress(addr crypto.Address) *validator.Validator
- func (m *MockState) ValidatorByNumber(n int32) *validator.Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Facade ¶
type Facade interface { GenesisHash() hash.Hash LastBlockHeight() uint32 LastBlockHash() hash.Hash LastBlockTime() time.Time LastCertificate() *block.Certificate BlockTime() time.Duration UpdateLastCertificate(lastCertificate *block.Certificate) error ProposeBlock(consSigner crypto.Signer, rewardAddr crypto.Address, round int16) (*block.Block, error) ValidateBlock(block *block.Block) error CommitBlock(height uint32, block *block.Block, cert *block.Certificate) error CommitteeValidators() []*validator.Validator IsInCommittee(addr crypto.Address) bool Proposer(round int16) *validator.Validator IsProposer(addr crypto.Address, round int16) bool IsValidator(addr crypto.Address) bool TotalPower() int64 TotalAccounts() int32 TotalValidators() int32 CommitteePower() int64 PendingTx(id tx.ID) *tx.Tx AddPendingTx(trx *tx.Tx) error AddPendingTxAndBroadcast(trx *tx.Tx) error StoredBlock(height uint32) *store.StoredBlock StoredTx(id tx.ID) *store.StoredTx BlockHash(height uint32) hash.Hash BlockHeight(hash hash.Hash) uint32 AccountByAddress(addr crypto.Address) *account.Account ValidatorByAddress(addr crypto.Address) *validator.Validator ValidatorByNumber(number int32) *validator.Validator Params() param.Params Close() error Fingerprint() string }
type MockState ¶
type MockState struct { TestGenHash hash.Hash TestStore *store.MockStore TestPool *txpool.MockTxPool TestCommittee committee.Committee TestParams param.Params // contains filtered or unexported fields }
func MockingState ¶
func MockingState() *MockState
func (*MockState) AccountByAddress ¶
func (*MockState) AddPendingTxAndBroadcast ¶
func (*MockState) CommitBlock ¶
func (*MockState) CommitTestBlocks ¶
func (*MockState) CommitteePower ¶
func (*MockState) CommitteeValidators ¶
func (*MockState) Fingerprint ¶
func (*MockState) GenesisHash ¶
func (*MockState) IsProposer ¶
func (*MockState) LastBlockHash ¶
func (*MockState) LastBlockHeight ¶
func (*MockState) LastBlockTime ¶
func (*MockState) LastCertificate ¶
func (m *MockState) LastCertificate() *block.Certificate
func (*MockState) ProposeBlock ¶
func (*MockState) StoredBlock ¶
func (m *MockState) StoredBlock(height uint32) *store.StoredBlock
func (*MockState) TotalAccounts ¶ added in v0.10.0
func (*MockState) TotalPower ¶
func (*MockState) TotalValidators ¶ added in v0.10.0
func (*MockState) UpdateLastCertificate ¶
func (m *MockState) UpdateLastCertificate(cert *block.Certificate) error
func (*MockState) ValidatorByAddress ¶
Click to show internal directories.
Click to hide internal directories.