Use goimports instead of gofmt

This commit is contained in:
Pedro Pombeiro 2020-01-02 10:10:19 +01:00 committed by Pedro Pombeiro
parent 3eaacaa2f4
commit c8a911ebd1
266 changed files with 602 additions and 271 deletions

View File

@ -2,13 +2,14 @@ run:
concurrency: 4
deadline: 1m
issues-exit-code: 1
modules-download-mode: vendor
tests: true
skip-dirs:
- static
- vendor
skip-files:
- bindata.go
- .*_mock.go
- jail/doc.go
- contracts/
output:
@ -26,6 +27,8 @@ linters-settings:
min-confidence: 0.8
gofmt:
simplify: true
goimports:
local-prefixes: github.com/ethereum/go-ethereum,github.com/status-im/status-go
gocyclo:
min-complexity: 16
maligned:
@ -44,7 +47,7 @@ linters:
- gosec
- goconst
- gocyclo
- gofmt
- goimports
- golint
- govet
- ineffassign

View File

@ -177,7 +177,8 @@ clean-release:
rm -rf $(RELEASE_DIR)
gofmt:
find . -name '*.go' -and -not -name 'bindata*' -and -not -name 'migrations.go' -and -not -wholename '*/vendor/*' -exec gofmt -s -w {} \;
find . -name '*.go' -and -not -name 'bindata*' -and -not -name 'migrations.go' -and -not -wholename '*/vendor/*' -exec goimports -local 'github.com/ethereum/go-ethereum,github.com/status-im/status-go' -w {} \;
$(MAKE) vendor
check-existing-release:
@git ls-remote --exit-code origin "v$(RELEASE_TAG)" >/dev/null || exit 0; \

View File

@ -4,6 +4,7 @@ package account
import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/status-im/status-go/account/generator"
)

View File

@ -3,9 +3,10 @@ package account
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
"github.com/stretchr/testify/require"
)
func TestCreateAddress(t *testing.T) {

View File

@ -7,8 +7,10 @@ import (
"strings"
"sync"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/pborman/uuid"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/extkeys"

View File

@ -5,8 +5,9 @@ import (
"strings"
"testing"
"github.com/ethereum/go-ethereum/crypto"
"github.com/stretchr/testify/assert"
"github.com/ethereum/go-ethereum/crypto"
)
var testAccount = struct {

View File

@ -3,10 +3,11 @@ package generator
import (
"testing"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/extkeys"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/extkeys"
)
func generateTestKey(t *testing.T) *extkeys.ExtendedKey {

View File

@ -8,6 +8,7 @@ import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/keystore"
gethbridge "github.com/status-im/status-go/eth-node/bridge/geth"
"github.com/status-im/status-go/eth-node/types"
)

View File

@ -4,6 +4,7 @@ import (
"fmt"
"github.com/pborman/uuid"
"github.com/status-im/status-go/account/generator"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"

View File

@ -4,12 +4,13 @@ package account
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"github.com/status-im/status-go/account/generator"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/extkeys"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
type AccountUtilsTestSuite struct {

View File

@ -6,13 +6,14 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/account"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/node"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/signal"
"github.com/status-im/status-go/t/utils"
"github.com/stretchr/testify/require"
)
const (

View File

@ -12,7 +12,11 @@ import (
"sync"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
gethcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/status-im/status-go/account"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
@ -24,8 +28,6 @@ import (
"github.com/status-im/status-go/services/typeddata"
"github.com/status-im/status-go/t/utils"
"github.com/status-im/status-go/transactions"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var (

View File

@ -18,6 +18,7 @@ import (
"github.com/ethereum/go-ethereum/log"
gethnode "github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/account"
"github.com/status-im/status-go/appdatabase"
"github.com/status-im/status-go/eth-node/crypto"

View File

@ -4,12 +4,13 @@ import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/services/personal"
"github.com/status-im/status-go/t/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestHashMessage(t *testing.T) {

View File

@ -4,6 +4,7 @@ import (
"database/sql"
bindata "github.com/status-im/migrate/v4/source/go_bindata"
"github.com/status-im/status-go/sqlite"
)

View File

@ -12,9 +12,13 @@ import (
"path/filepath"
"time"
"golang.org/x/crypto/sha3"
"golang.org/x/crypto/ssh/terminal"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/api"
gethbridge "github.com/status-im/status-go/eth-node/bridge/geth"
"github.com/status-im/status-go/eth-node/types"
@ -23,8 +27,6 @@ import (
"github.com/status-im/status-go/rpc"
"github.com/status-im/status-go/services/shhext"
"github.com/status-im/status-go/t/helpers"
"golang.org/x/crypto/sha3"
"golang.org/x/crypto/ssh/terminal"
)
const (

View File

@ -4,8 +4,9 @@ import (
"fmt"
"testing"
"github.com/status-im/status-go/params"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/params"
)
// nolint: deadcode

View File

@ -13,9 +13,12 @@ import (
"strings"
"time"
"github.com/okzk/sdnotify"
"golang.org/x/crypto/ssh/terminal"
"github.com/ethereum/go-ethereum/log"
gethmetrics "github.com/ethereum/go-ethereum/metrics"
"github.com/okzk/sdnotify"
"github.com/status-im/status-go/api"
"github.com/status-im/status-go/logutils"
"github.com/status-im/status-go/metrics"
@ -23,7 +26,6 @@ import (
"github.com/status-im/status-go/node"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/profiling"
"golang.org/x/crypto/ssh/terminal"
)
const (

View File

@ -6,6 +6,7 @@ import (
"strings"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/status-im/status-go/params"
)

View File

@ -3,8 +3,9 @@ package topics
import (
"testing"
"github.com/status-im/status-go/params"
"github.com/stretchr/testify/assert"
"github.com/status-im/status-go/params"
)
func TestTopicFlags(t *testing.T) {

View File

@ -27,6 +27,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/status-im/status-go/contracts/ens/contract"
)

View File

@ -25,6 +25,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/crypto"
"github.com/status-im/status-go/contracts/ens/contract"
)

View File

@ -3,13 +3,14 @@ package db
import (
"path/filepath"
"github.com/ethereum/go-ethereum/log"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/syndtr/goleveldb/leveldb/storage"
"github.com/syndtr/goleveldb/leveldb/util"
"github.com/ethereum/go-ethereum/log"
)
type storagePrefix byte

View File

@ -6,8 +6,9 @@ import (
"errors"
"time"
"github.com/status-im/status-go/eth-node/types"
"github.com/syndtr/goleveldb/leveldb/util"
"github.com/status-im/status-go/eth-node/types"
)
var (

View File

@ -3,8 +3,9 @@ package db
import (
"time"
"github.com/status-im/status-go/eth-node/types"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/status-im/status-go/eth-node/types"
)
// NewHistoryStore returns HistoryStore instance.

View File

@ -4,8 +4,9 @@ import (
"testing"
"time"
"github.com/status-im/status-go/eth-node/types"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/eth-node/types"
)
func createInMemStore(t *testing.T) HistoryStore {

View File

@ -4,8 +4,9 @@ import (
"testing"
"time"
"github.com/status-im/status-go/eth-node/types"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/eth-node/types"
)
func TestTopicHistoryStoreLoadFromKey(t *testing.T) {

View File

@ -6,8 +6,9 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/p2p/discv5"
)
func newRegistry() *registry {

View File

@ -9,12 +9,13 @@ import (
"sync"
"time"
ma "github.com/multiformats/go-multiaddr"
"github.com/status-im/rendezvous"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr"
ma "github.com/multiformats/go-multiaddr"
"github.com/status-im/rendezvous"
)
const (

View File

@ -5,10 +5,6 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr"
lcrypto "github.com/libp2p/go-libp2p-core/crypto"
ma "github.com/multiformats/go-multiaddr"
"github.com/status-im/rendezvous/server"
@ -16,6 +12,11 @@ import (
"github.com/stretchr/testify/require"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/storage"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr"
)
func makeTestRendezvousServer(t *testing.T, addr string) *server.Server {

View File

@ -8,11 +8,13 @@ import (
"math/big"
"time"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/status-im/status-go/eth-node/crypto"
enstypes "github.com/status-im/status-go/eth-node/types/ens"
ens "github.com/wealdtech/go-ens/v3"
"go.uber.org/zap"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/status-im/status-go/eth-node/crypto"
enstypes "github.com/status-im/status-go/eth-node/types/ens"
)
const (

View File

@ -8,6 +8,7 @@ import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/extkeys"
)

View File

@ -1,13 +1,15 @@
package gethbridge
import (
"go.uber.org/zap"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p/enode"
gethens "github.com/status-im/status-go/eth-node/bridge/geth/ens"
"github.com/status-im/status-go/eth-node/types"
enstypes "github.com/status-im/status-go/eth-node/types/ens"
"github.com/status-im/status-go/whisper/v6"
"go.uber.org/zap"
)
type gethNodeWrapper struct {

View File

@ -4,6 +4,7 @@ import (
"context"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/whisper/v6"
)

View File

@ -2,6 +2,7 @@ package gethbridge
import (
"github.com/ethereum/go-ethereum/event"
"github.com/status-im/status-go/eth-node/types"
)

View File

@ -24,10 +24,11 @@ import (
"time"
"unsafe"
"go.uber.org/zap"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
enstypes "github.com/status-im/status-go/eth-node/types/ens"
"go.uber.org/zap"
)
type nimbusNodeWrapper struct {

View File

@ -24,6 +24,7 @@ import (
"unsafe"
gopointer "github.com/mattn/go-pointer"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
)

View File

@ -2,8 +2,9 @@ package crypto
import (
"encoding/hex"
"github.com/stretchr/testify/require"
"testing"
"github.com/stretchr/testify/require"
)
func TestExtractSignatures(t *testing.T) {

View File

@ -10,8 +10,9 @@ import (
"io"
dr "github.com/status-im/doubleratchet"
"github.com/status-im/status-go/eth-node/crypto/ecies"
"golang.org/x/crypto/hkdf"
"github.com/status-im/status-go/eth-node/crypto/ecies"
)
// EthereumCrypto is an implementation of Crypto with cryptographic primitives recommended

View File

@ -28,11 +28,13 @@ import (
"math/big"
"os"
"golang.org/x/crypto/sha3"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto/secp256k1"
"github.com/ethereum/go-ethereum/rlp"
"github.com/status-im/status-go/eth-node/types"
"golang.org/x/crypto/sha3"
)
//SignatureLength indicates the byte length required to carry a signature with recovery id.

View File

@ -13,11 +13,12 @@ import (
"fmt"
"github.com/pborman/uuid"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/crypto/scrypt"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/extkeys"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/crypto/scrypt"
)
const (

View File

@ -4,6 +4,7 @@ import (
"crypto/ecdsa"
"github.com/pborman/uuid"
"github.com/status-im/status-go/extkeys"
)

View File

@ -3,8 +3,9 @@ package types
import (
"fmt"
enstypes "github.com/status-im/status-go/eth-node/types/ens"
"go.uber.org/zap"
enstypes "github.com/status-im/status-go/eth-node/types/ens"
)
// EnodeID is a unique identifier for each node.

View File

@ -9,6 +9,7 @@ import (
"testing"
"github.com/btcsuite/btcd/chaincfg"
"github.com/ethereum/go-ethereum/crypto"
)

View File

@ -10,6 +10,8 @@ import (
"os"
"unsafe"
validator "gopkg.in/go-playground/validator.v9"
"github.com/status-im/status-go/api"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/exportlogs"
@ -23,7 +25,6 @@ import (
"github.com/status-im/status-go/services/typeddata"
"github.com/status-im/status-go/signal"
"github.com/status-im/status-go/transactions"
validator "gopkg.in/go-playground/validator.v9"
)
// OpenAccounts opens database and returns accounts list.

View File

@ -13,9 +13,10 @@ import (
"strconv"
"testing"
. "github.com/status-im/status-go/t/utils" //nolint: golint
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
. "github.com/status-im/status-go/t/utils" //nolint: golint
)
func TestMain(m *testing.M) {

View File

@ -15,6 +15,7 @@ import (
"testing"
"github.com/ethereum/go-ethereum/event"
"github.com/status-im/status-go/account/generator"
)

View File

@ -23,8 +23,11 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/event"
"github.com/status-im/status-go/account"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/keystore"
@ -33,7 +36,6 @@ import (
"github.com/status-im/status-go/signal"
. "github.com/status-im/status-go/t/utils" //nolint: golint
"github.com/status-im/status-go/transactions"
"github.com/stretchr/testify/require"
)
var (

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/status-im/status-go/account"
"github.com/status-im/status-go/transactions"
)

View File

@ -1,8 +1,9 @@
package logutils
import (
"github.com/ethereum/go-ethereum/log"
lumberjack "gopkg.in/natefinch/lumberjack.v2"
"github.com/ethereum/go-ethereum/log"
)
// FileOptions are all options supported by internal rotation module.

View File

@ -5,6 +5,7 @@ import (
"strings"
"github.com/ethereum/go-ethereum/log"
"github.com/status-im/status-go/params"
)

View File

@ -2,13 +2,15 @@ package logutils
import (
"fmt"
"github.com/ethereum/go-ethereum/log"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"math"
"sync"
"time"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"github.com/ethereum/go-ethereum/log"
"github.com/status-im/status-go/protocol/zaputil"
)

View File

@ -3,10 +3,12 @@ package logutils
import (
"bytes"
"errors"
"github.com/ethereum/go-ethereum/log"
"testing"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"testing"
"github.com/ethereum/go-ethereum/log"
)
func TestNewZapAdapter(t *testing.T) {

View File

@ -5,12 +5,14 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/rlp"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/whisper/v6"
"github.com/stretchr/testify/require"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/storage"
"github.com/ethereum/go-ethereum/rlp"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/whisper/v6"
)
func TestCleaner(t *testing.T) {

View File

@ -3,8 +3,9 @@ package mailserver
import (
"testing"
"github.com/status-im/status-go/eth-node/types"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/eth-node/types"
)
func TestNewDBKey(t *testing.T) {

View File

@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/whisper/v6"

View File

@ -4,15 +4,17 @@ import (
"fmt"
"time"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/whisper/v6"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/util"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/whisper/v6"
)
type LevelDB struct {

View File

@ -10,11 +10,13 @@ import (
"github.com/status-im/migrate/v4"
"github.com/status-im/migrate/v4/database/postgres"
bindata "github.com/status-im/migrate/v4/source/go_bindata"
"github.com/status-im/status-go/mailserver/migrations"
"github.com/status-im/status-go/params"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/whisper/v6"
)

View File

@ -29,13 +29,15 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/rlp"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/whisper/v6"
"github.com/stretchr/testify/suite"
)
const powRequirement = 0.00001

View File

@ -7,13 +7,14 @@ import (
"math/big"
"testing"
"github.com/stretchr/testify/suite"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/stretchr/testify/suite"
)
type VerifierTestSuite struct {

View File

@ -3,9 +3,10 @@ package node
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/stretchr/testify/require"
prom "github.com/prometheus/client_golang/prometheus"
)

View File

@ -4,8 +4,9 @@ import (
"context"
"testing"
"github.com/ethereum/go-ethereum/node"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/node"
)
func TestSubscribeServerEventsWithoutServer(t *testing.T) {

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/status-im/status-go/account"
"github.com/status-im/status-go/transactions"
)

View File

@ -8,7 +8,10 @@ import (
"os"
"unsafe"
validator "gopkg.in/go-playground/validator.v9"
"github.com/ethereum/go-ethereum/log"
"github.com/status-im/status-go/api"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/exportlogs"
@ -22,7 +25,6 @@ import (
"github.com/status-im/status-go/services/typeddata"
"github.com/status-im/status-go/signal"
"github.com/status-im/status-go/transactions"
validator "gopkg.in/go-playground/validator.v9"
)
var statusBackend = api.NewGethStatusBackend()

View File

@ -7,10 +7,11 @@ import (
"os"
"testing"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/appdatabase"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/params"
"github.com/stretchr/testify/require"
)
var (

View File

@ -4,6 +4,7 @@ import (
"database/sql"
bindata "github.com/status-im/migrate/v4/source/go_bindata"
"github.com/status-im/status-go/sqlite"
)

View File

@ -9,6 +9,8 @@ import (
"path/filepath"
"time"
"github.com/syndtr/goleveldb/leveldb"
"github.com/ethereum/go-ethereum/accounts"
gethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
@ -22,6 +24,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/nat"
gethbridge "github.com/status-im/status-go/eth-node/bridge/geth"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/mailserver"
@ -35,7 +38,6 @@ import (
"github.com/status-im/status-go/static"
"github.com/status-im/status-go/timesource"
"github.com/status-im/status-go/whisper/v6"
"github.com/syndtr/goleveldb/leveldb"
)
// Errors related to node and services creation.

View File

@ -5,9 +5,10 @@ import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/whisper/v6"
"github.com/stretchr/testify/require"
)
func TestWhisperLightModeEnabledSetsEmptyBloomFilter(t *testing.T) {

View File

@ -4,14 +4,16 @@ import (
"net"
"testing"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/t/utils"
"github.com/stretchr/testify/require"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/storage"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/t/utils"
)
var enode1 = "enode://f32efef2739e5135a0f9a80600b321ba4d13393a5f1d3f5f593df85919262f06c70bfa66d38507b9d79a91021f5e200ec20150592e72934c66248e87014c4317@1.1.1.1:30404"

View File

@ -12,6 +12,9 @@ import (
"sync"
"time"
ma "github.com/multiformats/go-multiaddr"
"github.com/syndtr/goleveldb/leveldb"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/les"
"github.com/ethereum/go-ethereum/log"
@ -19,9 +22,8 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr"
ma "github.com/multiformats/go-multiaddr"
"github.com/status-im/status-go/whisper/v6"
"github.com/syndtr/goleveldb/leveldb"
"github.com/status-im/status-go/db"
"github.com/status-im/status-go/discovery"

View File

@ -17,13 +17,15 @@ import (
gethnode "github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/whisper/v6"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/discovery"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/t/helpers"
"github.com/status-im/status-go/t/utils"
"github.com/stretchr/testify/require"
)
func TestStatusNodeStart(t *testing.T) {

View File

@ -11,14 +11,16 @@ import (
"strings"
"time"
validator "gopkg.in/go-playground/validator.v9"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/params"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/static"
"github.com/status-im/status-go/whisper/v6"
validator "gopkg.in/go-playground/validator.v9"
)
// ----------

View File

@ -9,11 +9,13 @@ import (
validator "gopkg.in/go-playground/validator.v9"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/t/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/t/utils"
)
func TestNewNodeConfigWithDefaults(t *testing.T) {

View File

@ -1,12 +1,14 @@
package peers
import (
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/db"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
)
// NewCache returns instance of PeersDatabase

View File

@ -6,12 +6,13 @@ import (
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/storage"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/discv5"
)
func TestPeersRange(t *testing.T) {

View File

@ -5,6 +5,7 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/signal"
)

View File

@ -5,13 +5,15 @@ import (
"testing"
"time"
"github.com/stretchr/testify/suite"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/params"
"github.com/stretchr/testify/suite"
)
type CacheOnlyTopicPoolSuite struct {

View File

@ -8,11 +8,6 @@ import (
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
lcrypto "github.com/libp2p/go-libp2p-core/crypto"
ma "github.com/multiformats/go-multiaddr"
"github.com/stretchr/testify/assert"
@ -21,7 +16,14 @@ import (
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/storage"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/rendezvous/server"
"github.com/status-im/status-go/discovery"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/signal"

View File

@ -2,6 +2,7 @@ package peers
import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/status-im/status-go/signal"
)

View File

@ -5,6 +5,7 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/status-im/status-go/discovery"
)

View File

@ -11,6 +11,7 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/discovery"
"github.com/status-im/status-go/params"
)

View File

@ -5,17 +5,19 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/mclock"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/t/helpers"
"github.com/status-im/status-go/whisper/v6"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)
type TopicPoolSuite struct {

View File

@ -4,8 +4,9 @@ import (
"context"
"testing"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/p2p/enode"
)
func TestLocalVerifierForNodeIDTypes(t *testing.T) {

View File

@ -5,8 +5,9 @@ package applicationmetadata
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
proto "github.com/golang/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -2,6 +2,7 @@ package applicationmetadata
import (
"crypto/ecdsa"
"github.com/status-im/status-go/eth-node/crypto"
)

View File

@ -4,11 +4,12 @@ import (
"crypto/ecdsa"
"github.com/golang/protobuf/proto"
datasyncpeer "github.com/status-im/status-go/protocol/datasync/peer"
datasyncnode "github.com/vacp2p/mvds/node"
datasyncproto "github.com/vacp2p/mvds/protobuf"
datasynctransport "github.com/vacp2p/mvds/transport"
"go.uber.org/zap"
datasyncpeer "github.com/status-im/status-go/protocol/datasync/peer"
)
type DataSync struct {

View File

@ -4,11 +4,13 @@ import (
"context"
"crypto/ecdsa"
"errors"
"github.com/golang/protobuf/proto"
datasyncpeer "github.com/status-im/status-go/protocol/datasync/peer"
"github.com/vacp2p/mvds/protobuf"
"github.com/vacp2p/mvds/state"
"github.com/vacp2p/mvds/transport"
datasyncpeer "github.com/status-im/status-go/protocol/datasync/peer"
)
var errNotInitialized = errors.New("Datasync transport not initialized")

View File

@ -2,8 +2,10 @@ package datasync
import (
"crypto/ecdsa"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/vacp2p/mvds/state"
"github.com/status-im/status-go/eth-node/crypto"
)
func ToGroupID(data []byte) state.GroupID {

View File

@ -10,10 +10,11 @@ import (
"github.com/status-im/status-go/protocol/sqlite"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/protocol/encryption/multidevice"
"github.com/status-im/status-go/protocol/encryption/sharedsecret"
)

View File

@ -14,10 +14,11 @@ import (
"github.com/status-im/status-go/protocol/sqlite"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/protocol/encryption/multidevice"
"github.com/status-im/status-go/protocol/encryption/sharedsecret"
)

View File

@ -9,9 +9,10 @@ import (
"time"
dr "github.com/status-im/doubleratchet"
"go.uber.org/zap"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/crypto/ecies"
"go.uber.org/zap"
"github.com/status-im/status-go/protocol/encryption/multidevice"
)

View File

@ -5,8 +5,9 @@ import (
"os"
"testing"
"github.com/status-im/status-go/protocol/sqlite"
"github.com/stretchr/testify/suite"
"github.com/status-im/status-go/protocol/sqlite"
)
const (

View File

@ -6,6 +6,7 @@ import (
"strings"
dr "github.com/status-im/doubleratchet"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/protocol/encryption/multidevice"

View File

@ -6,9 +6,10 @@ import (
"path/filepath"
"testing"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/stretchr/testify/suite"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/protocol/encryption/multidevice"
"github.com/status-im/status-go/protocol/sqlite"
)

View File

@ -5,8 +5,9 @@ package encryption
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
proto "github.com/golang/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -9,10 +9,11 @@ import (
"github.com/status-im/status-go/protocol/sqlite"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/protocol/encryption/multidevice"
"github.com/status-im/status-go/protocol/encryption/sharedsecret"
)

View File

@ -5,8 +5,9 @@ import (
"errors"
"time"
"github.com/status-im/status-go/eth-node/crypto"
"go.uber.org/zap"
"github.com/status-im/status-go/eth-node/crypto"
)
const (

View File

@ -7,10 +7,11 @@ import (
"github.com/status-im/status-go/protocol/tt"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/protocol/sqlite"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/protocol/sqlite"
)
func TestServiceTestSuite(t *testing.T) {

View File

@ -6,9 +6,10 @@ import (
"database/sql"
"errors"
"go.uber.org/zap"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/crypto/ecies"
"go.uber.org/zap"
)
const sskLen = 16

View File

@ -4,9 +4,10 @@ import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/crypto/ecies"
"github.com/stretchr/testify/require"
)
const (

Some files were not shown because too many files have changed in this diff Show More