Documentation
¶
Index ¶
- type MockBlockchainStore
- func (bs *MockBlockchainStore) ArchiveBlock(archiveHeight uint64) error
- func (bs *MockBlockchainStore) GetArchivedPivot() uint64
- func (bs *MockBlockchainStore) GetBlockAt(height uint64) (*commonPb.Block, error)
- func (bs *MockBlockchainStore) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
- func (bs *MockBlockchainStore) GetHeightByHash(blockHash []byte) (uint64, error)
- func (bs *MockBlockchainStore) GetLastBlock() (*commonPb.Block, error)
- func (bs *MockBlockchainStore) GetTxHeight(txId string) (uint64, error)
- func (bs *MockBlockchainStore) ReadObject(contractName string, key []byte) ([]byte, error)
- func (bs *MockBlockchainStore) RestoreBlocks(serializedBlocks [][]byte) error
- func (bs *MockBlockchainStore) SaveBlock(block *commonPb.Block) error
- func (bs *MockBlockchainStore) WriteObject(contractName string, object []byte) error
- type MockCommitter
- type MockCoreEngine
- type MockLedger
- type MockNet
- type MockProposer
- func (p *MockProposer) ClearProposedBlockAt(height uint64)
- func (p *MockProposer) ClearTheBlock(block *commonPb.Block)
- func (b *MockProposer) CreateBlock(height uint64, perHash []byte) *commonPb.Block
- func (p *MockProposer) DiscardAboveHeight(baseHeight int64) []*commonPb.Block
- func (p *MockProposer) GetProposedBlock(b *commonPb.Block) (*commonPb.Block, map[string]*commonPb.TxRWSet)
- func (p *MockProposer) GetProposedBlockByHashAndHeight(hash []byte, height uint64) (*commonPb.Block, map[string]*commonPb.TxRWSet)
- func (p *MockProposer) GetProposedBlocksAt(height uint64) []*commonPb.Block
- func (p *MockProposer) GetSelfProposedBlockAt(height uint64) *commonPb.Block
- func (p *MockProposer) HasProposedBlockAt(height uint64) bool
- func (p *MockProposer) IsProposedAt(height uint64) bool
- func (p *MockProposer) KeepProposedBlock(hash []byte, height uint64) []*commonPb.Block
- func (p *MockProposer) ResetProposedAt(height uint64)
- func (p *MockProposer) SetProposedAt(height uint64)
- func (p *MockProposer) SetProposedBlock(b *commonPb.Block, rwSetMap map[string]*commonPb.TxRWSet, selfProposed bool) error
- type MockProtocolNetService
- type MockVerifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockBlockchainStore ¶
type MockBlockchainStore struct { mock.MockBlockchainStore // contains filtered or unexported fields }
func NewMockMockBlockchainStore ¶
func NewMockMockBlockchainStore(gensis *commonPb.Block, cf *chainconf.ChainConf) *MockBlockchainStore
func (*MockBlockchainStore) ArchiveBlock ¶
func (bs *MockBlockchainStore) ArchiveBlock(archiveHeight uint64) error
func (*MockBlockchainStore) GetArchivedPivot ¶
func (bs *MockBlockchainStore) GetArchivedPivot() uint64
func (*MockBlockchainStore) GetBlockAt ¶
func (bs *MockBlockchainStore) GetBlockAt(height uint64) (*commonPb.Block, error)
func (*MockBlockchainStore) GetBlockHeaderByHeight ¶
func (bs *MockBlockchainStore) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
func (*MockBlockchainStore) GetHeightByHash ¶
func (bs *MockBlockchainStore) GetHeightByHash(blockHash []byte) (uint64, error)
func (*MockBlockchainStore) GetLastBlock ¶
func (bs *MockBlockchainStore) GetLastBlock() (*commonPb.Block, error)
func (*MockBlockchainStore) GetTxHeight ¶
func (bs *MockBlockchainStore) GetTxHeight(txId string) (uint64, error)
func (*MockBlockchainStore) ReadObject ¶
func (bs *MockBlockchainStore) ReadObject(contractName string, key []byte) ([]byte, error)
func (*MockBlockchainStore) RestoreBlocks ¶
func (bs *MockBlockchainStore) RestoreBlocks(serializedBlocks [][]byte) error
func (*MockBlockchainStore) SaveBlock ¶
func (bs *MockBlockchainStore) SaveBlock(block *commonPb.Block) error
func (*MockBlockchainStore) WriteObject ¶
func (bs *MockBlockchainStore) WriteObject(contractName string, object []byte) error
type MockCommitter ¶
type MockCommitter struct {
// contains filtered or unexported fields
}
func NewMockCommitter ¶
func NewMockCommitter(ledgerCache protocol.LedgerCache, store *MockBlockchainStore, msgbus msgbus.MessageBus, log *logger.CMLogger, commitEventC chan uint64) *MockCommitter
type MockCoreEngine ¶
type MockCoreEngine struct { sync.Mutex msgbus.DefaultSubscriber Proposer *MockProposer Verifer *MockVerifier Committer *MockCommitter Ledger protocol.LedgerCache // contains filtered or unexported fields }
func NewMockCoreEngine ¶
func NewMockCoreEngine(t *testing.T, id string, chainid string, mb msgbus.MessageBus, ledger protocol.LedgerCache, store *MockBlockchainStore, iscreate bool) *MockCoreEngine
func (*MockCoreEngine) GetHeight ¶
func (ce *MockCoreEngine) GetHeight() uint64
func (*MockCoreEngine) GetID ¶
func (ce *MockCoreEngine) GetID() string
func (*MockCoreEngine) Loop ¶
func (ce *MockCoreEngine) Loop()
func (*MockCoreEngine) OnMessage ¶
func (ce *MockCoreEngine) OnMessage(msg *msgbus.Message)
func (*MockCoreEngine) String ¶
func (ce *MockCoreEngine) String() string
func (*MockCoreEngine) ToStringWithoutLock ¶
func (ce *MockCoreEngine) ToStringWithoutLock() string
type MockLedger ¶
type MockLedger struct {
// contains filtered or unexported fields
}
func (*MockLedger) CurrentHeight ¶
func (l *MockLedger) CurrentHeight() (uint64, error)
func (*MockLedger) GetLastCommittedBlock ¶
func (l *MockLedger) GetLastCommittedBlock() *commonPb.Block
func (*MockLedger) SetLastCommittedBlock ¶
func (l *MockLedger) SetLastCommittedBlock(block *commonPb.Block)
func (*MockLedger) SetLastProposedBlock ¶
func (l *MockLedger) SetLastProposedBlock(block *commonPb.Block)
type MockNet ¶
type MockNet struct { msgbus.DefaultSubscriber // contains filtered or unexported fields }
func NewMockNet ¶
func NewMockNet(id string, buses map[string]msgbus.MessageBus) *MockNet
type MockProposer ¶
func NewMockProposer ¶
func NewMockProposer(chainid string, id string, ledgerCache protocol.LedgerCache, msgbus msgbus.MessageBus, log *logger.CMLogger) *MockProposer
func (*MockProposer) ClearProposedBlockAt ¶
func (p *MockProposer) ClearProposedBlockAt(height uint64)
func (*MockProposer) ClearTheBlock ¶
func (p *MockProposer) ClearTheBlock(block *commonPb.Block)
func (*MockProposer) CreateBlock ¶
func (b *MockProposer) CreateBlock(height uint64, perHash []byte) *commonPb.Block
func (*MockProposer) DiscardAboveHeight ¶
func (p *MockProposer) DiscardAboveHeight(baseHeight int64) []*commonPb.Block
func (*MockProposer) GetProposedBlock ¶
func (*MockProposer) GetProposedBlockByHashAndHeight ¶
func (*MockProposer) GetProposedBlocksAt ¶
func (p *MockProposer) GetProposedBlocksAt(height uint64) []*commonPb.Block
func (*MockProposer) GetSelfProposedBlockAt ¶
func (p *MockProposer) GetSelfProposedBlockAt(height uint64) *commonPb.Block
func (*MockProposer) HasProposedBlockAt ¶
func (p *MockProposer) HasProposedBlockAt(height uint64) bool
func (*MockProposer) IsProposedAt ¶
func (p *MockProposer) IsProposedAt(height uint64) bool
func (*MockProposer) KeepProposedBlock ¶
func (p *MockProposer) KeepProposedBlock(hash []byte, height uint64) []*commonPb.Block
func (*MockProposer) ResetProposedAt ¶
func (p *MockProposer) ResetProposedAt(height uint64)
func (*MockProposer) SetProposedAt ¶
func (p *MockProposer) SetProposedAt(height uint64)
func (*MockProposer) SetProposedBlock ¶
type MockProtocolNetService ¶
type MockProtocolNetService struct { mock.MockNetService // contains filtered or unexported fields }
func NewMockProtocolNetService ¶
func NewMockProtocolNetService(nodeids map[string]string) *MockProtocolNetService
func (*MockProtocolNetService) AppendNodeID ¶
func (ns *MockProtocolNetService) AppendNodeID(certid string, nodeid string) error
func (*MockProtocolNetService) GetNodeUidByCertId ¶
func (ns *MockProtocolNetService) GetNodeUidByCertId(certid string) (string, error)
type MockVerifier ¶
type MockVerifier struct {
// contains filtered or unexported fields
}
func NewMockVerifier ¶
func NewMockVerifier(ledgerCache protocol.LedgerCache, msgBus msgbus.MessageBus, log *logger.CMLogger) *MockVerifier
func (*MockVerifier) GetLastProposedBlock ¶
func (*MockVerifier) VerifyBlock ¶
func (v *MockVerifier) VerifyBlock(block *commonPb.Block, mode protocol.VerifyMode) error
Click to show internal directories.
Click to hide internal directories.