diff --git a/go.mod b/go.mod index 2bba08b660..a31261b7ab 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/akash-network/node go 1.20 require ( - github.com/akash-network/akash-api v0.0.24 + github.com/akash-network/akash-api v0.0.25 github.com/blang/semver/v4 v4.0.0 github.com/boz/go-lifecycle v0.1.1 github.com/cosmos/cosmos-sdk v0.45.16 diff --git a/go.sum b/go.sum index d671490976..a0bef877ac 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/akash-network/akash-api v0.0.24 h1:nIuftXhNI6w5oLjfncbb2BLxLEZvkwfxknbjYuFBI5M= -github.com/akash-network/akash-api v0.0.24/go.mod h1:9/uYusyBcZecBQCgZWUbXRu0i1tyxj4/ze45XB2oLIU= +github.com/akash-network/akash-api v0.0.25 h1:Gm7SZnR1Lu/0gvomG/drybgGzWCANWsQ+EoIICJbngA= +github.com/akash-network/akash-api v0.0.25/go.mod h1:9/uYusyBcZecBQCgZWUbXRu0i1tyxj4/ze45XB2oLIU= github.com/akash-network/cometbft v0.34.27-akash h1:V1dApDOr8Ee7BJzYyQ7Z9VBtrAul4+baMeA6C49dje0= github.com/akash-network/cometbft v0.34.27-akash/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= github.com/akash-network/ledger-go v0.14.3 h1:LCEFkTfgGA2xFMN2CtiKvXKE7dh0QSM77PJHCpSkaAo= diff --git a/x/deployment/simulation/genesis.go b/x/deployment/simulation/genesis.go index 96d699bb47..d603a1e534 100644 --- a/x/deployment/simulation/genesis.go +++ b/x/deployment/simulation/genesis.go @@ -1,6 +1,7 @@ package simulation import ( + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" types "github.com/akash-network/akash-api/go/node/deployment/v1beta3" @@ -14,8 +15,8 @@ var ( func RandomizedGenState(simState *module.SimulationState) { deploymentGenesis := &types.GenesisState{ Params: types.Params{ - MinDeposits: map[string]uint32{ - minDeposit.Denom: uint32(minDeposit.Amount.ToDec().TruncateInt64()), + MinDeposits: sdk.Coins{ + minDeposit, }, }, } diff --git a/x/take/keeper/keeper.go b/x/take/keeper/keeper.go index e9d760bf52..c5b18cbd2b 100644 --- a/x/take/keeper/keeper.go +++ b/x/take/keeper/keeper.go @@ -74,9 +74,13 @@ func (k Keeper) SubtractFees(ctx sdk.Context, amt sdk.Coin) (sdk.Coin, sdk.Coin, func (k Keeper) findRate(ctx sdk.Context, denom string) sdk.Dec { params := k.GetParams(ctx) - rate, ok := params.DenomTakeRates[denom] - if !ok { - rate = params.DefaultTakeRate + rate := params.DefaultTakeRate + + for _, denomRate := range params.DenomTakeRates { + if denom == denomRate.Denom { + rate = denomRate.Rate + break + } } // return percentage. diff --git a/x/take/module.go b/x/take/module.go index 89feeb5afd..8a5989655e 100644 --- a/x/take/module.go +++ b/x/take/module.go @@ -190,6 +190,7 @@ func NewAppModuleSimulation(k keeper.IKeeper) AppModuleSimulation { } // AppModuleSimulation functions + // GenerateGenesisState creates a randomized GenState of the staking module. func (AppModuleSimulation) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState)