-
Notifications
You must be signed in to change notification settings - Fork 178
/
execution_data.go
36 lines (27 loc) · 1.22 KB
/
execution_data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package mempool
import (
"github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-go/module/executiondatasync/execution_data"
)
// ExecutionData represents a concurrency-safe memory pool for BlockExecutionData.
type ExecutionData interface {
// Has checks whether the block execution data for the given block ID is currently in
// the memory pool.
Has(flow.Identifier) bool
// Add adds a block execution data to the mempool, keyed by block ID.
// It returns false if the execution data was already in the mempool.
Add(*execution_data.BlockExecutionDataEntity) bool
// Remove removes block execution data from mempool by block ID.
// It returns true if the execution data was known and removed.
Remove(flow.Identifier) bool
// ByID returns the block execution data for the given block ID from the mempool.
// It returns false if the execution data was not found in the mempool.
ByID(flow.Identifier) (*execution_data.BlockExecutionDataEntity, bool)
// Size return the current size of the memory pool.
Size() uint
// All retrieves all execution data that are currently in the memory pool
// as a slice.
All() []*execution_data.BlockExecutionDataEntity
// Clear removes all execution data from the mempool.
Clear()
}