Documentation ¶
Index ¶
- type BlockResult
- type MockBlockStore
- func (bs *MockBlockStore) AssertExecuted(t *testing.T, alias string, block flow.Identifier)
- func (bs *MockBlockStore) AssertNotExecuted(t *testing.T, alias string, block flow.Identifier)
- func (bs *MockBlockStore) CreateBlockAndMockResult(t *testing.T, block *entity.ExecutableBlock) *execution.ComputationResult
- func (bs *MockBlockStore) GetExecuted(blockID flow.Identifier) (*BlockResult, error)
- func (bs *MockBlockStore) MarkExecuted(computationResult *execution.ComputationResult) error
- type MockCollectionStore
- func (m *MockCollectionStore) ByID(id flow.Identifier) (*flow.Collection, error)
- func (m *MockCollectionStore) LightByID(id flow.Identifier) (*flow.LightCollection, error)
- func (m *MockCollectionStore) LightByTransactionID(id flow.Identifier) (*flow.LightCollection, error)
- func (m *MockCollectionStore) Remove(id flow.Identifier) error
- func (m *MockCollectionStore) Store(c *flow.Collection) error
- func (m *MockCollectionStore) StoreLight(collection *flow.LightCollection) error
- func (m *MockCollectionStore) StoreLightAndIndexByTransaction(collection *flow.LightCollection) error
- type MockFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockResult ¶
type BlockResult struct { Block *entity.ExecutableBlock Result *execution.ComputationResult }
type MockBlockStore ¶
type MockBlockStore struct { sync.Mutex ResultByBlock map[flow.Identifier]*BlockResult Executed map[flow.Identifier]struct{} RootBlock *flow.Header }
MockBlockStore contains mocked block computation result it ensures that as blocks computation result are created, the block's start state is the same as its parent block's end state. it also stores which block is executed, so that the mock execution state or computer can determine what result to return
func NewMockBlockStore ¶
func NewMockBlockStore(t *testing.T) *MockBlockStore
func (*MockBlockStore) AssertExecuted ¶
func (bs *MockBlockStore) AssertExecuted(t *testing.T, alias string, block flow.Identifier)
func (*MockBlockStore) AssertNotExecuted ¶
func (bs *MockBlockStore) AssertNotExecuted(t *testing.T, alias string, block flow.Identifier)
func (*MockBlockStore) CreateBlockAndMockResult ¶
func (bs *MockBlockStore) CreateBlockAndMockResult(t *testing.T, block *entity.ExecutableBlock) *execution.ComputationResult
func (*MockBlockStore) GetExecuted ¶
func (bs *MockBlockStore) GetExecuted(blockID flow.Identifier) (*BlockResult, error)
func (*MockBlockStore) MarkExecuted ¶
func (bs *MockBlockStore) MarkExecuted(computationResult *execution.ComputationResult) error
type MockCollectionStore ¶
type MockCollectionStore struct {
// contains filtered or unexported fields
}
func NewMockCollectionStore ¶
func NewMockCollectionStore() *MockCollectionStore
func (*MockCollectionStore) ByID ¶
func (m *MockCollectionStore) ByID(id flow.Identifier) (*flow.Collection, error)
func (*MockCollectionStore) LightByID ¶
func (m *MockCollectionStore) LightByID(id flow.Identifier) (*flow.LightCollection, error)
func (*MockCollectionStore) LightByTransactionID ¶
func (m *MockCollectionStore) LightByTransactionID(id flow.Identifier) (*flow.LightCollection, error)
func (*MockCollectionStore) Remove ¶
func (m *MockCollectionStore) Remove(id flow.Identifier) error
func (*MockCollectionStore) Store ¶
func (m *MockCollectionStore) Store(c *flow.Collection) error
func (*MockCollectionStore) StoreLight ¶
func (m *MockCollectionStore) StoreLight(collection *flow.LightCollection) error
func (*MockCollectionStore) StoreLightAndIndexByTransaction ¶
func (m *MockCollectionStore) StoreLightAndIndexByTransaction(collection *flow.LightCollection) error
type MockFetcher ¶
type MockFetcher struct {
// contains filtered or unexported fields
}
func NewMockFetcher ¶
func NewMockFetcher() *MockFetcher
func (*MockFetcher) FetchCollection ¶
func (r *MockFetcher) FetchCollection(blockID flow.Identifier, height uint64, guarantee *flow.CollectionGuarantee) error
func (*MockFetcher) Force ¶
func (r *MockFetcher) Force()
func (*MockFetcher) IsFetched ¶
func (r *MockFetcher) IsFetched(id flow.Identifier) bool
Click to show internal directories.
Click to hide internal directories.