feat(accounts): Add codec.BinaryCodec and Gas to dependencies. (#19068)

Co-authored-by: unknown unknown <unknown@unknown>
This commit is contained in:
testinginprod
2024-01-17 10:58:06 +00:00
committed by GitHub
co-authored by unknown unknown
parent 822d90c4b1
commit 498cd6a533
14 changed files with 1773 additions and 93 deletions
+30
View File
@@ -0,0 +1,30 @@
package runtime
import (
"context"
"cosmossdk.io/core/gas"
sdk "github.com/cosmos/cosmos-sdk/types"
)
var _ gas.Service = (*GasService)(nil)
type GasService struct{}
func (g GasService) GetGasMeter(ctx context.Context) gas.Meter {
sdkCtx := sdk.UnwrapSDKContext(ctx)
return sdkCtx.GasMeter()
}
func (g GasService) GetBlockGasMeter(ctx context.Context) gas.Meter {
return sdk.UnwrapSDKContext(ctx).BlockGasMeter()
}
func (g GasService) WithGasMeter(ctx context.Context, meter gas.Meter) context.Context {
return sdk.UnwrapSDKContext(ctx).WithGasMeter(meter)
}
func (g GasService) WithBlockGasMeter(ctx context.Context, meter gas.Meter) context.Context {
return sdk.UnwrapSDKContext(ctx).WithBlockGasMeter(meter)
}