[rpc] Fix lint

pull/3389/head
Janet Liang 4 years ago
parent 346a5dda7c
commit 9737ca0b21
  1. 10
      hmy/tracer.go
  2. 2
      rpc/rpc.go
  3. 2
      rpc/tracer.go

@ -20,7 +20,6 @@ import (
"bufio" "bufio"
"context" "context"
"fmt" "fmt"
"github.com/ethereum/go-ethereum/common/math"
"io/ioutil" "io/ioutil"
"os" "os"
"runtime" "runtime"
@ -29,6 +28,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/trie" "github.com/ethereum/go-ethereum/trie"
"github.com/harmony-one/harmony/core" "github.com/harmony-one/harmony/core"
@ -142,7 +142,7 @@ func (hmy *Harmony) TraceChain(ctx context.Context, start, end *types.Block, con
} }
// Execute all the transactions contained within the chain concurrently for each block // Execute all the transactions contained within the chain concurrently for each block
blocks := int(end.NumberU64()-origin) blocks := int(end.NumberU64() - origin)
threads := runtime.NumCPU() threads := runtime.NumCPU()
if threads > blocks { if threads > blocks {
@ -632,10 +632,10 @@ func (hmy *Harmony) TraceTx(ctx context.Context, message core.Message, vmctx vm.
switch tracer := tracer.(type) { switch tracer := tracer.(type) {
case *vm.StructLogger: case *vm.StructLogger:
return &ExecutionResult{ return &ExecutionResult{
Gas: result.UsedGas, Gas: result.UsedGas,
Failed: result.VMErr != nil, Failed: result.VMErr != nil,
ReturnValue: fmt.Sprintf("%x", result.ReturnData), ReturnValue: fmt.Sprintf("%x", result.ReturnData),
StructLogs: FormatLogs(tracer.StructLogs()), StructLogs: FormatLogs(tracer.StructLogs()),
}, nil }, nil
default: default:

@ -16,7 +16,7 @@ import (
// Version enum // Version enum
const ( const (
V1 Version = iota V1 Version = iota
V2 V2
Debug Debug
) )

@ -21,7 +21,6 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/harmony-one/harmony/hmy"
"time" "time"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
@ -30,6 +29,7 @@ import (
"github.com/harmony-one/harmony/core" "github.com/harmony-one/harmony/core"
"github.com/harmony-one/harmony/core/rawdb" "github.com/harmony-one/harmony/core/rawdb"
"github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/hmy"
) )
const ( const (

Loading…
Cancel
Save