-
Notifications
You must be signed in to change notification settings - Fork 199
/
interface.go
49 lines (42 loc) · 1.76 KB
/
interface.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
45
46
47
48
49
package process
import (
"math/big"
"github.com/multiversx/mx-chain-core-go/data"
"github.com/multiversx/mx-chain-core-go/data/outport"
"github.com/multiversx/mx-chain-go/outport/process/alteredaccounts/shared"
)
// AlteredAccountsProviderHandler defines the functionality needed for provisioning of altered accounts when indexing data
type AlteredAccountsProviderHandler interface {
ExtractAlteredAccountsFromPool(txPool *outport.Pool, options shared.AlteredAccountsOptions) (map[string]*outport.AlteredAccount, error)
IsInterfaceNil() bool
}
// TransactionsFeeHandler defines the functionality needed for computation of the transaction fee and gas used
type TransactionsFeeHandler interface {
PutFeeAndGasUsed(pool *outport.Pool) error
IsInterfaceNil() bool
}
// GasConsumedProvider defines the functionality needed for providing gas consumed information
type GasConsumedProvider interface {
TotalGasProvided() uint64
TotalGasProvidedWithScheduled() uint64
TotalGasRefunded() uint64
TotalGasPenalized() uint64
IsInterfaceNil() bool
}
// EconomicsDataHandler defines the functionality needed for economics data
type EconomicsDataHandler interface {
ComputeGasUsedAndFeeBasedOnRefundValue(tx data.TransactionWithFeeHandler, refundValue *big.Int) (uint64, *big.Int)
ComputeTxFeeBasedOnGasUsed(tx data.TransactionWithFeeHandler, gasUsed uint64) *big.Int
ComputeGasLimit(tx data.TransactionWithFeeHandler) uint64
IsInterfaceNil() bool
MaxGasLimitPerBlock(shardID uint32) uint64
}
// ExecutionOrderHandler defines the interface for the execution order handler
type ExecutionOrderHandler interface {
PutExecutionOrderInTransactionPool(
pool *outport.Pool,
header data.HeaderHandler,
body data.BodyHandler,
prevHeader data.HeaderHandler,
) ([]string, []string, error)
}