Ver código fonte

正确情况下不返回错误。

skyfffire 2 anos atrás
pai
commit
51c84efb9a
1 arquivos alterados com 5 adições e 5 exclusões
  1. 5 5
      internal/ethapi/api.go

+ 5 - 5
internal/ethapi/api.go

@@ -21,6 +21,7 @@ import (
 	"context"
 	"errors"
 	"fmt"
+	"github.com/ethereum/go-ethereum/accounts/abi"
 	"math/big"
 	"os"
 	"strings"
@@ -29,7 +30,6 @@ import (
 	"github.com/davecgh/go-spew/spew"
 
 	"github.com/ethereum/go-ethereum/accounts"
-	"github.com/ethereum/go-ethereum/accounts/abi"
 	"github.com/ethereum/go-ethereum/accounts/keystore"
 	"github.com/ethereum/go-ethereum/accounts/scwallet"
 	"github.com/ethereum/go-ethereum/common"
@@ -1034,11 +1034,11 @@ func (s *PublicBlockChainAPI) BatchCall(ctx context.Context, config BatchCallCon
 			results = append(results, CallResult{Return: nil, Error: err.Error()})
 		} else {
 			// If the result contains a revert reason, try to unpack it.
-			if len(result.Revert()) > 0 {
-				result.Err = newRevertError(result)
-			}
+			//if len(result.Revert()) > 0 {
+			//	result.Err = newRevertError(result)
+			//}
 
-			results = append(results, CallResult{Return: result.Return(), Error: result.Err.Error()})
+			results = append(results, CallResult{Return: result.Return(), Error: "no error."})
 		}
 	}
 	return results, nil