move trie and utils into internal

pull/190/head
Minh Doan 6 years ago committed by Minh Doan
parent a6d7c050db
commit 82a725abfa
  1. 5
      beaconchain/libs/beaconchain.go
  2. 2
      client/txgen/main.go
  3. 2
      consensus/consensus.go
  4. 2
      consensus/consensus_test.go
  5. 2
      consensus/consensus_validator.go
  6. 2
      core/blockchain.go
  7. 2
      core/state/database.go
  8. 2
      internal/db/memory_db.go
  9. 0
      internal/trie/database.go
  10. 0
      internal/trie/encoding.go
  11. 0
      internal/trie/encoding_test.go
  12. 0
      internal/trie/errors.go
  13. 0
      internal/trie/hasher.go
  14. 0
      internal/trie/iterator.go
  15. 0
      internal/trie/iterator_test.go
  16. 0
      internal/trie/node.go
  17. 0
      internal/trie/node_test.go
  18. 0
      internal/trie/proof.go
  19. 0
      internal/trie/proof_test.go
  20. 0
      internal/trie/secure_trie.go
  21. 0
      internal/trie/secure_trie_test.go
  22. 0
      internal/trie/sync.go
  23. 0
      internal/trie/sync_test.go
  24. 0
      internal/trie/trie.go
  25. 0
      internal/trie/trie_test.go
  26. 0
      internal/utils/bytes.go
  27. 0
      internal/utils/bytes_test.go
  28. 0
      internal/utils/metrics.go
  29. 0
      internal/utils/singleton.go
  30. 0
      internal/utils/singleton_test.go
  31. 0
      internal/utils/utils.go
  32. 0
      internal/utils/utils_test.go
  33. 2
      newnode/newnode.go
  34. 2
      node/node_test.go
  35. 2
      proto/bcconn/bcconn_test.go

@ -1,20 +1,21 @@
package beaconchain package beaconchain
import ( import (
"github.com/harmony-one/harmony/beaconchain/rpc"
"math/rand" "math/rand"
"strconv" "strconv"
"sync" "sync"
"github.com/harmony-one/harmony/beaconchain/rpc"
"github.com/dedis/kyber" "github.com/dedis/kyber"
"github.com/harmony-one/harmony/crypto/pki" "github.com/harmony-one/harmony/crypto/pki"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/log" "github.com/harmony-one/harmony/log"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/host" "github.com/harmony-one/harmony/p2p/host"
"github.com/harmony-one/harmony/p2p/p2pimpl" "github.com/harmony-one/harmony/p2p/p2pimpl"
"github.com/harmony-one/harmony/proto/bcconn" "github.com/harmony-one/harmony/proto/bcconn"
proto_identity "github.com/harmony-one/harmony/proto/identity" proto_identity "github.com/harmony-one/harmony/proto/identity"
"github.com/harmony-one/harmony/utils"
) )
var mutex sync.Mutex var mutex sync.Mutex

@ -13,13 +13,13 @@ import (
"github.com/harmony-one/harmony/client/txgen/txgen" "github.com/harmony-one/harmony/client/txgen/txgen"
"github.com/harmony-one/harmony/consensus" "github.com/harmony-one/harmony/consensus"
"github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/log" "github.com/harmony-one/harmony/log"
"github.com/harmony-one/harmony/newnode" "github.com/harmony-one/harmony/newnode"
"github.com/harmony-one/harmony/node" "github.com/harmony-one/harmony/node"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/p2pimpl" "github.com/harmony-one/harmony/p2p/p2pimpl"
proto_node "github.com/harmony-one/harmony/proto/node" proto_node "github.com/harmony-one/harmony/proto/node"
"github.com/harmony-one/harmony/utils"
) )
var ( var (

@ -17,10 +17,10 @@ import (
"github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/crypto" "github.com/harmony-one/harmony/crypto"
"github.com/harmony-one/harmony/crypto/pki" "github.com/harmony-one/harmony/crypto/pki"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/log" "github.com/harmony-one/harmony/log"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/host" "github.com/harmony-one/harmony/p2p/host"
"github.com/harmony-one/harmony/utils"
proto_node "github.com/harmony-one/harmony/proto/node" proto_node "github.com/harmony-one/harmony/proto/node"
) )

@ -3,9 +3,9 @@ package consensus
import ( import (
"testing" "testing"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/p2pimpl" "github.com/harmony-one/harmony/p2p/p2pimpl"
"github.com/harmony-one/harmony/utils"
) )
func TestNew(test *testing.T) { func TestNew(test *testing.T) {

@ -9,8 +9,8 @@ import (
"github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/crypto" "github.com/harmony-one/harmony/crypto"
"github.com/harmony-one/harmony/internal/attack" "github.com/harmony-one/harmony/internal/attack"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/log" "github.com/harmony-one/harmony/log"
"github.com/harmony-one/harmony/utils"
) )
// ProcessMessageValidator dispatches validator's consensus message. // ProcessMessageValidator dispatches validator's consensus message.

@ -42,7 +42,7 @@ import (
"github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/core/vm" "github.com/harmony-one/harmony/core/vm"
hdb "github.com/harmony-one/harmony/internal/db" hdb "github.com/harmony-one/harmony/internal/db"
"github.com/harmony-one/harmony/trie" "github.com/harmony-one/harmony/internal/trie"
"github.com/hashicorp/golang-lru" "github.com/hashicorp/golang-lru"
) )

@ -22,7 +22,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/harmony-one/harmony/internal/db" "github.com/harmony-one/harmony/internal/db"
"github.com/harmony-one/harmony/trie" "github.com/harmony-one/harmony/internal/trie"
lru "github.com/hashicorp/golang-lru" lru "github.com/hashicorp/golang-lru"
) )

@ -4,7 +4,7 @@ import (
"errors" "errors"
"sync" "sync"
"github.com/harmony-one/harmony/utils" "github.com/harmony-one/harmony/internal/utils"
) )
// MemDatabase is the test memory database. It won't be used for any production. // MemDatabase is the test memory database. It won't be used for any production.

@ -10,12 +10,12 @@ import (
"github.com/dedis/kyber" "github.com/dedis/kyber"
"github.com/harmony-one/harmony/crypto" "github.com/harmony-one/harmony/crypto"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/log" "github.com/harmony-one/harmony/log"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/host" "github.com/harmony-one/harmony/p2p/host"
"github.com/harmony-one/harmony/proto/bcconn" "github.com/harmony-one/harmony/proto/bcconn"
proto_identity "github.com/harmony-one/harmony/proto/identity" proto_identity "github.com/harmony-one/harmony/proto/identity"
"github.com/harmony-one/harmony/utils"
) )
//NewNode is ther struct for a candidate node //NewNode is ther struct for a candidate node

@ -9,10 +9,10 @@ import (
"github.com/harmony-one/harmony/consensus" "github.com/harmony-one/harmony/consensus"
"github.com/harmony-one/harmony/crypto" "github.com/harmony-one/harmony/crypto"
"github.com/harmony-one/harmony/crypto/pki" "github.com/harmony-one/harmony/crypto/pki"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/p2pimpl" "github.com/harmony-one/harmony/p2p/p2pimpl"
proto_node "github.com/harmony-one/harmony/proto/node" proto_node "github.com/harmony-one/harmony/proto/node"
"github.com/harmony-one/harmony/utils"
) )
func TestNewNewNode(t *testing.T) { func TestNewNewNode(t *testing.T) {

@ -5,8 +5,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/utils"
) )
func TestSerializeDeserializeNodeInfo(t *testing.T) { func TestSerializeDeserializeNodeInfo(t *testing.T) {

Loading…
Cancel
Save