Skip to content

Commit af34749

Browse files
committed
ethtrie => trie
1 parent af8f5f0 commit af34749

10 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎chain/block.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"time"
99

1010
"github.com/ethereum/go-ethereum/crypto"
11-
"github.com/ethereum/go-ethereum/ethtrie"
1211
"github.com/ethereum/go-ethereum/ethutil"
1312
"github.com/ethereum/go-ethereum/state"
13+
"github.com/ethereum/go-ethereum/trie"
1414
)
1515

1616
type BlockInfo struct {
@@ -137,7 +137,7 @@ func CreateBlock(root interface{},
137137
}
138138
block.SetUncles([]*Block{})
139139

140-
block.state = state.New(ethtrie.New(ethutil.Config.Db, root))
140+
block.state = state.New(trie.New(ethutil.Config.Db, root))
141141

142142
return block
143143
}
@@ -294,7 +294,7 @@ func (self *Block) setHeader(header *ethutil.Value) {
294294
self.PrevHash = header.Get(0).Bytes()
295295
self.UncleSha = header.Get(1).Bytes()
296296
self.Coinbase = header.Get(2).Bytes()
297-
self.state = state.New(ethtrie.New(ethutil.Config.Db, header.Get(3).Val))
297+
self.state = state.New(trie.New(ethutil.Config.Db, header.Get(3).Val))
298298
self.TxSha = header.Get(4).Bytes()
299299
self.ReceiptSha = header.Get(5).Bytes()
300300
self.LogsBloom = header.Get(6).Bytes()
@@ -315,7 +315,7 @@ func NewUncleBlockFromValue(header *ethutil.Value) *Block {
315315
return block
316316
}
317317

318-
func (block *Block) Trie() *ethtrie.Trie {
318+
func (block *Block) Trie() *trie.Trie {
319319
return block.state.Trie
320320
}
321321

‎chain/derive_sha.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package chain
22

33
import (
4-
"github.com/ethereum/go-ethereum/ethtrie"
54
"github.com/ethereum/go-ethereum/ethutil"
5+
"github.com/ethereum/go-ethereum/trie"
66
)
77

88
type DerivableList interface {
@@ -11,7 +11,7 @@ type DerivableList interface {
1111
}
1212

1313
func DeriveSha(list DerivableList) []byte {
14-
trie := ethtrie.New(ethutil.Config.Db, "")
14+
trie := trie.New(ethutil.Config.Db, "")
1515
for i := 0; i < list.Len(); i++ {
1616
trie.Update(string(ethutil.NewValue(i).Encode()), string(list.GetRlp(i)))
1717
}

‎state/state.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package state
33
import (
44
"math/big"
55

6-
"github.com/ethereum/go-ethereum/ethtrie"
76
"github.com/ethereum/go-ethereum/ethutil"
87
"github.com/ethereum/go-ethereum/logger"
8+
"github.com/ethereum/go-ethereum/trie"
99
)
1010

1111
var statelogger = logger.NewLogger("STATE")
@@ -17,7 +17,7 @@ var statelogger = logger.NewLogger("STATE")
1717
// * Accounts
1818
type State struct {
1919
// The trie for this structure
20-
Trie *ethtrie.Trie
20+
Trie *trie.Trie
2121

2222
stateObjects map[string]*StateObject
2323

@@ -29,7 +29,7 @@ type State struct {
2929
}
3030

3131
// Create a new state from a given trie
32-
func New(trie *ethtrie.Trie) *State {
32+
func New(trie *trie.Trie) *State {
3333
return &State{Trie: trie, stateObjects: make(map[string]*StateObject), manifest: NewManifest(), refund: make(map[string]*big.Int)}
3434
}
3535

@@ -300,7 +300,7 @@ func (self *State) Update() {
300300

301301
// FIXME trie delete is broken
302302
if deleted {
303-
valid, t2 := ethtrie.ParanoiaCheck(self.Trie)
303+
valid, t2 := trie.ParanoiaCheck(self.Trie)
304304
if !valid {
305305
statelogger.Infof("Warn: PARANOIA: Different state root during copy %x vs %x\n", self.Trie.Root, t2.Root)
306306

‎state/state_object.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"math/big"
66

77
"github.com/ethereum/go-ethereum/crypto"
8-
"github.com/ethereum/go-ethereum/ethtrie"
98
"github.com/ethereum/go-ethereum/ethutil"
9+
"github.com/ethereum/go-ethereum/trie"
1010
)
1111

1212
type Code []byte
@@ -62,7 +62,7 @@ func NewStateObject(addr []byte) *StateObject {
6262
address := ethutil.Address(addr)
6363

6464
object := &StateObject{address: address, balance: new(big.Int), gasPool: new(big.Int)}
65-
object.State = New(ethtrie.New(ethutil.Config.Db, ""))
65+
object.State = New(trie.New(ethutil.Config.Db, ""))
6666
object.storage = make(Storage)
6767
object.gasPool = new(big.Int)
6868

@@ -72,7 +72,7 @@ func NewStateObject(addr []byte) *StateObject {
7272
func NewContract(address []byte, balance *big.Int, root []byte) *StateObject {
7373
contract := NewStateObject(address)
7474
contract.balance = balance
75-
contract.State = New(ethtrie.New(ethutil.Config.Db, string(root)))
75+
contract.State = New(trie.New(ethutil.Config.Db, string(root)))
7676

7777
return contract
7878
}
@@ -129,7 +129,7 @@ func (self *StateObject) SetState(k []byte, value *ethutil.Value) {
129129
}
130130

131131
// Iterate over each storage address and yield callback
132-
func (self *StateObject) EachStorage(cb ethtrie.EachCallback) {
132+
func (self *StateObject) EachStorage(cb trie.EachCallback) {
133133
// First loop over the uncommit/cached values in storage
134134
for key, value := range self.storage {
135135
// XXX Most iterators Fns as it stands require encoded values
@@ -158,7 +158,7 @@ func (self *StateObject) Sync() {
158158
self.SetAddr([]byte(key), value)
159159
}
160160

161-
valid, t2 := ethtrie.ParanoiaCheck(self.State.Trie)
161+
valid, t2 := trie.ParanoiaCheck(self.State.Trie)
162162
if !valid {
163163
statelogger.Infof("Warn: PARANOIA: Different state storage root during copy %x vs %x\n", self.State.Trie.Root, t2.Root)
164164

@@ -321,7 +321,7 @@ func (c *StateObject) RlpDecode(data []byte) {
321321

322322
c.Nonce = decoder.Get(0).Uint()
323323
c.balance = decoder.Get(1).BigInt()
324-
c.State = New(ethtrie.New(ethutil.Config.Db, decoder.Get(2).Interface()))
324+
c.State = New(trie.New(ethutil.Config.Db, decoder.Get(2).Interface()))
325325
c.storage = make(map[string]*ethutil.Value)
326326
c.gasPool = new(big.Int)
327327

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethtrie
1+
package trie
22

33
import (
44
"bytes"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethtrie
1+
package trie
22

33
import (
44
"bytes"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethtrie
1+
package trie
22

33
import (
44
"bytes"

ethtrie/slice.go renamed to trie/slice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethtrie
1+
package trie
22

33
import (
44
"bytes"

ethtrie/trie.go renamed to trie/trie.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethtrie
1+
package trie
22

33
import (
44
"bytes"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethtrie
1+
package trie
22

33
import (
44
"bytes"

0 commit comments

Comments
 (0)