core/sate: Commit return StateUpdate

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2025-05-28 12:04:45 +08:00
parent 239318c841
commit 6cf163442c

View file

@ -1348,12 +1348,12 @@ func (s *StateDB) commitAndFlush(block uint64, deleteEmptyObjects bool, noStorag
// Since self-destruction was deprecated with the Cancun fork and there are
// no empty accounts left that could be deleted by EIP-158, storage wiping
// should not occur.
func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool, noStorageWiping bool) (common.Hash, error) {
func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool, noStorageWiping bool) (*StateUpdate, error) {
ret, err := s.commitAndFlush(block, deleteEmptyObjects, noStorageWiping)
if err != nil {
return common.Hash{}, err
return nil, err
}
return ret.Root, nil
return ret, nil
}
// Prepare handles the preparatory steps for executing a state transition with.