Skip to content

Commit

Permalink
Fix import fmt and run tests for given architecture (ethereum#18)
Browse files Browse the repository at this point in the history
* fix gofmt

* Run tests for given architecture

* Speed up CI execution.
  • Loading branch information
mask-pp authored Jan 13, 2022
1 parent 20ce5c0 commit b4d6088
Show file tree
Hide file tree
Showing 81 changed files with 90 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ios:
@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."

test: all
$(GORUN) build/ci.go test
$(GORUN) build/ci.go test ./consensus ./core ./eth ./miner ./node ./trie

lint: ## Run linters.
$(GORUN) build/ci.go lint
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import (
"strings"
"time"

"github.com/google/uuid"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/google/uuid"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/passphrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ import (
"os"
"path/filepath"

"github.com/google/uuid"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/math"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/google/uuid"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/crypto/scrypt"
)
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/presale.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"errors"
"fmt"

"github.com/google/uuid"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/google/uuid"
"golang.org/x/crypto/pbkdf2"
)

Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ package keystore
import (
"time"

"github.com/scroll-tech/go-ethereum/log"
"github.com/rjeczalik/notify"
"github.com/scroll-tech/go-ethereum/log"
)

type watcher struct {
Expand Down
2 changes: 1 addition & 1 deletion accounts/scwallet/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ import (
"sync"
"time"

pcsc "github.com/gballet/go-libpcsclite"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/event"
"github.com/scroll-tech/go-ethereum/log"
pcsc "github.com/gballet/go-libpcsclite"
)

// Scheme is the URI prefix for smartcard wallets.
Expand Down
2 changes: 1 addition & 1 deletion accounts/scwallet/securechannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"crypto/sha512"
"fmt"

"github.com/scroll-tech/go-ethereum/crypto"
pcsc "github.com/gballet/go-libpcsclite"
"github.com/scroll-tech/go-ethereum/crypto"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/text/unicode/norm"
)
Expand Down
2 changes: 1 addition & 1 deletion accounts/scwallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import (
"sync"
"time"

pcsc "github.com/gballet/go-libpcsclite"
"github.com/scroll-tech/go-ethereum"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/scroll-tech/go-ethereum/log"
pcsc "github.com/gballet/go-libpcsclite"
"github.com/status-im/keycard-go/derivationpath"
)

Expand Down
2 changes: 1 addition & 1 deletion accounts/usbwallet/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"sync/atomic"
"time"

"github.com/karalabe/usb"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/event"
"github.com/scroll-tech/go-ethereum/log"
"github.com/karalabe/usb"
)

// LedgerScheme is the protocol scheme prefixing account and wallet URLs.
Expand Down
2 changes: 1 addition & 1 deletion accounts/usbwallet/trezor.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import (
"io"
"math/big"

"github.com/golang/protobuf/proto"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/accounts/usbwallet/trezor"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/hexutil"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/log"
"github.com/golang/protobuf/proto"
)

// ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In
Expand Down
2 changes: 1 addition & 1 deletion accounts/usbwallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (
"sync"
"time"

"github.com/karalabe/usb"
"github.com/scroll-tech/go-ethereum"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/scroll-tech/go-ethereum/log"
"github.com/karalabe/usb"
)

// Maximum time between wallet health checks to detect USB unplugs.
Expand Down
4 changes: 2 additions & 2 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func doInstall(cmdline []string) {
// better disable it. This check isn't the best, it should probably
// check for something in env instead.
if env.CI && runtime.GOARCH == "arm64" {
gobuild.Args = append(gobuild.Args, "-p", "1")
gobuild.Args = append(gobuild.Args, "-p", strconv.Itoa(runtime.NumCPU()))
}

// We use -trimpath to avoid leaking local paths into the built executables.
Expand Down Expand Up @@ -293,7 +293,7 @@ func doTest(cmdline []string) {

// Test a single package at a time. CI builders are slow
// and some tests run into timeouts under load.
gotest.Args = append(gotest.Args, "-p", "1")
gotest.Args = append(gotest.Args, "-p", strconv.Itoa(runtime.NumCPU()))
if *coverage {
gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover")
}
Expand Down
1 change: 1 addition & 0 deletions build/update-license.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

//go:build none
// +build none

/*
Expand Down
4 changes: 2 additions & 2 deletions cmd/clef/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import (
"strings"
"time"

"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/accounts/keystore"
"github.com/scroll-tech/go-ethereum/cmd/utils"
Expand All @@ -54,8 +56,6 @@ import (
"github.com/scroll-tech/go-ethereum/signer/fourbyte"
"github.com/scroll-tech/go-ethereum/signer/rules"
"github.com/scroll-tech/go-ethereum/signer/storage"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"gopkg.in/urfave/cli.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/ethkey/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"os"
"path/filepath"

"github.com/google/uuid"
"github.com/scroll-tech/go-ethereum/accounts/keystore"
"github.com/scroll-tech/go-ethereum/cmd/utils"
"github.com/scroll-tech/go-ethereum/crypto"
"github.com/google/uuid"
"gopkg.in/urfave/cli.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/faucet/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"sync"
"time"

"github.com/gorilla/websocket"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/accounts/keystore"
"github.com/scroll-tech/go-ethereum/cmd/utils"
Expand All @@ -58,7 +59,6 @@ import (
"github.com/scroll-tech/go-ethereum/p2p/enode"
"github.com/scroll-tech/go-ethereum/p2p/nat"
"github.com/scroll-tech/go-ethereum/params"
"github.com/gorilla/websocket"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

"gopkg.in/urfave/cli.v1"

"github.com/naoina/toml"
"github.com/scroll-tech/go-ethereum/accounts/external"
"github.com/scroll-tech/go-ethereum/accounts/keystore"
"github.com/scroll-tech/go-ethereum/accounts/scwallet"
Expand All @@ -39,7 +40,6 @@ import (
"github.com/scroll-tech/go-ethereum/metrics"
"github.com/scroll-tech/go-ethereum/node"
"github.com/scroll-tech/go-ethereum/params"
"github.com/naoina/toml"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/geth/version_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"regexp"
"strings"

"github.com/scroll-tech/go-ethereum/log"
"github.com/jedisct1/go-minisign"
"github.com/scroll-tech/go-ethereum/log"
"gopkg.in/urfave/cli.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/wizard.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (
"strings"
"sync"

"github.com/peterh/liner"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/console/prompt"
"github.com/scroll-tech/go-ethereum/core"
"github.com/scroll-tech/go-ethereum/log"
"github.com/peterh/liner"
"golang.org/x/crypto/ssh/terminal"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/wizard_netstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"strings"
"sync"

"github.com/olekukonko/tablewriter"
"github.com/scroll-tech/go-ethereum/core"
"github.com/scroll-tech/go-ethereum/log"
"github.com/olekukonko/tablewriter"
)

// networkStats verifies the status of network components and generates a protip
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"text/template"
"time"

pcsclite "github.com/gballet/go-libpcsclite"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/accounts/keystore"
"github.com/scroll-tech/go-ethereum/common"
Expand Down Expand Up @@ -66,7 +67,6 @@ import (
"github.com/scroll-tech/go-ethereum/p2p/nat"
"github.com/scroll-tech/go-ethereum/p2p/netutil"
"github.com/scroll-tech/go-ethereum/params"
pcsclite "github.com/gballet/go-libpcsclite"
gopsutil "github.com/shirou/gopsutil/mem"
"gopkg.in/urfave/cli.v1"
)
Expand Down
6 changes: 1 addition & 5 deletions consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"sync"
"time"

lru "github.com/hashicorp/golang-lru"
"github.com/scroll-tech/go-ethereum/accounts"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/hexutil"
Expand All @@ -41,7 +42,6 @@ import (
"github.com/scroll-tech/go-ethereum/rlp"
"github.com/scroll-tech/go-ethereum/rpc"
"github.com/scroll-tech/go-ethereum/trie"
lru "github.com/hashicorp/golang-lru"
"golang.org/x/crypto/sha3"
)

Expand Down Expand Up @@ -123,10 +123,6 @@ var (
// turn of the signer.
errWrongDifficulty = errors.New("wrong difficulty")

// errInvalidTimestamp is returned if the timestamp of a block is lower than
// the previous block's timestamp + the minimum block period.
errInvalidTimestamp = errors.New("invalid timestamp")

// errInvalidVotingChain is returned if an authorization list is attempted to
// be modified via out-of-range or non-contiguous headers.
errInvalidVotingChain = errors.New("invalid voting chain")
Expand Down
2 changes: 1 addition & 1 deletion consensus/clique/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
"sort"
"time"

lru "github.com/hashicorp/golang-lru"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/ethdb"
"github.com/scroll-tech/go-ethereum/log"
"github.com/scroll-tech/go-ethereum/params"
lru "github.com/hashicorp/golang-lru"
)

// Vote represents a single vote that an authorized signer made to modify the
Expand Down
2 changes: 1 addition & 1 deletion consensus/ethash/difficulty.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package ethash
import (
"math/big"

"github.com/scroll-tech/go-ethereum/core/types"
"github.com/holiman/uint256"
"github.com/scroll-tech/go-ethereum/core/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion consensus/ethash/ethash.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ import (
"unsafe"

"github.com/edsrzf/mmap-go"
"github.com/hashicorp/golang-lru/simplelru"
"github.com/scroll-tech/go-ethereum/consensus"
"github.com/scroll-tech/go-ethereum/log"
"github.com/scroll-tech/go-ethereum/metrics"
"github.com/scroll-tech/go-ethereum/rpc"
"github.com/hashicorp/golang-lru/simplelru"
)

var ErrInvalidDumpMagic = errors.New("invalid dump magic")
Expand Down
4 changes: 2 additions & 2 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import (
"syscall"

"github.com/dop251/goja"
"github.com/mattn/go-colorable"
"github.com/peterh/liner"
"github.com/scroll-tech/go-ethereum/console/prompt"
"github.com/scroll-tech/go-ethereum/internal/jsre"
"github.com/scroll-tech/go-ethereum/internal/jsre/deps"
"github.com/scroll-tech/go-ethereum/internal/web3ext"
"github.com/scroll-tech/go-ethereum/rpc"
"github.com/mattn/go-colorable"
"github.com/peterh/liner"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"sync/atomic"
"time"

lru "github.com/hashicorp/golang-lru"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/mclock"
"github.com/scroll-tech/go-ethereum/common/prque"
Expand All @@ -44,7 +45,6 @@ import (
"github.com/scroll-tech/go-ethereum/metrics"
"github.com/scroll-tech/go-ethereum/params"
"github.com/scroll-tech/go-ethereum/trie"
lru "github.com/hashicorp/golang-lru"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/headerchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (
"sync/atomic"
"time"

lru "github.com/hashicorp/golang-lru"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/consensus"
"github.com/scroll-tech/go-ethereum/core/rawdb"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/scroll-tech/go-ethereum/ethdb"
"github.com/scroll-tech/go-ethereum/log"
"github.com/scroll-tech/go-ethereum/params"
lru "github.com/hashicorp/golang-lru"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion core/rawdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (
"sync/atomic"
"time"

"github.com/olekukonko/tablewriter"
"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/ethdb"
"github.com/scroll-tech/go-ethereum/ethdb/leveldb"
"github.com/scroll-tech/go-ethereum/ethdb/memorydb"
"github.com/scroll-tech/go-ethereum/log"
"github.com/olekukonko/tablewriter"
)

// freezerdb is a database wrapper that enabled freezer data retrievals.
Expand Down
Loading

0 comments on commit b4d6088

Please sign in to comment.