mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
Dev commit. Squash in rebase.
This commit is contained in:
parent
c4ddebe78a
commit
f6cb834362
3 changed files with 0 additions and 53 deletions
|
|
@ -264,20 +264,11 @@ func (self *StateObject) Balance() *big.Int {
|
||||||
return self.balance
|
return self.balance
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *StateObject) N() *big.Int {
|
|
||||||
return big.NewInt(int64(c.nonce))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the address of the contract/account
|
// Returns the address of the contract/account
|
||||||
func (c *StateObject) Address() common.Address {
|
func (c *StateObject) Address() common.Address {
|
||||||
return c.address
|
return c.address
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the initialization Code
|
|
||||||
func (c *StateObject) Init() Code {
|
|
||||||
return c.initCode
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *StateObject) Trie() *trie.SecureTrie {
|
func (self *StateObject) Trie() *trie.SecureTrie {
|
||||||
return self.trie
|
return self.trie
|
||||||
}
|
}
|
||||||
|
|
@ -295,11 +286,6 @@ func (self *StateObject) SetCode(code []byte) {
|
||||||
self.dirty = true
|
self.dirty = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *StateObject) SetInitCode(code []byte) {
|
|
||||||
self.initCode = code
|
|
||||||
self.dirty = true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self *StateObject) SetNonce(nonce uint64) {
|
func (self *StateObject) SetNonce(nonce uint64) {
|
||||||
self.nonce = nonce
|
self.nonce = nonce
|
||||||
self.dirty = true
|
self.dirty = true
|
||||||
|
|
@ -338,19 +324,6 @@ func (c *StateObject) CodeHash() common.Bytes {
|
||||||
return crypto.Sha3(c.code)
|
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
|
// Storage change object. Used by the manifest for notifying changes to
|
||||||
// the sub channels.
|
// the sub channels.
|
||||||
type StorageState struct {
|
type StorageState struct {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
package state
|
package state
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
@ -276,10 +275,6 @@ func (self *StateDB) CreateAccount(addr common.Address) *StateObject {
|
||||||
// Setting, copying of the state methods
|
// 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 {
|
func (self *StateDB) Copy() *StateDB {
|
||||||
state := New(common.Hash{}, self.db)
|
state := New(common.Hash{}, self.db)
|
||||||
state.trie = self.trie
|
state.trie = self.trie
|
||||||
|
|
@ -311,10 +306,6 @@ func (s *StateDB) Root() common.Hash {
|
||||||
return common.BytesToHash(s.trie.Root())
|
return common.BytesToHash(s.trie.Root())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StateDB) Trie() *trie.SecureTrie {
|
|
||||||
return s.trie
|
|
||||||
}
|
|
||||||
|
|
||||||
// Syncs the trie and all siblings
|
// Syncs the trie and all siblings
|
||||||
func (s *StateDB) Sync() {
|
func (s *StateDB) Sync() {
|
||||||
// Sync all nested states
|
// Sync all nested states
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,3 @@ import (
|
||||||
|
|
||||||
var OutOfGasError = errors.New("Out of gas")
|
var OutOfGasError = errors.New("Out of gas")
|
||||||
var DepthError = fmt.Errorf("Max call depth exceeded (%d)", params.CallCreateDepth)
|
var DepthError = fmt.Errorf("Max call depth exceeded (%d)", params.CallCreateDepth)
|
||||||
|
|
||||||
type StackError struct {
|
|
||||||
req, has int
|
|
||||||
}
|
|
||||||
|
|
||||||
func StackErr(req, has int) StackError {
|
|
||||||
return StackError{req, has}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (self StackError) Error() string {
|
|
||||||
return fmt.Sprintf("stack error! require %v, have %v", self.req, self.has)
|
|
||||||
}
|
|
||||||
|
|
||||||
func IsStackErr(err error) bool {
|
|
||||||
_, ok := err.(StackError)
|
|
||||||
return ok
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue