From 44e7669611c5410004b1efa03556defc28b456b9 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Mon, 14 Jun 2021 08:28:46 +0200 Subject: [PATCH] Empty submsg result does not overwrite --- x/wasm/keeper/msg_dispatcher.go | 2 +- x/wasm/keeper/msg_dispatcher_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/wasm/keeper/msg_dispatcher.go b/x/wasm/keeper/msg_dispatcher.go index a81a57014e9..0e3db65ca81 100644 --- a/x/wasm/keeper/msg_dispatcher.go +++ b/x/wasm/keeper/msg_dispatcher.go @@ -144,7 +144,7 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk switch { case err != nil: return nil, sdkerrors.Wrap(err, "reply") - case rspData != nil: + case len(rspData) != 0: rsp = rspData } } diff --git a/x/wasm/keeper/msg_dispatcher_test.go b/x/wasm/keeper/msg_dispatcher_test.go index e58c49338b5..f152b4f2216 100644 --- a/x/wasm/keeper/msg_dispatcher_test.go +++ b/x/wasm/keeper/msg_dispatcher_test.go @@ -199,7 +199,7 @@ func TestDispatchSubmessages(t *testing.T) { return nil, nil, errors.New("my error") }, }, - expData: []byte{}, + expData: []byte("myReplyData:1"), expCommits: []bool{false, false}, }, "empty replyOn rejected": {