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

Commit

Permalink
rpc: fix metamask pending while sending an error transaction (#711)
Browse files Browse the repository at this point in the history
* fix pending state in metamaks wallet when sending an error tx and rejected by antehandle

* using abci.CodeTypeOK instead 0
  • Loading branch information
KamiD authored Jan 18, 2021
1 parent 35bb751 commit cfe629c
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit cfe629c

Please sign in to comment.