github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/mempool/transaction_timings.go (about) 1 package mempool 2 3 import ( 4 "github.com/onflow/flow-go/model/flow" 5 ) 6 7 // TransactionTimings represents a concurrency-safe memory pool for transaction timings. 8 type TransactionTimings interface { 9 10 // Add adds a transaction timing to the mempool. 11 Add(tx *flow.TransactionTiming) bool 12 13 // ByID returns the transaction timing with the given ID from the mempool. 14 ByID(txID flow.Identifier) (*flow.TransactionTiming, bool) 15 // Adjust will adjust the transaction timing using the given function if the given key can be found. 16 // Returns a bool which indicates whether the value was updated as well as the updated value. 17 Adjust(txID flow.Identifier, f func(*flow.TransactionTiming) *flow.TransactionTiming) (*flow.TransactionTiming, 18 bool) 19 20 // All returns all transaction timings from the mempool. 21 All() []*flow.TransactionTiming 22 23 // Remove removes the transaction timing with the given ID. 24 Remove(txID flow.Identifier) bool 25 }