Skip to content

Commit

Permalink
rm OnNewAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
s1na committed Feb 8, 2024
1 parent 2cc0954 commit 57cd0c3
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
7 changes: 0 additions & 7 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ type StateLogger interface {
OnCodeChange(addr common.Address, prevCodeHash common.Hash, prevCode []byte, codeHash common.Hash, code []byte)
OnStorageChange(addr common.Address, slot common.Hash, prev, new common.Hash)
OnLog(log *types.Log)
// OnNewAccount is called when a new account is created.
// Reset indicates an account existed at that address
// which will be replaced.
OnNewAccount(addr common.Address, reset bool)
}

// StateDB structs within the ethereum protocol are used to store anything
Expand Down Expand Up @@ -663,9 +659,6 @@ func (s *StateDB) getOrNewStateObject(addr common.Address) *stateObject {
func (s *StateDB) createObject(addr common.Address) (newobj, prev *stateObject) {
prev = s.getDeletedStateObject(addr) // Note, prev might have been deleted, we need that!
newobj = newObject(s, addr, nil)
if s.logger != nil {
s.logger.OnNewAccount(addr, prev != nil)
}
if prev == nil {
s.journal.append(createObjectChange{account: &addr})
} else {
Expand Down
2 changes: 0 additions & 2 deletions eth/tracers/directory/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ func (*NoopTracer) OnStorageChange(a common.Address, k, prev, new common.Hash) {

func (*NoopTracer) OnLog(log *types.Log) {}

func (*NoopTracer) OnNewAccount(a common.Address, reset bool) {}

// GetResult returns an empty json object.
func (t *NoopTracer) GetResult() (json.RawMessage, error) {
return json.RawMessage(`{}`), nil
Expand Down
3 changes: 0 additions & 3 deletions eth/tracers/live/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,5 @@ func (t *noop) OnLog(l *types.Log) {

}

func (t *noop) OnNewAccount(a common.Address, reset bool) {
}

func (t *noop) OnGasChange(old, new uint64, reason vm.GasChangeReason) {
}
6 changes: 0 additions & 6 deletions eth/tracers/native/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,6 @@ func (t *muxTracer) OnLog(log *types.Log) {
}
}

func (t *muxTracer) OnNewAccount(a common.Address, reset bool) {
for _, t := range t.tracers {
t.OnNewAccount(a, reset)
}
}

// GetResult returns an empty json object.
func (t *muxTracer) GetResult() (json.RawMessage, error) {
resObject := make(map[string]json.RawMessage)
Expand Down

0 comments on commit 57cd0c3

Please sign in to comment.