From 2e7c9a71185487db1e2b6d8bc3045220e70ca49b Mon Sep 17 00:00:00 2001 From: BoThe1K Date: Fri, 15 Dec 2023 13:35:23 +0100 Subject: [PATCH] Update code status handling for getTransactionReceipt --- rpc/namespaces/ethereum/eth/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/namespaces/ethereum/eth/api.go b/rpc/namespaces/ethereum/eth/api.go index 047e2fb8..926f71b5 100644 --- a/rpc/namespaces/ethereum/eth/api.go +++ b/rpc/namespaces/ethereum/eth/api.go @@ -12,6 +12,7 @@ import ( "github.com/spf13/viper" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" tmrpctypes "github.com/tendermint/tendermint/rpc/core/types" @@ -801,7 +802,7 @@ func (e *PublicAPI) GetTransactionReceipt(hash common.Hash) (*rpctypes.Transacti ) // Set status codes based on tx result status := ethtypes.ReceiptStatusSuccessful - if res.TxResult.GetCode() == 1 { + if res.TxResult.GetCode() != abci.CodeTypeOK { status = ethtypes.ReceiptStatusFailed } else { // Get the transaction result from the log