forked from cerc-io/laconicd-deprecated
Implement deepCopy on state object
This commit is contained in:
parent
f2b455b055
commit
355244b5bc
@ -275,6 +275,19 @@ func (so *stateObject) getCommittedState(ctx sdk.Context, key ethcmn.Hash) ethcm
|
|||||||
// Closures. It performs a no-op.
|
// Closures. It performs a no-op.
|
||||||
func (so *stateObject) ReturnGas(gas *big.Int) {}
|
func (so *stateObject) ReturnGas(gas *big.Int) {}
|
||||||
|
|
||||||
|
func (so *stateObject) deepCopy(db *CommitStateDB) *stateObject {
|
||||||
|
newStateObj := newObject(db, so.account)
|
||||||
|
|
||||||
|
newStateObj.code = so.code
|
||||||
|
newStateObj.dirtyStorage = so.dirtyStorage.Copy()
|
||||||
|
newStateObj.originStorage = so.originStorage.Copy()
|
||||||
|
newStateObj.suicided = so.suicided
|
||||||
|
newStateObj.dirtyCode = so.dirtyCode
|
||||||
|
newStateObj.deleted = so.deleted
|
||||||
|
|
||||||
|
return newStateObj
|
||||||
|
}
|
||||||
|
|
||||||
// empty returns whether the account is considered empty.
|
// empty returns whether the account is considered empty.
|
||||||
func (so *stateObject) empty() bool {
|
func (so *stateObject) empty() bool {
|
||||||
return so.account.Sequence == 0 &&
|
return so.account.Sequence == 0 &&
|
||||||
|
Loading…
Reference in New Issue
Block a user