mirror of https://github.com/poanetwork/quorum.git
run goimports
This commit is contained in:
parent
dff3a833af
commit
bc204f148d
|
@ -19,7 +19,6 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"math"
|
||||
"os"
|
||||
godebug "runtime/debug"
|
||||
|
@ -28,6 +27,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/elastic/gosigar"
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
|
|
|
@ -273,7 +273,7 @@ var AppHelpFlagGroups = []flagGroup{
|
|||
},
|
||||
{
|
||||
Name: "MISC",
|
||||
},{
|
||||
}, {
|
||||
Name: "ISTANBUL",
|
||||
Flags: []cli.Flag{
|
||||
utils.IstanbulRequestTimeoutFlag,
|
||||
|
|
|
@ -27,6 +27,8 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
@ -57,7 +59,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/params"
|
||||
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
|
||||
"gopkg.in/urfave/cli.v1"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -175,7 +175,6 @@ func BytesToAddress(b []byte) Address {
|
|||
|
||||
func StringToAddress(s string) Address { return BytesToAddress([]byte(s)) } // dep: Istanbul
|
||||
|
||||
|
||||
// BigToAddress returns Address with byte values of b.
|
||||
// If b is larger than len(h), b will be cropped from the left.
|
||||
func BigToAddress(b *big.Int) Address { return BytesToAddress(b.Bytes()) }
|
||||
|
|
|
@ -316,8 +316,6 @@ func (sb *backend) HasBadProposal(hash common.Hash) bool {
|
|||
return sb.hasBadBlock(hash)
|
||||
}
|
||||
|
||||
|
||||
|
||||
func (sb *backend) Close() error {
|
||||
return nil
|
||||
}
|
|
@ -616,7 +616,6 @@ func sigHash(header *types.Header) (hash common.Hash) {
|
|||
return hash
|
||||
}
|
||||
|
||||
|
||||
// SealHash returns the hash of a block prior to it being sealed.
|
||||
func (sb *backend) SealHash(header *types.Header) common.Hash {
|
||||
return sigHash(header)
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
||||
//"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
//"github.com/ethereum/go-ethereum/core/vm"
|
||||
|
|
|
@ -4,6 +4,9 @@ import (
|
|||
"crypto/ecdsa"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"regexp"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
@ -14,8 +17,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||
pbind "github.com/ethereum/go-ethereum/permission/bind"
|
||||
"math/big"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var isStringAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9_-]*$`).MatchString
|
||||
|
|
|
@ -119,7 +119,7 @@ func TestIntermediateLeaks(t *testing.T) {
|
|||
|
||||
func TestStorageRoot(t *testing.T) {
|
||||
var (
|
||||
mem = ethdb.NewMemDatabase()
|
||||
mem = ethdb.NewMemDatabase()
|
||||
db = NewDatabase(mem)
|
||||
state, _ = New(common.Hash{}, db)
|
||||
addr = common.Address{1}
|
||||
|
|
|
@ -231,7 +231,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
|
|||
|
||||
var (
|
||||
leftoverGas uint64
|
||||
evm = st.evm
|
||||
evm = st.evm
|
||||
// vm errors do not effect consensus and are therefor
|
||||
// not assigned to err, except for insufficient balance
|
||||
// error.
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/hashicorp/golang-lru"
|
||||
"math/big"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/hashicorp/golang-lru"
|
||||
)
|
||||
|
||||
type AccessType uint8
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
"sync/atomic"
|
||||
|
||||
fmt "fmt"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
|
|
|
@ -26,6 +26,6 @@ var (
|
|||
ErrInsufficientBalance = errors.New("insufficient balance for transfer")
|
||||
ErrContractAddressCollision = errors.New("contract address collision")
|
||||
|
||||
ErrReadOnlyValueTransfer = errors.New("VM in read-only mode. Value transfer prohibited.")
|
||||
ErrNoCompatibleInterpreter = errors.New("no compatible interpreter")
|
||||
ErrReadOnlyValueTransfer = errors.New("VM in read-only mode. Value transfer prohibited.")
|
||||
ErrNoCompatibleInterpreter = errors.New("no compatible interpreter")
|
||||
)
|
||||
|
|
|
@ -246,10 +246,10 @@ func testGetBlockBodies(t *testing.T, protocol int) {
|
|||
available []bool // Availability of explicitly requested blocks
|
||||
expected int // Total number of existing blocks to expect
|
||||
}{
|
||||
{1, nil, nil, 1}, // A single random block should be retrievable
|
||||
{10, nil, nil, 10}, // Multiple random blocks should be retrievable
|
||||
{limit, nil, nil, limit}, // The maximum possible blocks should be retrievable
|
||||
{limit + 1, nil, nil, limit}, // No more than the possible block count should be returned
|
||||
{1, nil, nil, 1}, // A single random block should be retrievable
|
||||
{10, nil, nil, 10}, // Multiple random blocks should be retrievable
|
||||
{limit, nil, nil, limit}, // The maximum possible blocks should be retrievable
|
||||
{limit + 1, nil, nil, limit}, // No more than the possible block count should be returned
|
||||
{0, []common.Hash{pm.blockchain.Genesis().Hash()}, []bool{true}, 1}, // The genesis block should be retrievable
|
||||
{0, []common.Hash{pm.blockchain.CurrentBlock().Hash()}, []bool{true}, 1}, // The chains head block should be retrievable
|
||||
{0, []common.Hash{{}}, []bool{false}, 0}, // A non existent block should not be returned
|
||||
|
|
|
@ -29,9 +29,10 @@ import (
|
|||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"sync"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
|
|
@ -28,10 +28,10 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/eth/downloader"
|
||||
"github.com/ethereum/go-ethereum/ethdb"
|
||||
"github.com/ethereum/go-ethereum/event"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/ethdb"
|
||||
)
|
||||
|
||||
// Backend wraps all methods required for mining.
|
||||
|
|
|
@ -4,6 +4,13 @@ import (
|
|||
"crypto/ecdsa"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"math/big"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
@ -16,12 +23,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/params"
|
||||
pbind "github.com/ethereum/go-ethereum/permission/bind"
|
||||
"github.com/ethereum/go-ethereum/raft"
|
||||
"io/ioutil"
|
||||
"math/big"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type NodeOperation uint8
|
||||
|
|
|
@ -89,8 +89,8 @@ func New(path string) (*Constellation, error) {
|
|||
return nil, err
|
||||
}
|
||||
return &Constellation{
|
||||
node: n,
|
||||
c: cache.New(5*time.Minute, 5*time.Minute),
|
||||
node: n,
|
||||
c: cache.New(5*time.Minute, 5*time.Minute),
|
||||
isConstellationNotInUse: false,
|
||||
}, nil
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ func New(path string) (*Constellation, error) {
|
|||
func MustNew(path string) *Constellation {
|
||||
if strings.EqualFold(path, "ignore") {
|
||||
return &Constellation{
|
||||
node: nil,
|
||||
c: nil,
|
||||
node: nil,
|
||||
c: nil,
|
||||
isConstellationNotInUse: true,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/tv42/httpunix"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
@ -14,6 +13,8 @@ import (
|
|||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/tv42/httpunix"
|
||||
)
|
||||
|
||||
func launchNode(cfgPath string) (*exec.Cmd, error) {
|
||||
|
|
|
@ -765,7 +765,7 @@ func (pm *ProtocolManager) eventLoop() {
|
|||
case raftpb.ConfChangeAddNode:
|
||||
if pm.isRaftIdRemoved(raftId) {
|
||||
log.Info("ignoring ConfChangeAddNode for permanently-removed peer", "raft id", raftId)
|
||||
} else if peer := pm.peers[raftId]; peer != nil && raftId <= uint16(len(pm.bootstrapNodes)) {
|
||||
} else if peer := pm.peers[raftId]; peer != nil && raftId <= uint16(len(pm.bootstrapNodes)) {
|
||||
// See initial cluster logic in startRaft() for more information.
|
||||
log.Info("ignoring expected ConfChangeAddNode for initial peer", "raft id", raftId)
|
||||
|
||||
|
|
|
@ -5,10 +5,11 @@ import (
|
|||
"net"
|
||||
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||
"github.com/ethereum/go-ethereum/p2p/enr"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"log"
|
||||
)
|
||||
|
||||
// Serializable information about a Peer. Sufficient to build `etcdRaft.Peer`
|
||||
|
|
Loading…
Reference in New Issue