forked from cerc-io/laconicd-deprecated
Part of https://www.notion.so/Set-constant-gas-price-in-laconicd-00b470964f0e4020b06153f0f2c9bcfb - Use custom KV store gas config (0 gas for KV store ops) for laconic module (auction, bond, registry) txs Reviewed-on: cerc-io/laconicd#146 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
21 lines
432 B
Go
21 lines
432 B
Go
package utils
|
|
|
|
import (
|
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
func CtxWithCustomKVGasConfig(ctx *sdk.Context) *sdk.Context {
|
|
updatedCtx := ctx.WithKVGasConfig(storetypes.GasConfig{
|
|
HasCost: 0,
|
|
DeleteCost: 0,
|
|
ReadCostFlat: 0,
|
|
ReadCostPerByte: 0,
|
|
WriteCostFlat: 0,
|
|
WriteCostPerByte: 0,
|
|
IterNextCostFlat: 0,
|
|
})
|
|
|
|
return &updatedCtx
|
|
}
|