From 153274cd330102253dfd7e01352ab439b1a4ac1e Mon Sep 17 00:00:00 2001 From: mattverse Date: Tue, 14 Dec 2021 18:51:37 +0900 Subject: [PATCH 1/7] Feat: set min-coins-restriction for bank module --- x/bank/keeper/keeper.go | 41 +++++++++++++++++++++++++++--------- x/bank/keeper/keeper_test.go | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 10 deletions(-) diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 31ed533c7875..f5e62786c975 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -22,6 +22,7 @@ var _ Keeper = (*BaseKeeper)(nil) // between accounts. type Keeper interface { SendKeeper + WithMintCoinsRestriction(func(ctx sdk.Context, coins sdk.Coins) error) BaseKeeper InitGenesis(sdk.Context, *types.GenesisState) ExportGenesis(sdk.Context) *types.GenesisState @@ -53,10 +54,11 @@ type Keeper interface { type BaseKeeper struct { BaseSendKeeper - ak types.AccountKeeper - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - paramSpace paramtypes.Subspace + ak types.AccountKeeper + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + paramSpace paramtypes.Subspace + mintCoinsRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error } // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination @@ -104,14 +106,28 @@ func NewBaseKeeper( } return BaseKeeper{ - BaseSendKeeper: NewBaseSendKeeper(cdc, storeKey, ak, paramSpace, blockedAddrs), - ak: ak, - cdc: cdc, - storeKey: storeKey, - paramSpace: paramSpace, + BaseSendKeeper: NewBaseSendKeeper(cdc, storeKey, ak, paramSpace, blockedAddrs), + ak: ak, + cdc: cdc, + storeKey: storeKey, + paramSpace: paramSpace, + mintCoinsRestrictionFn: func(ctx sdk.Context, coins sdk.Coins) error { return nil }, } } +// WithMintCoinsRestriction restricts the bank Keeper used within a specific module to +// have restricted permissions on minting speicified denoms. +func (k BaseKeeper) WithMintCoinsRestriction(NewRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error) BaseKeeper { + k.mintCoinsRestrictionFn = func(ctx sdk.Context, coins sdk.Coins) error { + err := NewRestrictionFn(ctx, coins) + if err != nil { + return err + } + return nil + } + return k +} + // DelegateCoins performs delegation by deducting amt coins from an account with // address addr. For vesting accounts, delegations amounts are tracked for both // vesting and vested coins. The coins are then transferred from the delegator @@ -381,6 +397,11 @@ func (k BaseKeeper) UndelegateCoinsFromModuleToAccount( // MintCoins creates new coins from thin air and adds it to the module account. // It will panic if the module account does not exist or is unauthorized. func (k BaseKeeper) MintCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error { + err := k.mintCoinsRestrictionFn(ctx, amounts) + if err != nil { + ctx.Logger().Error("Module %s attempted minting coins %s it did not have permission for", moduleName, amounts) + return err + } acc := k.ak.GetModuleAccount(ctx, moduleName) if acc == nil { panic(sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", moduleName)) @@ -390,7 +411,7 @@ func (k BaseKeeper) MintCoins(ctx sdk.Context, moduleName string, amounts sdk.Co panic(sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "module account %s does not have permissions to mint tokens", moduleName)) } - err := k.addCoins(ctx, acc.GetAddress(), amounts) + err = k.addCoins(ctx, acc.GetAddress(), amounts) if err != nil { return err } diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 3a8a8f64e27b..4e56590fbd37 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "fmt" "testing" "time" @@ -1168,6 +1169,46 @@ func (suite *IntegrationTestSuite) getTestMetadata() []types.Metadata { } } +func (suite *IntegrationTestSuite) TestMintCoinRestriction() { + maccPerms := simapp.GetMaccPerms() + maccPerms[multiPerm] = []string{authtypes.Burner, authtypes.Minter, authtypes.Staking} + + suite.app.AccountKeeper = authkeeper.NewAccountKeeper( + suite.app.AppCodec(), suite.app.GetKey(authtypes.StoreKey), suite.app.GetSubspace(authtypes.ModuleName), + authtypes.ProtoBaseAccount, maccPerms, sdk.Bech32MainPrefix, + ) + suite.app.AccountKeeper.SetModuleAccount(suite.ctx, multiPermAcc) + + // only allow foo tokens to be minted + BankMintingRestriction := func(ctx sdk.Context, coins sdk.Coins) error { + for _, coin := range coins { + if coin.Denom != fooDenom { + return fmt.Errorf("Module %s attempted minting coins %s it did not have permission for", types.ModuleName, coin.Denom) + } + } + return nil + } + suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), + suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil).WithMintCoinsRestriction(BankMintingRestriction) + + suite.Require().NoError( + suite.app.BankKeeper.MintCoins( + suite.ctx, + multiPermAcc.Name, + sdk.NewCoins(newFooCoin(100)), + ), + ) + + suite.Require().Error( + suite.app.BankKeeper.MintCoins( + suite.ctx, + multiPermAcc.Name, + sdk.NewCoins(newBarCoin(100)), + ), + ) + +} + func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(IntegrationTestSuite)) } From 7a345b3ead136209d86464a0adf4b179830006c1 Mon Sep 17 00:00:00 2001 From: mattverse Date: Wed, 15 Dec 2021 17:33:40 +0900 Subject: [PATCH 2/7] Add nesting restriction fns, Add type alias --- x/bank/keeper/keeper.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index f5e62786c975..b0cfac882cda 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -22,7 +22,7 @@ var _ Keeper = (*BaseKeeper)(nil) // between accounts. type Keeper interface { SendKeeper - WithMintCoinsRestriction(func(ctx sdk.Context, coins sdk.Coins) error) BaseKeeper + WithMintCoinsRestriction(BankMintingRestrictionFn) BaseKeeper InitGenesis(sdk.Context, *types.GenesisState) ExportGenesis(sdk.Context) *types.GenesisState @@ -58,9 +58,11 @@ type BaseKeeper struct { cdc codec.BinaryCodec storeKey storetypes.StoreKey paramSpace paramtypes.Subspace - mintCoinsRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error + mintCoinsRestrictionFn BankMintingRestrictionFn } +type BankMintingRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error + // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination func (k BaseKeeper) GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { store := ctx.KVStore(k.storeKey) @@ -117,12 +119,17 @@ func NewBaseKeeper( // WithMintCoinsRestriction restricts the bank Keeper used within a specific module to // have restricted permissions on minting speicified denoms. -func (k BaseKeeper) WithMintCoinsRestriction(NewRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error) BaseKeeper { +func (k BaseKeeper) WithMintCoinsRestriction(NewRestrictionFn BankMintingRestrictionFn) BaseKeeper { + oldRestrictionFn := k.mintCoinsRestrictionFn k.mintCoinsRestrictionFn = func(ctx sdk.Context, coins sdk.Coins) error { err := NewRestrictionFn(ctx, coins) if err != nil { return err } + err = oldRestrictionFn(ctx, coins) + if err != nil { + return err + } return nil } return k @@ -399,7 +406,7 @@ func (k BaseKeeper) UndelegateCoinsFromModuleToAccount( func (k BaseKeeper) MintCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error { err := k.mintCoinsRestrictionFn(ctx, amounts) if err != nil { - ctx.Logger().Error("Module %s attempted minting coins %s it did not have permission for", moduleName, amounts) + ctx.Logger().Error(fmt.Sprintf("Module %s attempted minting coins %s it did not have permission for with error %v", moduleName, amounts, err)) return err } acc := k.ak.GetModuleAccount(ctx, moduleName) From 39c8037e9abd7326f7780c8ffe5b2d987aaee2fc Mon Sep 17 00:00:00 2001 From: mattverse Date: Wed, 15 Dec 2021 17:34:12 +0900 Subject: [PATCH 3/7] Change to table driven tests --- x/bank/keeper/keeper_test.go | 82 ++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 26 deletions(-) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 4e56590fbd37..6bc8dddd8eee 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -1169,7 +1169,9 @@ func (suite *IntegrationTestSuite) getTestMetadata() []types.Metadata { } } -func (suite *IntegrationTestSuite) TestMintCoinRestriction() { +func (suite *IntegrationTestSuite) TestMintCoinRestrictions() { + type BankMintingRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error + maccPerms := simapp.GetMaccPerms() maccPerms[multiPerm] = []string{authtypes.Burner, authtypes.Minter, authtypes.Staking} @@ -1179,34 +1181,62 @@ func (suite *IntegrationTestSuite) TestMintCoinRestriction() { ) suite.app.AccountKeeper.SetModuleAccount(suite.ctx, multiPermAcc) - // only allow foo tokens to be minted - BankMintingRestriction := func(ctx sdk.Context, coins sdk.Coins) error { - for _, coin := range coins { - if coin.Denom != fooDenom { - return fmt.Errorf("Module %s attempted minting coins %s it did not have permission for", types.ModuleName, coin.Denom) - } - } - return nil + type testCase struct { + coinsToTry sdk.Coin + expectPass bool } - suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), - suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil).WithMintCoinsRestriction(BankMintingRestriction) - suite.Require().NoError( - suite.app.BankKeeper.MintCoins( - suite.ctx, - multiPermAcc.Name, - sdk.NewCoins(newFooCoin(100)), - ), - ) - - suite.Require().Error( - suite.app.BankKeeper.MintCoins( - suite.ctx, - multiPermAcc.Name, - sdk.NewCoins(newBarCoin(100)), - ), - ) + tests := []struct { + name string + restrictionFn BankMintingRestrictionFn + testCases []testCase + }{ + { + "restriction", + func(ctx sdk.Context, coins sdk.Coins) error { + for _, coin := range coins { + if coin.Denom != fooDenom { + return fmt.Errorf("Module %s only has perms for minting %s coins, tried minting %s coins", types.ModuleName, fooDenom, coin.Denom) + } + } + return nil + }, + []testCase{ + { + coinsToTry: newFooCoin(100), + expectPass: true, + }, + { + coinsToTry: newBarCoin(100), + expectPass: false, + }, + }, + }, + } + for _, test := range tests { + suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), + suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil).WithMintCoinsRestriction(keeper.BankMintingRestrictionFn(test.restrictionFn)) + for _, testCase := range test.testCases { + if testCase.expectPass { + suite.Require().NoError( + suite.app.BankKeeper.MintCoins( + suite.ctx, + multiPermAcc.Name, + sdk.NewCoins(testCase.coinsToTry), + ), + ) + } else { + suite.Require().Error( + suite.app.BankKeeper.MintCoins( + suite.ctx, + multiPermAcc.Name, + sdk.NewCoins(testCase.coinsToTry), + ), + ) + } + } + } } func TestKeeperTestSuite(t *testing.T) { From 5f2fc6bc8e58632498e0091f910fb32b061d662e Mon Sep 17 00:00:00 2001 From: mattverse Date: Tue, 4 Jan 2022 15:54:16 +0900 Subject: [PATCH 4/7] Add changelog entry and excerpt to spec --- CHANGELOG.md | 2 +- x/bank/spec/02_keepers.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f900b7099731..c0f77832c955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,7 +149,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. * (deps) [\#10706](https://github.com/cosmos/cosmos-sdk/issues/10706) Bump rosetta-sdk-go to v0.7.2 and rosetta-cli to v0.7.3 * (module) [\#10711](https://github.com/cosmos/cosmos-sdk/pull/10711) Panic at startup if the app developer forgot to add modules in the `SetOrder{BeginBlocker, EndBlocker, InitGenesis, ExportGenesis}` functions. This means that all modules, even those who have empty implementations for those methods, need to be added to `SetOrder*`. - +* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bnak module perms to only mint specified denom. ### Bug Fixes * [\#10414](https://github.com/cosmos/cosmos-sdk/pull/10414) Use `sdk.GetConfig().GetFullBIP44Path()` instead `sdk.FullFundraiserPath` to generate key diff --git a/x/bank/spec/02_keepers.md b/x/bank/spec/02_keepers.md index 098297dd0d45..e5d19559e50a 100644 --- a/x/bank/spec/02_keepers.md +++ b/x/bank/spec/02_keepers.md @@ -59,6 +59,7 @@ The base keeper provides full-permission access: the ability to arbitrary modify // between accounts. type Keeper interface { SendKeeper + WithMintCoinsRestriction(NewRestrictionFn BankMintingRestrictionFn) BaseKeeper InitGenesis(sdk.Context, *types.GenesisState) ExportGenesis(sdk.Context) *types.GenesisState From f41cd99fdf4f7590696c8757f0b80fc292b09ca7 Mon Sep 17 00:00:00 2001 From: mattverse Date: Wed, 5 Jan 2022 00:50:13 +0900 Subject: [PATCH 5/7] Update documentation for minting perms --- CHANGELOG.md | 2 +- x/bank/spec/02_keepers.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f77832c955..05e955a79dd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,7 +149,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. * (deps) [\#10706](https://github.com/cosmos/cosmos-sdk/issues/10706) Bump rosetta-sdk-go to v0.7.2 and rosetta-cli to v0.7.3 * (module) [\#10711](https://github.com/cosmos/cosmos-sdk/pull/10711) Panic at startup if the app developer forgot to add modules in the `SetOrder{BeginBlocker, EndBlocker, InitGenesis, ExportGenesis}` functions. This means that all modules, even those who have empty implementations for those methods, need to be added to `SetOrder*`. -* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bnak module perms to only mint specified denom. +* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom). ### Bug Fixes * [\#10414](https://github.com/cosmos/cosmos-sdk/pull/10414) Use `sdk.GetConfig().GetFullBIP44Path()` instead `sdk.FullFundraiserPath` to generate key diff --git a/x/bank/spec/02_keepers.md b/x/bank/spec/02_keepers.md index e5d19559e50a..3671819a755d 100644 --- a/x/bank/spec/02_keepers.md +++ b/x/bank/spec/02_keepers.md @@ -54,6 +54,8 @@ message Output { The base keeper provides full-permission access: the ability to arbitrary modify any account's balance and mint or burn coins. +Restricted permission to mint per module could be achieved by using baseKeeper with `WithMintCoinsRestriction` to give specific restrictions to mint (e.g. only minting certain denom). + ```go // Keeper defines a module interface that facilitates the transfer of coins // between accounts. From fa2b7eeb17be853efc0b43e378901b1f040edfee Mon Sep 17 00:00:00 2001 From: mattverse Date: Wed, 26 Jan 2022 20:17:26 +0900 Subject: [PATCH 6/7] Update go doc and comments --- CHANGELOG.md | 2 +- x/bank/keeper/keeper.go | 16 +++++++++------- x/bank/keeper/keeper_test.go | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 022b6cccab1d..3bfcd70bf019 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -160,7 +160,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. * (deps) [\#10706](https://github.com/cosmos/cosmos-sdk/issues/10706) Bump rosetta-sdk-go to v0.7.2 and rosetta-cli to v0.7.3 * (module) [\#10711](https://github.com/cosmos/cosmos-sdk/pull/10711) Panic at startup if the app developer forgot to add modules in the `SetOrder{BeginBlocker, EndBlocker, InitGenesis, ExportGenesis}` functions. This means that all modules, even those who have empty implementations for those methods, need to be added to `SetOrder*`. -* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom). +* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom).* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add `bank.BaseKeeper.WithMintCoinsRestriction` function to restrict use of bank `MintCoins` usage. * (types/errors) [\#10779](https://github.com/cosmos/cosmos-sdk/pull/10779) Move most functionality in `types/errors` to a standalone `errors` go module, except the `RootCodespace` errors and ABCI response helpers. All functions and types that used to live in `types/errors` are now aliased so this is not a breaking change. ### Bug Fixes diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 5bb2c8e86a3b..40492e33a358 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -21,7 +21,7 @@ var _ Keeper = (*BaseKeeper)(nil) // between accounts. type Keeper interface { SendKeeper - WithMintCoinsRestriction(BankMintingRestrictionFn) BaseKeeper + WithMintCoinsRestriction(MintingRestrictionFn) BaseKeeper InitGenesis(sdk.Context, *types.GenesisState) ExportGenesis(sdk.Context) *types.GenesisState @@ -57,10 +57,10 @@ type BaseKeeper struct { cdc codec.BinaryCodec storeKey storetypes.StoreKey paramSpace paramtypes.Subspace - mintCoinsRestrictionFn BankMintingRestrictionFn + mintCoinsRestrictionFn MintingRestrictionFn } -type BankMintingRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error +type MintingRestrictionFn func(ctx sdk.Context, coins sdk.Coins) error // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination func (k BaseKeeper) GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { @@ -117,11 +117,13 @@ func NewBaseKeeper( } // WithMintCoinsRestriction restricts the bank Keeper used within a specific module to -// have restricted permissions on minting speicified denoms. -func (k BaseKeeper) WithMintCoinsRestriction(NewRestrictionFn BankMintingRestrictionFn) BaseKeeper { +// have restricted permissions on minting via function passed in parameter. +// Previous restriction functions can be nested as such: +// bankKeeper.WithMintCoinsRestriction(restriction1).WithMintCoinsRestriction(restriction2) +func (k BaseKeeper) WithMintCoinsRestriction(check MintingRestrictionFn) BaseKeeper { oldRestrictionFn := k.mintCoinsRestrictionFn k.mintCoinsRestrictionFn = func(ctx sdk.Context, coins sdk.Coins) error { - err := NewRestrictionFn(ctx, coins) + err := check(ctx, coins) if err != nil { return err } @@ -405,7 +407,7 @@ func (k BaseKeeper) UndelegateCoinsFromModuleToAccount( func (k BaseKeeper) MintCoins(ctx sdk.Context, moduleName string, amounts sdk.Coins) error { err := k.mintCoinsRestrictionFn(ctx, amounts) if err != nil { - ctx.Logger().Error(fmt.Sprintf("Module %s attempted minting coins %s it did not have permission for with error %v", moduleName, amounts, err)) + ctx.Logger().Error(fmt.Sprintf("Module %q attempted to mint coins %s it doesn't have permission for, error %v", moduleName, amounts, err)) return err } acc := k.ak.GetModuleAccount(ctx, moduleName) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index c770e4d947a2..6c3e55955ed4 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -1215,7 +1215,7 @@ func (suite *IntegrationTestSuite) TestMintCoinRestrictions() { for _, test := range tests { suite.app.BankKeeper = keeper.NewBaseKeeper(suite.app.AppCodec(), suite.app.GetKey(types.StoreKey), - suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil).WithMintCoinsRestriction(keeper.BankMintingRestrictionFn(test.restrictionFn)) + suite.app.AccountKeeper, suite.app.GetSubspace(types.ModuleName), nil).WithMintCoinsRestriction(keeper.MintingRestrictionFn(test.restrictionFn)) for _, testCase := range test.testCases { if testCase.expectPass { suite.Require().NoError( From 77e5c4d820128a5ec3b31190d86025fe7667271d Mon Sep 17 00:00:00 2001 From: mattverse Date: Fri, 28 Jan 2022 18:51:26 +0900 Subject: [PATCH 7/7] Modify CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bfcd70bf019..8903e0dbe15c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10816](https://github.com/cosmos/cosmos-sdk/pull/10816) Reuse blocked addresses from the bank module. No need to pass them to distribution. * [\#10852](https://github.com/cosmos/cosmos-sdk/pull/10852) Move `x/gov/types` to `x/gov/types/v1beta2`. * [\#10922](https://github.com/cosmos/cosmos-sdk/pull/10922), [/#10957](https://github.com/cosmos/cosmos-sdk/pull/10957) Move key `server.Generate*` functions to testutil and support custom mnemonics in in-process testing network. Moved `TestMnemonic` from `testutil` package to `testdata`. +* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom).* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add `bank.BaseKeeper.WithMintCoinsRestriction` function to restrict use of bank `MintCoins` usage. ### Client Breaking Changes @@ -160,7 +161,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. * (deps) [\#10706](https://github.com/cosmos/cosmos-sdk/issues/10706) Bump rosetta-sdk-go to v0.7.2 and rosetta-cli to v0.7.3 * (module) [\#10711](https://github.com/cosmos/cosmos-sdk/pull/10711) Panic at startup if the app developer forgot to add modules in the `SetOrder{BeginBlocker, EndBlocker, InitGenesis, ExportGenesis}` functions. This means that all modules, even those who have empty implementations for those methods, need to be added to `SetOrder*`. -* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom).* (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add `bank.BaseKeeper.WithMintCoinsRestriction` function to restrict use of bank `MintCoins` usage. * (types/errors) [\#10779](https://github.com/cosmos/cosmos-sdk/pull/10779) Move most functionality in `types/errors` to a standalone `errors` go module, except the `RootCodespace` errors and ABCI response helpers. All functions and types that used to live in `types/errors` are now aliased so this is not a breaking change. ### Bug Fixes