-
Notifications
You must be signed in to change notification settings - Fork 199
/
txcache.go
44 lines (32 loc) · 1.42 KB
/
txcache.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
37
38
39
40
41
42
43
44
package txcache
import (
"github.com/ElrondNetwork/elrond-go-storage/txcache"
)
// WrappedTransaction contains a transaction, its hash and extra information
type WrappedTransaction = txcache.WrappedTransaction
// TxGasHandler handles a transaction gas and gas cost
type TxGasHandler = txcache.TxGasHandler
// ForEachTransaction is an iterator callback
type ForEachTransaction = txcache.ForEachTransaction
// ConfigDestinationMe holds cache configuration
type ConfigDestinationMe = txcache.ConfigDestinationMe
// ConfigSourceMe holds cache configuration
type ConfigSourceMe = txcache.ConfigSourceMe
// TxCache represents a cache-like structure (it has a fixed capacity and implements an eviction mechanism) for holding transactions
type TxCache = txcache.TxCache
// DisabledCache represents a disabled cache
type DisabledCache = txcache.DisabledCache
// CrossTxCache holds cross-shard transactions (where destination == me)
type CrossTxCache = txcache.CrossTxCache
// NewTxCache creates a new transaction cache
func NewTxCache(config ConfigSourceMe, txGasHandler TxGasHandler) (*TxCache, error) {
return txcache.NewTxCache(config, txGasHandler)
}
// NewDisabledCache creates a new disabled cache
func NewDisabledCache() *DisabledCache {
return txcache.NewDisabledCache()
}
// NewCrossTxCache creates a new transactions cache
func NewCrossTxCache(config ConfigDestinationMe) (*CrossTxCache, error) {
return txcache.NewCrossTxCache(config)
}