Skip to content

Commit

Permalink
Tidy with gci
Browse files Browse the repository at this point in the history
  • Loading branch information
blukat29 committed Jul 3, 2024
1 parent bc50d2e commit 128297e
Show file tree
Hide file tree
Showing 41 changed files with 42 additions and 94 deletions.
5 changes: 2 additions & 3 deletions api/api_ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ import (
"strings"
"time"

"github.com/kaiachain/kaia/rlp"
"github.com/kaiachain/kaia/storage/statedb"

"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/state"
"github.com/kaiachain/kaia/blockchain/types"
Expand All @@ -43,6 +40,8 @@ import (
"github.com/kaiachain/kaia/networks/rpc"
"github.com/kaiachain/kaia/node/cn/filters"
"github.com/kaiachain/kaia/params"
"github.com/kaiachain/kaia/rlp"
"github.com/kaiachain/kaia/storage/statedb"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ import (
"sync/atomic"
"time"

"github.com/kaiachain/kaia/snapshot"

"github.com/go-redis/redis/v7"
lru "github.com/hashicorp/golang-lru"
"github.com/kaiachain/kaia/blockchain/state"
Expand All @@ -54,6 +52,7 @@ import (
kaiametrics "github.com/kaiachain/kaia/metrics"
"github.com/kaiachain/kaia/params"
"github.com/kaiachain/kaia/rlp"
"github.com/kaiachain/kaia/snapshot"
"github.com/kaiachain/kaia/storage/database"
"github.com/kaiachain/kaia/storage/statedb"
"github.com/rcrowley/go-metrics"
Expand Down
1 change: 0 additions & 1 deletion blockchain/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"github.com/kaiachain/kaia/storage"
"github.com/kaiachain/kaia/storage/database"
"github.com/kaiachain/kaia/storage/statedb"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
3 changes: 1 addition & 2 deletions blockchain/spam_throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ import (
"sync"
"time"

"github.com/rcrowley/go-metrics"

"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
"github.com/rcrowley/go-metrics"
)

// TODO-Kaia: move these variables into TxPool when BlockChain struct contains a TxPool interface
Expand Down
3 changes: 1 addition & 2 deletions blockchain/state_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ import (
"time"

"github.com/VictoriaMetrics/fastcache"
"github.com/kaiachain/kaia/blockchain/types"

"github.com/alecthomas/units"
lru "github.com/hashicorp/golang-lru"
"github.com/kaiachain/kaia/blockchain/state"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/mclock"
"github.com/kaiachain/kaia/log"
Expand Down
3 changes: 1 addition & 2 deletions blockchain/types/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ import (
"reflect"
"testing"

"github.com/stretchr/testify/assert"

"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/hexutil"
"github.com/kaiachain/kaia/rlp"
"github.com/stretchr/testify/assert"
)

type testBlockEncodingTC struct {
Expand Down
3 changes: 1 addition & 2 deletions blockchain/types/transaction_signing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ import (
"testing"

"github.com/kaiachain/kaia/blockchain/types/accountkey"
"github.com/stretchr/testify/assert"

"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/crypto"
"github.com/kaiachain/kaia/rlp"
"github.com/stretchr/testify/assert"
)

func TestLondonSigningWithoutChainID(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions blockchain/types/tx_internal_data_serializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ import (
"math/big"
"testing"

"github.com/stretchr/testify/assert"

"github.com/kaiachain/kaia/blockchain/types/accountkey"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/hexutil"
"github.com/kaiachain/kaia/params"
"github.com/kaiachain/kaia/rlp"
"github.com/stretchr/testify/assert"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions blockchain/types/tx_internal_rlp_encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ import (
"strings"
"testing"

"github.com/kaiachain/kaia/crypto/sha3"

"github.com/kaiachain/kaia/blockchain/types/accountkey"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/crypto"
"github.com/kaiachain/kaia/crypto/sha3"
"github.com/kaiachain/kaia/params"
"github.com/kaiachain/kaia/rlp"
"github.com/stretchr/testify/assert"
Expand Down
3 changes: 1 addition & 2 deletions blockchain/vm/internaltx_trace_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/kaiachain/kaia/common"
"github.com/stretchr/testify/assert"
)

func jsonMustCompact(data []byte) []byte {
Expand Down
7 changes: 3 additions & 4 deletions cmd/homi/genesis/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ import (
"math/big"
"strings"

"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/system"
"github.com/kaiachain/kaia/cmd/homi/extra"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/hexutil"
"github.com/kaiachain/kaia/consensus/clique"
testcontract "github.com/kaiachain/kaia/contracts/contracts/testing/reward"
"github.com/kaiachain/kaia/log"
"github.com/kaiachain/kaia/params"

"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/hexutil"
)

type Option func(*blockchain.Genesis)
Expand Down
1 change: 0 additions & 1 deletion cmd/utils/flaggroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"testing"

"github.com/stretchr/testify/assert"

"github.com/urfave/cli/v2"
)

Expand Down
7 changes: 0 additions & 7 deletions consensus/gxhash/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@ import (
"encoding/json"
"math/big"

// Enable below packages when enabling TestCalcDiffulty
// "os"
// "path/filepath"
// "testing"

"github.com/kaiachain/kaia/common/math"
// "github.com/kaiachain/kaia/blockchain/types"
// "github.com/kaiachain/kaia/params"
)

type diffTest struct {
Expand Down
5 changes: 2 additions & 3 deletions consensus/gxhash/gxhash.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ import (
"time"
"unsafe"

mmap "github.com/edsrzf/mmap-go"
"github.com/hashicorp/golang-lru/simplelru"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/consensus"
"github.com/kaiachain/kaia/log"
"github.com/kaiachain/kaia/networks/rpc"
"github.com/rcrowley/go-metrics"

mmap "github.com/edsrzf/mmap-go"
"github.com/kaiachain/kaia/common"
)

var ErrInvalidDumpMagic = errors.New("invalid dump magic")
Expand Down
3 changes: 1 addition & 2 deletions consensus/istanbul/backend/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"

lru "github.com/hashicorp/golang-lru"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/consensus/istanbul"
"github.com/kaiachain/kaia/networks/p2p"
"github.com/kaiachain/kaia/rlp"
"github.com/stretchr/testify/assert"
)

func TestBackend_HandleMsg(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions consensus/istanbul/backend/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ import (
"encoding/json"
"math/big"

"github.com/kaiachain/kaia/consensus"

"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/consensus"
"github.com/kaiachain/kaia/consensus/istanbul"
"github.com/kaiachain/kaia/consensus/istanbul/validator"
"github.com/kaiachain/kaia/governance"
Expand Down
3 changes: 1 addition & 2 deletions consensus/istanbul/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ package istanbul
import (
"strings"

"github.com/kaiachain/kaia/params"

"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/params"
)

type Validator interface {
Expand Down
1 change: 0 additions & 1 deletion console/jsre/pretty.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"strings"

"github.com/dop251/goja"

"github.com/fatih/color"
)

Expand Down
5 changes: 2 additions & 3 deletions datasync/chaindatafetcher/kafka/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
"github.com/kaiachain/kaia/datasync/chaindatafetcher/kafka/mocks"

"github.com/Shopify/sarama"
"github.com/golang/mock/gomock"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/datasync/chaindatafetcher/kafka/mocks"
"github.com/stretchr/testify/assert"
)

Expand Down
3 changes: 1 addition & 2 deletions datasync/chaindatafetcher/kafka/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/Shopify/sarama"
"github.com/kaiachain/kaia/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)

Expand Down
5 changes: 2 additions & 3 deletions datasync/chaindatafetcher/kas/contract_caller.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ import (
"strings"
"time"

"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/vm"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/accounts/abi/bind"
"github.com/kaiachain/kaia/api"
"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/vm"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/hexutil"
"github.com/kaiachain/kaia/contracts/contracts/libs/kip13"
Expand Down
3 changes: 1 addition & 2 deletions datasync/chaindatafetcher/kas/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/jinzhu/gorm"
"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/types"
Expand All @@ -40,6 +38,7 @@ import (
"github.com/kaiachain/kaia/params"
"github.com/kaiachain/kaia/rlp"
"github.com/kaiachain/kaia/storage/database"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)

Expand Down
4 changes: 1 addition & 3 deletions datasync/chaindatafetcher/kas/repository_traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ package kas
import (
"testing"

"github.com/kaiachain/kaia/common"

"github.com/kaiachain/kaia/blockchain/types"

"github.com/kaiachain/kaia/blockchain/vm"
"github.com/kaiachain/kaia/common"
"github.com/stretchr/testify/assert"
)

Expand Down
3 changes: 1 addition & 2 deletions governance/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import (
"reflect"
"testing"

gotest_assert "gotest.tools/assert"

"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
Expand All @@ -36,6 +34,7 @@ import (
"github.com/kaiachain/kaia/rlp"
"github.com/kaiachain/kaia/storage/database"
"github.com/stretchr/testify/assert"
gotest_assert "gotest.tools/assert"
)

type voteValue struct {
Expand Down
1 change: 0 additions & 1 deletion metrics/prometheus/prometheusmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"time"

kaiametrics "github.com/kaiachain/kaia/metrics"

"github.com/prometheus/client_golang/prometheus"
"github.com/rcrowley/go-metrics"
)
Expand Down
1 change: 0 additions & 1 deletion networks/p2p/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"net"

metricutils "github.com/kaiachain/kaia/metrics/utils"

"github.com/rcrowley/go-metrics"
)

Expand Down
3 changes: 1 addition & 2 deletions node/cn/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (
"os/user"
"time"

"github.com/kaiachain/kaia/storage/statedb"

"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/vm"
"github.com/kaiachain/kaia/common"
Expand All @@ -40,6 +38,7 @@ import (
"github.com/kaiachain/kaia/node/cn/gasprice"
"github.com/kaiachain/kaia/params"
"github.com/kaiachain/kaia/storage/database"
"github.com/kaiachain/kaia/storage/statedb"
)

var logger = log.NewModuleLogger(log.NodeCN)
Expand Down
3 changes: 1 addition & 2 deletions node/cn/filters/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ import (
"sync"
"time"

"github.com/kaiachain/kaia/params"

kaia "github.com/kaiachain/kaia"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/common/hexutil"
"github.com/kaiachain/kaia/event"
"github.com/kaiachain/kaia/networks/rpc"
"github.com/kaiachain/kaia/params"
"github.com/kaiachain/kaia/storage/database"
)

Expand Down
3 changes: 1 addition & 2 deletions node/cn/filters/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ import (
"math/big"
"strconv"

"github.com/kaiachain/kaia/params"

"github.com/kaiachain/kaia/blockchain"
"github.com/kaiachain/kaia/blockchain/bloombits"
"github.com/kaiachain/kaia/blockchain/types"
"github.com/kaiachain/kaia/common"
"github.com/kaiachain/kaia/event"
"github.com/kaiachain/kaia/networks/rpc"
"github.com/kaiachain/kaia/params"
"github.com/kaiachain/kaia/storage/database"
)

Expand Down
Loading

0 comments on commit 128297e

Please sign in to comment.