From 057bbdac10a243bfad45404fd1b225b0f7b74934 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 26 Jun 2023 16:56:28 +0200 Subject: [PATCH] add comments --- core/state/statedb.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index a7f1310b98..dd80ff5975 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -53,6 +53,10 @@ func (n *proofList) Delete(key []byte) error { panic("not supported") } +// StateLogger is used to collect state update traces from EVM transaction +// execution. +// Note that reference types are actual VM data structures; make copies +// if you need to retain them beyond the current call. type StateLogger interface { OnBalanceChange(addr common.Address, prev, new *big.Int) OnNonceChange(addr common.Address, prev, new uint64) @@ -171,7 +175,7 @@ func New(root common.Hash, db Database, snaps *snapshot.Tree) (*StateDB, error) return sdb, nil } -// TODO: move to New +// SetLogger sets the logger for account update hooks. func (s *StateDB) SetLogger(l StateLogger) { s.logger = l }