github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/mempool/results.go (about) 1 package mempool 2 3 import ( 4 "github.com/onflow/flow-go/model/flow" 5 ) 6 7 // Results represents a concurrency-safe memory pool for execution results. 8 type Results interface { 9 10 // Has will check if the given result is in the memory pool. 11 Has(resultID flow.Identifier) bool 12 13 // Add will add the given execution result to the memory pool. It will return 14 // false if it was already in the mempool. 15 Add(result *flow.ExecutionResult) bool 16 17 // Remove will attempt to remove the result from the memory pool. 18 Remove(resultID flow.Identifier) bool 19 20 // ByID retrieve the execution result with the given ID from the memory pool. 21 // It will return false if it was not found in the mempool. 22 ByID(resultID flow.Identifier) (*flow.ExecutionResult, bool) 23 24 // Size will return the current size of the memory pool. 25 Size() uint 26 27 // All will return a list of all approvals in the memory pool. 28 All() []*flow.ExecutionResult 29 }