This commit is contained in:
0xsatoshi 2024-06-16 17:23:29 +08:00 committed by 0g-wh
parent 377fdd6778
commit 2862336f03
3 changed files with 12 additions and 18 deletions

View File

@ -29,6 +29,7 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
vestingkeeper "github.com/cosmos/cosmos-sdk/x/auth/vesting/keeper"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
"github.com/cosmos/cosmos-sdk/x/authz"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
@ -702,6 +703,8 @@ func NewApp(
keys[counciltypes.StoreKey], appCodec, app.stakingKeeper,
)
app.vestingKeeper = vestingkeeper.NewVestingKeeper(app.accountKeeper, app.bankKeeper, keys[vestingtypes.StoreKey])
// create the module manager (Note: Any module instantiated in the module manager that is later modified
// must be passed by reference here.)
app.mm = module.NewManager(
@ -722,7 +725,7 @@ func NewApp(
upgrade.NewAppModule(&app.upgradeKeeper),
evidence.NewAppModule(app.evidenceKeeper),
transferModule,
vesting.NewAppModule(app.accountKeeper, app.bankKeeper),
vesting.NewAppModule(app.accountKeeper, app.vestingKeeper),
authzmodule.NewAppModule(appCodec, app.authzKeeper, app.accountKeeper, app.bankKeeper, app.interfaceRegistry),
issuance.NewAppModule(app.issuanceKeeper, app.accountKeeper, app.bankKeeper),
bep3.NewAppModule(app.bep3Keeper, app.accountKeeper, app.bankKeeper),

View File

@ -1,21 +1,11 @@
package chaincfg
import (
"github.com/tendermint/tendermint/libs/log"
sdk "github.com/cosmos/cosmos-sdk/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
)
func CustomInflationCalculateFn(ctx sdk.Context, minter minttypes.Minter, params minttypes.Params, bondedRatio sdk.Dec) sdk.Dec {
logger := ctx.Logger()
if logger == nil {
panic("logger is nil")
}
return customInflationCalculateFn(logger, minter, params, bondedRatio)
}
func customInflationCalculateFn(logger log.Logger, minter minttypes.Minter, params minttypes.Params, bondedRatio sdk.Dec) sdk.Dec {
func NextInflationRate(ctx sdk.Context, minter minttypes.Minter, params minttypes.Params, bondedRatio sdk.Dec, circulatingRatio sdk.Dec) sdk.Dec {
// The target annual inflation rate is recalculated for each previsions cycle. The
// inflation is also subject to a rate change (positive or negative) depending on
// the distance from the desired ratio (67%). The maximum rate change possible is
@ -37,9 +27,10 @@ func customInflationCalculateFn(logger log.Logger, minter minttypes.Minter, para
inflation = params.InflationMin
}
logger.Info(
ctx.Logger().Debug(
"calculated new annual inflation",
"bondedRatio", bondedRatio,
"circulatingRatio", circulatingRatio,
"inflation", inflation,
"params", params,
"minter", minter,

View File

@ -16,7 +16,7 @@ userMnemonic="news tornado sponsor drastic dolphin awful plastic select true liz
# 0x7Bbf300890857b8c241b219C6a489431669b3aFA
# kava10wlnqzyss4accfqmyxwx5jy5x9nfkwh6qm7n4t
relayerMnemonic="never reject sniff east arctic funny twin feed upper series stay shoot vivid adapt defense economy pledge fetch invite approve ceiling admit gloom exit"
vestingMnemonic="never reject sniff east arctic funny twin feed upper series stay shoot vivid adapt defense economy pledge fetch invite approve ceiling admit gloom exit"
# 0xa2F728F997f62F47D4262a70947F6c36885dF9fa
# kava15tmj37vh7ch504px9fcfglmvx6y9m70646ev8t
@ -64,11 +64,11 @@ $BINARY add-genesis-account $evmFaucetKeyName 1000000000000000000000ua0gi
userKeyName="user"
printf "$userMnemonic\n" | $BINARY keys add $userKeyName --eth --recover
$BINARY add-genesis-account $userKeyName 1000000000000000000000ua0gi,1000000000usdx
$BINARY add-genesis-account $userKeyName 1000000000000000000000ua0gi
relayerKeyName="relayer"
printf "$relayerMnemonic\n" | $BINARY keys add $relayerKeyName --eth --recover
$BINARY add-genesis-account $relayerKeyName 1000000000000000000000ua0gi
vestingKeyName="vesting"
printf "$vestingMnemonic\n" | $BINARY keys add $vestingKeyName --eth --recover
$BINARY add-genesis-account $vestingKeyName 1000000000000000000000ua0gi --vesting-amount 1000000000000000000000ua0gi --vesting-start-time 1717200000 --vesting-end-time 1719791999
storageContractAcc="0g1vsjpjgw8p5f4x0nwp8ernl9lkszewcqqss7r5d"
$BINARY add-genesis-account $storageContractAcc 1000000000000000000000ua0gi