Skip to content

Commit

Permalink
move schema package to types
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitprincess committed Oct 12, 2023
1 parent 7bf35ef commit 5c9a9f1
Show file tree
Hide file tree
Showing 19 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion chain/chaindb.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/aergoio/aergo/v2/consensus"
"github.com/aergoio/aergo/v2/internal/common"
"github.com/aergoio/aergo/v2/internal/enc"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
"github.com/golang/protobuf/proto"
)

Expand Down
2 changes: 1 addition & 1 deletion chain/chaindbForRaft.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/aergoio/aergo-lib/db"
"github.com/aergoio/aergo/v2/consensus"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
"github.com/aergoio/etcd/raft/raftpb"
"github.com/golang/protobuf/proto"
)
Expand Down
2 changes: 1 addition & 1 deletion chain/chainservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"github.com/aergoio/aergo/v2/contract/system"
"github.com/aergoio/aergo/v2/fee"
"github.com/aergoio/aergo/v2/internal/enc"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/message"
"github.com/aergoio/aergo/v2/pkg/component"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
lru "github.com/hashicorp/golang-lru"
)

Expand Down
2 changes: 1 addition & 1 deletion chain/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"runtime/debug"

"github.com/aergoio/aergo/v2/internal/enc"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion consensus/impl/dpos/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/aergoio/aergo-lib/db"
"github.com/aergoio/aergo/v2/consensus"
"github.com/aergoio/aergo/v2/internal/common"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/p2p/p2pkey"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
"github.com/davecgh/go-spew/spew"
)

Expand Down
2 changes: 1 addition & 1 deletion contract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"strconv"

"github.com/aergoio/aergo/v2/fee"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
"github.com/minio/sha256-simd"
)

Expand Down
2 changes: 1 addition & 1 deletion contract/enterprise/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package enterprise
import (
"bytes"

"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
)

func GetAdmin(r AccountStateReader) (*types.EnterpriseConfig, error) {
Expand Down
2 changes: 1 addition & 1 deletion contract/enterprise/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"strings"

"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion contract/name/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"strings"

"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
)

type NameMap struct {
Expand Down
2 changes: 1 addition & 1 deletion contract/system/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package system
import (
"math/big"

"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
)

type parameters map[string]*big.Int
Expand Down
2 changes: 1 addition & 1 deletion contract/system/staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"errors"
"math/big"

"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
)

var consensusType string
Expand Down
2 changes: 1 addition & 1 deletion contract/system/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"strings"

"github.com/aergoio/aergo/v2/internal/enc"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
"github.com/mr-tron/base58"
)

Expand Down
2 changes: 1 addition & 1 deletion contract/system/voteresult.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"sort"

"github.com/aergoio/aergo/v2/internal/enc"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
"github.com/mr-tron/base58"
)

Expand Down
2 changes: 1 addition & 1 deletion contract/system/vprt.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"github.com/aergoio/aergo-lib/log"
"github.com/aergoio/aergo/v2/internal/enc"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
rb "github.com/emirpasic/gods/trees/redblacktree"
jsoniter "github.com/json-iterator/go"
"github.com/sanity-io/litter"
Expand Down
2 changes: 1 addition & 1 deletion contract/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ import (
luacUtil "github.com/aergoio/aergo/v2/cmd/aergoluac/util"
"github.com/aergoio/aergo/v2/fee"
"github.com/aergoio/aergo/v2/internal/enc"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
jsoniter "github.com/json-iterator/go"
)

Expand Down
2 changes: 1 addition & 1 deletion contract/vm_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ import (
"github.com/aergoio/aergo/v2/contract/system"
"github.com/aergoio/aergo/v2/internal/common"
"github.com/aergoio/aergo/v2/internal/enc"
"github.com/aergoio/aergo/v2/internal/schema"
"github.com/aergoio/aergo/v2/state"
"github.com/aergoio/aergo/v2/types"
"github.com/aergoio/aergo/v2/types/schema"
"github.com/btcsuite/btcd/btcec"
"github.com/minio/sha256-simd"
)
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 4 additions & 6 deletions internal/schema/schema.go → types/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package schema

// chain
const (
// TODO : migrate
// BlockHeaderPrefix = "h" // headerPrefix + num (uint64 big endian) + hash -> header
// BlockNumByHashPrefix = "n" // blockNumberPrefix + hash -> num (uint64 big endian)
// BlockBodyPrefix = "b" // blockBodyPrefix + num (uint64 big endian) + hash -> block body
Expand Down Expand Up @@ -56,9 +55,8 @@ const (

// state
const (
// codePrefix = "c" // CodePrefix + code hash -> account code
TriePrefix = "s"

// TrieAccountPrefix = "A"
// TrieStoragePrefix = "O"
// codePrefix = "c" // CodePrefix + code hash -> account code
// TriePrefix = "s"
// TrieAccountPrefix = "A"
// TrieStoragePrefix = "O"
)

0 comments on commit 5c9a9f1

Please sign in to comment.