aboutsummaryrefslogtreecommitdiffstats
path: root/core/state
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-09-10 21:24:36 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-09-11 03:10:58 +0800
commitb81a6e6ab8954689fa183fd19639cf0344c0de19 (patch)
treec8333ce3fede145206ce8998858986c8b25f52f0 /core/state
parent90f1fe0ed2399f90f01c09e61e244121ef7d148a (diff)
downloaddexon-b81a6e6ab8954689fa183fd19639cf0344c0de19.tar.gz
dexon-b81a6e6ab8954689fa183fd19639cf0344c0de19.tar.zst
dexon-b81a6e6ab8954689fa183fd19639cf0344c0de19.zip
core, core/vm, core/state: remove unused functions
Diffstat (limited to 'core/state')
-rw-r--r--core/state/state_object.go43
-rw-r--r--core/state/statedb.go21
2 files changed, 0 insertions, 64 deletions
diff --git a/core/state/state_object.go b/core/state/state_object.go
index 0af0fbd5a..69c64ae40 100644
--- a/core/state/state_object.go
+++ b/core/state/state_object.go
@@ -87,10 +87,6 @@ type StateObject struct {
dirty bool
}
-func (self *StateObject) Reset() {
- self.storage = make(Storage)
-}
-
func NewStateObject(address common.Address, db common.Database) *StateObject {
object := &StateObject{db: db, address: address, balance: new(big.Int), gasPool: new(big.Int), dirty: true}
object.trie = trie.NewSecure((common.Hash{}).Bytes(), db)
@@ -184,14 +180,6 @@ func (self *StateObject) Update() {
}
}
-func (c *StateObject) GetInstr(pc *big.Int) *common.Value {
- if int64(len(c.code)-1) < pc.Int64() {
- return common.NewValue(0)
- }
-
- return common.NewValueFromBytes([]byte{c.code[pc.Int64()]})
-}
-
func (c *StateObject) AddBalance(amount *big.Int) {
c.SetBalance(new(big.Int).Add(c.balance, amount))
@@ -268,10 +256,6 @@ func (self *StateObject) Copy() *StateObject {
return stateObject
}
-func (self *StateObject) Set(stateObject *StateObject) {
- *self = *stateObject
-}
-
//
// Attribute accessors
//
@@ -280,20 +264,11 @@ func (self *StateObject) Balance() *big.Int {
return self.balance
}
-func (c *StateObject) N() *big.Int {
- return big.NewInt(int64(c.nonce))
-}
-
// Returns the address of the contract/account
func (c *StateObject) Address() common.Address {
return c.address
}
-// Returns the initialization Code
-func (c *StateObject) Init() Code {
- return c.initCode
-}
-
func (self *StateObject) Trie() *trie.SecureTrie {
return self.trie
}
@@ -311,11 +286,6 @@ func (self *StateObject) SetCode(code []byte) {
self.dirty = true
}
-func (self *StateObject) SetInitCode(code []byte) {
- self.initCode = code
- self.dirty = true
-}
-
func (self *StateObject) SetNonce(nonce uint64) {
self.nonce = nonce
self.dirty = true
@@ -354,19 +324,6 @@ func (c *StateObject) CodeHash() common.Bytes {
return crypto.Sha3(c.code)
}
-func (c *StateObject) RlpDecode(data []byte) {
- decoder := common.NewValueFromBytes(data)
- c.nonce = decoder.Get(0).Uint()
- c.balance = decoder.Get(1).BigInt()
- c.trie = trie.NewSecure(decoder.Get(2).Bytes(), c.db)
- c.storage = make(map[string]common.Hash)
- c.gasPool = new(big.Int)
-
- c.codeHash = decoder.Get(3).Bytes()
-
- c.code, _ = c.db.Get(c.codeHash)
-}
-
// Storage change object. Used by the manifest for notifying changes to
// the sub channels.
type StorageState struct {
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 577f7162e..b754f0887 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -18,7 +18,6 @@
package state
import (
- "bytes"
"math/big"
"github.com/ethereum/go-ethereum/common"
@@ -276,10 +275,6 @@ func (self *StateDB) CreateAccount(addr common.Address) *StateObject {
// Setting, copying of the state methods
//
-func (s *StateDB) Cmp(other *StateDB) bool {
- return bytes.Equal(s.trie.Root(), other.trie.Root())
-}
-
func (self *StateDB) Copy() *StateDB {
state := New(common.Hash{}, self.db)
state.trie = self.trie
@@ -311,22 +306,6 @@ func (s *StateDB) Root() common.Hash {
return common.BytesToHash(s.trie.Root())
}
-func (s *StateDB) Trie() *trie.SecureTrie {
- return s.trie
-}
-
-// Resets the trie and all siblings
-func (s *StateDB) Reset() {
- s.trie.Reset()
-
- // Reset all nested states
- for _, stateObject := range s.stateObjects {
- stateObject.Reset()
- }
-
- s.Empty()
-}
-
// Syncs the trie and all siblings
func (s *StateDB) Sync() {
// Sync all nested states