aboutsummaryrefslogtreecommitdiffstats
path: root/ethstate
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-04 16:38:18 +0800
committerobscuren <geffobscura@gmail.com>2014-08-04 16:38:18 +0800
commit3debeb7236d2c8474fa9049cc91dc26bf1040b3f (patch)
tree928b5ff8486ea485a3efae8cc69adaf54af9c87e /ethstate
parent2e7cf835222274a311302c33498cf83bb2593b7a (diff)
downloadgo-tangerine-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar
go-tangerine-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.gz
go-tangerine-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.bz2
go-tangerine-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.lz
go-tangerine-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.xz
go-tangerine-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.tar.zst
go-tangerine-3debeb7236d2c8474fa9049cc91dc26bf1040b3f.zip
ethtrie.NewTrie => ethtrie.New
Diffstat (limited to 'ethstate')
-rw-r--r--ethstate/state_object.go24
1 files changed, 3 insertions, 21 deletions
diff --git a/ethstate/state_object.go b/ethstate/state_object.go
index 5932fbee6..309e3e762 100644
--- a/ethstate/state_object.go
+++ b/ethstate/state_object.go
@@ -57,30 +57,12 @@ func (self *StateObject) Reset() {
self.State.Reset()
}
-/*
-// Converts an transaction in to a state object
-func MakeContract(tx *Transaction, state *State) *StateObject {
- // Create contract if there's no recipient
- if tx.IsContract() {
- addr := tx.CreationAddress()
-
- contract := state.NewStateObject(addr)
- contract.initCode = tx.Data
- contract.state = NewState(ethtrie.NewTrie(ethutil.Config.Db, ""))
-
- return contract
- }
-
- return nil
-}
-*/
-
func NewStateObject(addr []byte) *StateObject {
// This to ensure that it has 20 bytes (and not 0 bytes), thus left or right pad doesn't matter.
address := ethutil.Address(addr)
object := &StateObject{address: address, Balance: new(big.Int), gasPool: new(big.Int)}
- object.State = NewState(ethtrie.NewTrie(ethutil.Config.Db, ""))
+ object.State = NewState(ethtrie.New(ethutil.Config.Db, ""))
object.storage = make(Storage)
object.gasPool = new(big.Int)
@@ -90,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 = NewState(ethtrie.NewTrie(ethutil.Config.Db, string(root)))
+ contract.State = NewState(ethtrie.New(ethutil.Config.Db, string(root)))
return contract
}
@@ -318,7 +300,7 @@ func (c *StateObject) RlpDecode(data []byte) {
c.Nonce = decoder.Get(0).Uint()
c.Balance = decoder.Get(1).BigInt()
- c.State = NewState(ethtrie.NewTrie(ethutil.Config.Db, decoder.Get(2).Interface()))
+ c.State = NewState(ethtrie.New(ethutil.Config.Db, decoder.Get(2).Interface()))
c.storage = make(map[string]*ethutil.Value)
c.gasPool = new(big.Int)