From 64113d991c9cf90f0a15b70ad17496b063409a23 Mon Sep 17 00:00:00 2001 From: YuanXingqiang Date: Tue, 10 May 2022 18:00:31 +0800 Subject: [PATCH] Merge PR: fix bug of simulate (#2015) --- app/ante/account.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/ante/account.go b/app/ante/account.go index f91100e062..f92408553d 100644 --- a/app/ante/account.go +++ b/app/ante/account.go @@ -209,8 +209,13 @@ func (avd AccountAnteDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate var acc exported.Account var getAccGasUsed sdk.Gas + address := msgEthTx.AccountAddress() + if address.Empty() && ctx.From() != "" { + msgEthTx.SetFrom(ctx.From()) + address = msgEthTx.AccountAddress() + } + if !simulate { - address := msgEthTx.AccountAddress() if address.Empty() { panic("sender address cannot be empty") }