-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.go
38 lines (31 loc) · 964 Bytes
/
params.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
package keeper
import (
sdk "github.com/brc20-collab/brczero/libs/cosmos-sdk/types"
"github.com/brc20-collab/brczero/x/evm/types"
)
// GetParams returns the total set of evm parameters.
func (k *Keeper) GetParams(ctx sdk.Context) (params types.Params) {
if ctx.UseParamCache() {
if types.GetEvmParamsCache().IsNeedParamsUpdate() {
params = k.getParams(ctx)
types.GetEvmParamsCache().UpdateParams(params, ctx.IsCheckTx())
} else {
params = types.GetEvmParamsCache().GetParams()
}
} else {
params = k.getParams(ctx)
}
return
}
func (k *Keeper) getParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, ¶ms)
return
}
// SetParams sets the evm parameters to the param space.
func (k *Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, ¶ms)
types.GetEvmParamsCache().SetNeedParamsUpdate()
}
func (k *Keeper) GetParamSubspace() types.Subspace {
return k.paramSpace
}