From d999c9699eec8f64f24a7b9d31f1a90e41663c0b Mon Sep 17 00:00:00 2001 From: MengXiangJian <805442788@qq.com> Date: Thu, 5 Aug 2021 14:30:55 +0800 Subject: [PATCH] =?UTF-8?q?Merge=20PR=EF=BC=9Afix=20eth=5FgetCode=20failed?= =?UTF-8?q?=20after=20the=20contract=20is=20blocked=20(#941)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- x/evm/keeper/querier.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/evm/keeper/querier.go b/x/evm/keeper/querier.go index af6f689c9a..f126093812 100644 --- a/x/evm/keeper/querier.go +++ b/x/evm/keeper/querier.go @@ -153,7 +153,8 @@ func queryCode(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) { } addr := ethcmn.HexToAddress(path[1]) - code := keeper.GetCode(ctx, addr) + so := keeper.GetOrNewStateObject(ctx, addr) + code := keeper.GetCodeByHash(ctx, ethcmn.BytesToHash(so.CodeHash())) res := types.QueryResCode{Code: code} bz, err := codec.MarshalJSONIndent(keeper.cdc, res) if err != nil {