-
Notifications
You must be signed in to change notification settings - Fork 808
/
params.go
42 lines (33 loc) · 1.15 KB
/
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
39
40
41
42
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/sei-protocol/sei-chain/x/dex/types"
)
// GetParams get all parameters as types.Params
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
params := types.Params{}
k.Paramstore.GetParamSet(ctx, ¶ms)
return params
}
func (k Keeper) GetSettlementGasAllowance(ctx sdk.Context, numSettlements int) uint64 {
return k.GetParams(ctx).GasAllowancePerSettlement * uint64(numSettlements)
}
func (k Keeper) GetMinProcessableRent(ctx sdk.Context) uint64 {
return k.GetParams(ctx).MinProcessableRent
}
func (k Keeper) GetOrderBookEntriesPerLoad(ctx sdk.Context) uint64 {
return k.GetParams(ctx).OrderBookEntriesPerLoad
}
func (k Keeper) GetContractUnsuspendCost(ctx sdk.Context) uint64 {
return k.GetParams(ctx).ContractUnsuspendCost
}
func (k Keeper) GetMaxOrderPerPrice(ctx sdk.Context) uint64 {
return k.GetParams(ctx).MaxOrderPerPrice
}
func (k Keeper) GetMaxPairsPerContract(ctx sdk.Context) uint64 {
return k.GetParams(ctx).MaxPairsPerContract
}
// SetParams set the params
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.Paramstore.SetParamSet(ctx, ¶ms)
}