Browse Source

Code -> Success

skyfffire 2 năm trước cách đây
mục cha
commit
945fb23771
1 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 5
      internal/ethapi/api.go

+ 5 - 5
internal/ethapi/api.go

@@ -971,9 +971,9 @@ type BatchCallArgs struct {
 
 // CallResult is the result of one call.
 type CallResult struct {
-	Return hexutil.Bytes
-	Msg    string
-	Code   int8
+	Return  hexutil.Bytes
+	Msg     string
+	Success bool
 }
 
 // BlockChainAPI provides an API to access Ethereum blockchain data.
@@ -1032,9 +1032,9 @@ func (s *PublicBlockChainAPI) BatchCall(ctx context.Context, config BatchCallCon
 		result, err := doCall(ctx, s.b, call.CallArgs, state, header, timeout, gp, &blockContext)
 		if err != nil {
 			fmt.Fprintf(os.Stderr, "call execution reverted: %v\n\n", err)
-			results = append(results, CallResult{Code: 0, Return: nil, Msg: err.Error()})
+			results = append(results, CallResult{Success: false, Return: nil, Msg: err.Error()})
 		} else {
-			results = append(results, CallResult{Code: 1, Return: result.Return(), Msg: "Success."})
+			results = append(results, CallResult{Success: true, Return: result.Return(), Msg: "Success."})
 		}
 	}
 	return results, nil