From 4c2842708935968007447c205f0926b43c32b14f Mon Sep 17 00:00:00 2001 From: 0xsatoshi Date: Sun, 16 Jun 2024 17:23:29 +0800 Subject: [PATCH] fix --- app/app.go | 5 ++++- chaincfg/mint.go | 15 +++------------ localtestnet.sh | 10 +++++----- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/app/app.go b/app/app.go index 5241a468..42ebc5cd 100644 --- a/app/app.go +++ b/app/app.go @@ -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" @@ -752,6 +753,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( @@ -773,7 +776,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), diff --git a/chaincfg/mint.go b/chaincfg/mint.go index 1ecfe409..9293e10e 100644 --- a/chaincfg/mint.go +++ b/chaincfg/mint.go @@ -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, diff --git a/localtestnet.sh b/localtestnet.sh index 189ec3b2..a5137590 100755 --- a/localtestnet.sh +++ b/localtestnet.sh @@ -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