Skip to content

Commit

Permalink
fix: eth transaction detail.
Browse files Browse the repository at this point in the history
  • Loading branch information
iosguang committed May 5, 2022
1 parent 6ae0428 commit 8431d90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/eth/constants.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package eth

var (
const (
// ERC20 交易method
ERC20_METHOD_TRANSFER = "transfer"
ERC20_METHOD_APPROVE = "approve"
)

// 默认gas limit估算失败后,21000 * 3 = 63000
var (
const (
DEFAULT_CONTRACT_GAS_LIMIT = "63000"
DEFAULT_ETH_GAS_LIMIT = "21000"
// 当前网络 standard gas price
Expand Down
5 changes: 3 additions & 2 deletions core/eth/transactionDetail.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (e *EthChain) FetchTransactionDetail(hashString string) (detail *Transactio
if receipt.Status == 0 {
detail.Status = TransactionStatusFailure
// get error message
_, errTx := e.RemoteRpcClient.CallContract(ctx, ethereum.CallMsg{
_, err := e.RemoteRpcClient.CallContract(ctx, ethereum.CallMsg{
From: msg.From(),
To: msg.To(),
Data: msg.Data(),
Expand All @@ -140,8 +140,9 @@ func (e *EthChain) FetchTransactionDetail(hashString string) (detail *Transactio
Value: msg.Value(),
AccessList: msg.AccessList(),
}, receipt.BlockNumber)
if errTx != nil {
if err != nil {
detail.FailureMessage = err.Error()
err = nil
}

} else {
Expand Down

0 comments on commit 8431d90

Please sign in to comment.