aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-31 21:45:03 +0800
committerobscuren <geffobscura@gmail.com>2014-10-31 21:45:03 +0800
commitaf34749a6b47ff8f9b4cb55d9ea65e1235d63b68 (patch)
treed7b244bf5076cd6a56df626d97249b3264d92a86
parentaf8f5f0b69f1c359991d12c7708804fe8dd1f944 (diff)
downloadgo-tangerine-af34749a6b47ff8f9b4cb55d9ea65e1235d63b68.tar
go-tangerine-af34749a6b47ff8f9b4cb55d9ea65e1235d63b68.tar.gz
go-tangerine-af34749a6b47ff8f9b4cb55d9ea65e1235d63b68.tar.bz2
go-tangerine-af34749a6b47ff8f9b4cb55d9ea65e1235d63b68.tar.lz
go-tangerine-af34749a6b47ff8f9b4cb55d9ea65e1235d63b68.tar.xz
go-tangerine-af34749a6b47ff8f9b4cb55d9ea65e1235d63b68.tar.zst
go-tangerine-af34749a6b47ff8f9b4cb55d9ea65e1235d63b68.zip
ethtrie => trie
-rw-r--r--chain/block.go8
-rw-r--r--chain/derive_sha.go4
-rw-r--r--state/state.go8
-rw-r--r--state/state_object.go12
-rw-r--r--trie/encoding.go (renamed from ethtrie/encoding.go)2
-rw-r--r--trie/encoding_test.go (renamed from ethtrie/encoding_test.go)2
-rw-r--r--trie/iterator.go (renamed from ethtrie/iterator.go)2
-rw-r--r--trie/slice.go (renamed from ethtrie/slice.go)2
-rw-r--r--trie/trie.go (renamed from ethtrie/trie.go)2
-rw-r--r--trie/trie_test.go (renamed from ethtrie/trie_test.go)2
10 files changed, 22 insertions, 22 deletions
diff --git a/chain/block.go b/chain/block.go
index 7e39aa2c9..16975a2fe 100644
--- a/chain/block.go
+++ b/chain/block.go
@@ -8,9 +8,9 @@ import (
"time"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
+ "github.com/ethereum/go-ethereum/trie"
)
type BlockInfo struct {
@@ -137,7 +137,7 @@ func CreateBlock(root interface{},
}
block.SetUncles([]*Block{})
- block.state = state.New(ethtrie.New(ethutil.Config.Db, root))
+ block.state = state.New(trie.New(ethutil.Config.Db, root))
return block
}
@@ -294,7 +294,7 @@ func (self *Block) setHeader(header *ethutil.Value) {
self.PrevHash = header.Get(0).Bytes()
self.UncleSha = header.Get(1).Bytes()
self.Coinbase = header.Get(2).Bytes()
- self.state = state.New(ethtrie.New(ethutil.Config.Db, header.Get(3).Val))
+ self.state = state.New(trie.New(ethutil.Config.Db, header.Get(3).Val))
self.TxSha = header.Get(4).Bytes()
self.ReceiptSha = header.Get(5).Bytes()
self.LogsBloom = header.Get(6).Bytes()
@@ -315,7 +315,7 @@ func NewUncleBlockFromValue(header *ethutil.Value) *Block {
return block
}
-func (block *Block) Trie() *ethtrie.Trie {
+func (block *Block) Trie() *trie.Trie {
return block.state.Trie
}
diff --git a/chain/derive_sha.go b/chain/derive_sha.go
index 92db90d95..4246aeb02 100644
--- a/chain/derive_sha.go
+++ b/chain/derive_sha.go
@@ -1,8 +1,8 @@
package chain
import (
- "github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/trie"
)
type DerivableList interface {
@@ -11,7 +11,7 @@ type DerivableList interface {
}
func DeriveSha(list DerivableList) []byte {
- trie := ethtrie.New(ethutil.Config.Db, "")
+ trie := trie.New(ethutil.Config.Db, "")
for i := 0; i < list.Len(); i++ {
trie.Update(string(ethutil.NewValue(i).Encode()), string(list.GetRlp(i)))
}
diff --git a/state/state.go b/state/state.go
index 298cf9680..e1b73a6ab 100644
--- a/state/state.go
+++ b/state/state.go
@@ -3,9 +3,9 @@ package state
import (
"math/big"
- "github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/trie"
)
var statelogger = logger.NewLogger("STATE")
@@ -17,7 +17,7 @@ var statelogger = logger.NewLogger("STATE")
// * Accounts
type State struct {
// The trie for this structure
- Trie *ethtrie.Trie
+ Trie *trie.Trie
stateObjects map[string]*StateObject
@@ -29,7 +29,7 @@ type State struct {
}
// Create a new state from a given trie
-func New(trie *ethtrie.Trie) *State {
+func New(trie *trie.Trie) *State {
return &State{Trie: trie, stateObjects: make(map[string]*StateObject), manifest: NewManifest(), refund: make(map[string]*big.Int)}
}
@@ -300,7 +300,7 @@ func (self *State) Update() {
// FIXME trie delete is broken
if deleted {
- valid, t2 := ethtrie.ParanoiaCheck(self.Trie)
+ valid, t2 := trie.ParanoiaCheck(self.Trie)
if !valid {
statelogger.Infof("Warn: PARANOIA: Different state root during copy %x vs %x\n", self.Trie.Root, t2.Root)
diff --git a/state/state_object.go b/state/state_object.go
index fb568e543..aa5c13678 100644
--- a/state/state_object.go
+++ b/state/state_object.go
@@ -5,8 +5,8 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/trie"
)
type Code []byte
@@ -62,7 +62,7 @@ func NewStateObject(addr []byte) *StateObject {
address := ethutil.Address(addr)
object := &StateObject{address: address, balance: new(big.Int), gasPool: new(big.Int)}
- object.State = New(ethtrie.New(ethutil.Config.Db, ""))
+ object.State = New(trie.New(ethutil.Config.Db, ""))
object.storage = make(Storage)
object.gasPool = new(big.Int)
@@ -72,7 +72,7 @@ func NewStateObject(addr []byte) *StateObject {
func NewContract(address []byte, balance *big.Int, root []byte) *StateObject {
contract := NewStateObject(address)
contract.balance = balance
- contract.State = New(ethtrie.New(ethutil.Config.Db, string(root)))
+ contract.State = New(trie.New(ethutil.Config.Db, string(root)))
return contract
}
@@ -129,7 +129,7 @@ func (self *StateObject) SetState(k []byte, value *ethutil.Value) {
}
// Iterate over each storage address and yield callback
-func (self *StateObject) EachStorage(cb ethtrie.EachCallback) {
+func (self *StateObject) EachStorage(cb trie.EachCallback) {
// First loop over the uncommit/cached values in storage
for key, value := range self.storage {
// XXX Most iterators Fns as it stands require encoded values
@@ -158,7 +158,7 @@ func (self *StateObject) Sync() {
self.SetAddr([]byte(key), value)
}
- valid, t2 := ethtrie.ParanoiaCheck(self.State.Trie)
+ valid, t2 := trie.ParanoiaCheck(self.State.Trie)
if !valid {
statelogger.Infof("Warn: PARANOIA: Different state storage root during copy %x vs %x\n", self.State.Trie.Root, t2.Root)
@@ -321,7 +321,7 @@ func (c *StateObject) RlpDecode(data []byte) {
c.Nonce = decoder.Get(0).Uint()
c.balance = decoder.Get(1).BigInt()
- c.State = New(ethtrie.New(ethutil.Config.Db, decoder.Get(2).Interface()))
+ c.State = New(trie.New(ethutil.Config.Db, decoder.Get(2).Interface()))
c.storage = make(map[string]*ethutil.Value)
c.gasPool = new(big.Int)
diff --git a/ethtrie/encoding.go b/trie/encoding.go
index bcf2c5669..4906bc90b 100644
--- a/ethtrie/encoding.go
+++ b/trie/encoding.go
@@ -1,4 +1,4 @@
-package ethtrie
+package trie
import (
"bytes"
diff --git a/ethtrie/encoding_test.go b/trie/encoding_test.go
index 0cceef792..c9bc113c9 100644
--- a/ethtrie/encoding_test.go
+++ b/trie/encoding_test.go
@@ -1,4 +1,4 @@
-package ethtrie
+package trie
import (
"bytes"
diff --git a/ethtrie/iterator.go b/trie/iterator.go
index 43f497416..53d099a0c 100644
--- a/ethtrie/iterator.go
+++ b/trie/iterator.go
@@ -1,4 +1,4 @@
-package ethtrie
+package trie
import (
"bytes"
diff --git a/ethtrie/slice.go b/trie/slice.go
index f0edc9532..f53b6c749 100644
--- a/ethtrie/slice.go
+++ b/trie/slice.go
@@ -1,4 +1,4 @@
-package ethtrie
+package trie
import (
"bytes"
diff --git a/ethtrie/trie.go b/trie/trie.go
index 4a6613b9d..b442abfe3 100644
--- a/ethtrie/trie.go
+++ b/trie/trie.go
@@ -1,4 +1,4 @@
-package ethtrie
+package trie
import (
"bytes"
diff --git a/ethtrie/trie_test.go b/trie/trie_test.go
index a70916483..5f3975915 100644
--- a/ethtrie/trie_test.go
+++ b/trie/trie_test.go
@@ -1,4 +1,4 @@
-package ethtrie
+package trie
import (
"bytes"