From 3d81a94eb99bc30e3c819cc73b3d811ef5ed2337 Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Fri, 10 Jul 2020 10:59:31 +0200 Subject: [PATCH] Include changes from PR #6283 --- CHANGELOG.md | 3 ++- x/bank/internal/keeper/keeper.go | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71d574731d46..5e8f64b8d35a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -131,6 +131,7 @@ is the latest height, we'll use the store's `lastCommitInfo`. Otherwise, we fetc ### State Machine Breaking +* (x/bank) [\#6283](https://github.com/cosmos/cosmos-sdk/pull/6283) Create account if recipient does not exist on handing `MsgMultiSend`. * (genesis) [\#5506](https://github.com/cosmos/cosmos-sdk/pull/5506) The `x/distribution` genesis state now includes `params` instead of individual parameters. * (genesis) [\#5017](https://github.com/cosmos/cosmos-sdk/pull/5017) The `x/genaccounts` module has been @@ -352,7 +353,7 @@ to detail this new feature and how state transitions occur. now exists a single `Params` type with a getter and setter along with a getter for each individual parameter. ### Bug Fixes - +* (x/bank) [\#6283](https://github.com/cosmos/cosmos-sdk/pull/6283) Create account if recipient does not exist on handing `MsgMultiSend`. * (rest) [\#5508](https://github.com/cosmos/cosmos-sdk/pull/5508) Fix `x/distribution` endpoints to properly return height in the response. * (x/genutil) [\#5499](https://github.com/cosmos/cosmos-sdk/pull/) Ensure `DefaultGenesis` returns valid and non-nil default genesis state. * (client) [\#5303](https://github.com/cosmos/cosmos-sdk/issues/5303) Fix ignored error in tx generate only mode. diff --git a/x/bank/internal/keeper/keeper.go b/x/bank/internal/keeper/keeper.go index 8e5f5faa5c8d..5f0dfed2b221 100644 --- a/x/bank/internal/keeper/keeper.go +++ b/x/bank/internal/keeper/keeper.go @@ -211,6 +211,15 @@ func (keeper BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.In sdk.NewAttribute(sdk.AttributeKeyAmount, out.Coins.String()), ), ) + + // Create account if recipient does not exist. + // + // NOTE: This should ultimately be removed in favor a more flexible approach + // such as delegated fee messages. + acc := keeper.ak.GetAccount(ctx, out.Address) + if acc == nil { + keeper.ak.SetAccount(ctx, keeper.ak.NewAccountWithAddress(ctx, out.Address)) + } } return nil