Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Fix metamask pending while sending an error transaction #711

Merged
merged 7 commits into from
Jan 18, 2021
Merged
6 changes: 6 additions & 0 deletions rpc/namespaces/eth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ func (api *PublicEthereumAPI) SendTransaction(args rpctypes.SendTxArgs) (common.
return common.Hash{}, err
}

if res.Code != abci.CodeTypeOK {
return common.Hash{}, fmt.Errorf(res.RawLog)
}
// Return transaction hash
return common.HexToHash(res.TxHash), nil
}
Expand Down Expand Up @@ -501,6 +504,9 @@ func (api *PublicEthereumAPI) SendRawTransaction(data hexutil.Bytes) (common.Has
return common.Hash{}, err
}

if res.Code != abci.CodeTypeOK {
return common.Hash{}, fmt.Errorf(res.RawLog)
}
// Return transaction hash
return common.HexToHash(res.TxHash), nil
}
Expand Down