Skip to content

Commit

Permalink
Fix module dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
yzang2019 committed Oct 11, 2023
1 parent a212dec commit ae13138
Show file tree
Hide file tree
Showing 24 changed files with 31 additions and 484 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
- uses: golangci/golangci-lint-action@v3
with:
version: v1.49
args: --config=.golangci.yml --timeout=10m ./sc/memiavl/...
args: --config=.golangci.yml --timeout=10m sc/memiavl/...
10 changes: 6 additions & 4 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: Unit Test
on:
pull_request:
push:
paths:
- "**.go"
tags:
- v*
branches:
- main
pull_request:
permissions:
contents: read

jobs:
unit-tests:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
Expand Down
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ ldflags := $(strip $(ldflags))
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'


test-all: test-memiavl
test-all:
go test -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic

test-memiavl:
@cd sc/memiavl; go test -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic

lint-all: lint-memiavl

lint-memiavl:
golangci-lint run --config=.golangci.yml ./sc/memiavl/...
lint-all:
golangci-lint run --config=.golangci.yml
2 changes: 1 addition & 1 deletion sc/memiavl/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/sei-protocol/sei-db/memiavl
module github.com/sei-protocol/sei-db

go 1.19

Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions go.work

This file was deleted.

443 changes: 0 additions & 443 deletions go.work.sum

This file was deleted.

2 changes: 1 addition & 1 deletion sc/memiavl/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/alitto/pond"
"github.com/cosmos/iavl"
"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
"github.com/tidwall/wal"
)

Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/cosmos/iavl"
"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"path/filepath"

"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
)

type MultiTreeImporter struct {
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package memiavl

import (
"bytes"
"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
)

type Iterator struct {
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/mmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"

"github.com/ledgerwatch/erigon-lib/mmap"
"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
)

// MmapFile manage the resources of a mmap-ed file
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/multitree.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/alitto/pond"
"github.com/cosmos/iavl"
"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
"github.com/tidwall/wal"
"golang.org/x/exp/slices"
)
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/persisted_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/sha256"
"sort"

"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"path/filepath"

"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/cosmos/iavl"
"github.com/cosmos/iavl/cache"
"github.com/sei-protocol/sei-db/memiavl/utils"
"github.com/sei-protocol/sei-db/sc/memiavl/utils"
)

var emptyHash = sha256.New().Sum(nil)
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/db/types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package memiavl

import fmt "fmt"
import "fmt"

// Logger is what any CometBFT library should take.
type Logger interface {
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/store/memiavlstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/iavl"
"github.com/sei-protocol/sei-db/memiavl/db"
"github.com/sei-protocol/sei-db/sc/memiavl/db"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/store/memiavlstore/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/cosmos/cosmos-sdk/store/types"
"github.com/sei-protocol/sei-db/memiavl/db"
"github.com/sei-protocol/sei-db/sc/memiavl/db"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
)
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/store/rootmulti/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
protoio "github.com/gogo/protobuf/io"
memiavl "github.com/sei-protocol/sei-db/memiavl/db"
memiavl "github.com/sei-protocol/sei-db/sc/memiavl/db"
)

// Implements interface Snapshotter
Expand Down
2 changes: 1 addition & 1 deletion sc/memiavl/store/rootmulti/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
protoio "github.com/gogo/protobuf/io"
"github.com/sei-protocol/sei-db/memiavl/db"
"github.com/sei-protocol/sei-db/sc/memiavl/db"
)

// Implements interface Snapshotter
Expand Down
6 changes: 3 additions & 3 deletions sc/memiavl/store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/cosmos/cosmos-sdk/store/transient"
"github.com/cosmos/cosmos-sdk/store/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/sei-protocol/sei-db/memiavl/db"
"github.com/sei-protocol/sei-db/memiavl/store/cachemulti"
"github.com/sei-protocol/sei-db/memiavl/store/memiavlstore"
"github.com/sei-protocol/sei-db/sc/memiavl/db"
"github.com/sei-protocol/sei-db/sc/memiavl/store/cachemulti"
"github.com/sei-protocol/sei-db/sc/memiavl/store/memiavlstore"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
Expand Down
4 changes: 2 additions & 2 deletions sc/memiavl/store/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/cosmos/cosmos-sdk/baseapp"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/sei-protocol/sei-db/memiavl/db"
"github.com/sei-protocol/sei-db/memiavl/store/rootmulti"
"github.com/sei-protocol/sei-db/sc/memiavl/db"
"github.com/sei-protocol/sei-db/sc/memiavl/store/rootmulti"
"github.com/spf13/cast"
"github.com/tendermint/tendermint/libs/log"
)
Expand Down
5 changes: 0 additions & 5 deletions sc/memiavl/utils/bytes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package utils
import (
"strings"
"testing"
"unsafe"
)

func TestClone(t *testing.T) {
Expand All @@ -29,9 +28,5 @@ func TestClone(t *testing.T) {
if input != nil && clone == nil {
t.Errorf("Clone(%#v) return value should not be equal to nil slice.", input)
}

if cap(input) != 0 && unsafe.SliceData(input) == unsafe.SliceData(clone) {
t.Errorf("Clone(%q) return value should not reference inputs backing memory.", input)
}
}
}

0 comments on commit ae13138

Please sign in to comment.