mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
core/state: improve
This commit is contained in:
parent
214ada862c
commit
3c165f88c3
3 changed files with 4 additions and 5 deletions
|
|
@ -130,6 +130,7 @@ type (
|
|||
}
|
||||
eip6780DeletableChange struct {
|
||||
account common.Address
|
||||
prev bool
|
||||
}
|
||||
|
||||
// Changes to other state values.
|
||||
|
|
@ -258,7 +259,7 @@ func (ch codeChange) copy() journalEntry {
|
|||
}
|
||||
|
||||
func (ch eip6780DeletableChange) revert(s *StateDB) {
|
||||
s.getStateObject(ch.account).eip6780Deletable = false
|
||||
s.getStateObject(ch.account).eip6780Deletable = ch.prev
|
||||
}
|
||||
|
||||
func (ch eip6780DeletableChange) dirtied() *common.Address {
|
||||
|
|
|
|||
|
|
@ -531,11 +531,9 @@ func (s *stateObject) setNonce(nonce uint64) {
|
|||
}
|
||||
|
||||
func (s *stateObject) SetEIP6780Deletable() {
|
||||
if s.eip6780Deletable {
|
||||
return // might be possible in fuzzing
|
||||
}
|
||||
s.db.journal.append(eip6780DeletableChange{
|
||||
account: s.address,
|
||||
prev: s.eip6780Deletable,
|
||||
})
|
||||
s.eip6780Deletable = true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -917,7 +917,7 @@ func TestSelfDestructAccountAfterDeploy(t *testing.T) {
|
|||
t.Fatalf("self-destructed should not be applied")
|
||||
}
|
||||
|
||||
// Self-destruct the account with destructible flag setting
|
||||
// Self-destruct the account with deletable flag setting
|
||||
state.SetEIP6780Deletable(addr)
|
||||
state.SetCode(addr, []byte{0x1})
|
||||
state.Selfdestruct6780(addr)
|
||||
|
|
|
|||
Loading…
Reference in a new issue