refactor(core,x/**): simplify core service api and embed environment in keepers (#20071)
This commit is contained in:
+9
-8
@@ -24,23 +24,24 @@ const NoGasLimit Gas = math.MaxUint64
|
||||
// gas.Service is a core API type that should be provided by the runtime module being used to
|
||||
// build an app via depinject.
|
||||
type Service interface {
|
||||
// GetGasMeter returns the current transaction-level gas meter. A non-nil meter
|
||||
// GasMeter returns the current transaction-level gas meter. A non-nil meter
|
||||
// is always returned. When one is unavailable in the context an infinite gas meter
|
||||
// will be returned.
|
||||
GetGasMeter(context.Context) Meter
|
||||
|
||||
// GetBlockGasMeter returns the current block-level gas meter. A non-nil meter
|
||||
// is always returned. When one is unavailable in the context an infinite gas meter
|
||||
// will be returned.
|
||||
GetBlockGasMeter(context.Context) Meter
|
||||
GasMeter(context.Context) Meter
|
||||
|
||||
// WithGasMeter returns a new context with the provided transaction-level gas meter.
|
||||
WithGasMeter(ctx context.Context, meter Meter) context.Context
|
||||
|
||||
// BlockGasMeter returns the current block-level gas meter. A non-nil meter
|
||||
// is always returned. When one is unavailable in the context an infinite gas meter
|
||||
// will be returned.
|
||||
BlockGasMeter(context.Context) Meter
|
||||
|
||||
// WithBlockGasMeter returns a new context with the provided block-level gas meter.
|
||||
WithBlockGasMeter(ctx context.Context, meter Meter) context.Context
|
||||
|
||||
GetGasConfig(ctx context.Context) GasConfig
|
||||
// GasConfig returns the gas costs.
|
||||
GasConfig(ctx context.Context) GasConfig
|
||||
}
|
||||
|
||||
// Meter represents a gas meter for modules consumption
|
||||
|
||||
Reference in New Issue
Block a user