Skip to content

Commit 1f22f19

Browse files
authored
Problem: IsStorageEmpty is not implemented (cosmos#490)
* Problem: IsStorageEmpty is not implemented Closes: cosmos#486 * update deps
1 parent 3991c2c commit 1f22f19

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ replace (
273273
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
274274
// use Cosmos geth fork
275275
// branch: release/1.16
276-
github.com/ethereum/go-ethereum => github.com/cosmos/go-ethereum v0.0.0-20250806193535-2fc7571efa91
276+
github.com/ethereum/go-ethereum => github.com/cosmos/go-ethereum v1.16.2-cosmos-1
277277
// Security Advisory https://github.com/advisories/GHSA-h395-qcrw-5vmq
278278
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1
279279
// replace broken goleveldb

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,8 @@ github.com/cosmos/cosmos-sdk v0.53.4 h1:kPF6vY68+/xi1/VebSZGpoxQqA52qkhUzqkrgeBn
854854
github.com/cosmos/cosmos-sdk v0.53.4/go.mod h1:7U3+WHZtI44dEOnU46+lDzBb2tFh1QlMvi8Z5JugopI=
855855
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
856856
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
857-
github.com/cosmos/go-ethereum v0.0.0-20250806193535-2fc7571efa91 h1:kgu2NkKzSeJJlVsKeS+KbdzfUeaFqrqmmhwixd/PNH4=
858-
github.com/cosmos/go-ethereum v0.0.0-20250806193535-2fc7571efa91/go.mod h1:X5CIOyo8SuK1Q5GnaEizQVLHT/DfsiGWuNeVdQcEMNA=
857+
github.com/cosmos/go-ethereum v1.16.2-cosmos-1 h1:QIaIS6HIdPSBdTvpFhxswhMLUJgcr4irbd2o9ZKldAI=
858+
github.com/cosmos/go-ethereum v1.16.2-cosmos-1/go.mod h1:X5CIOyo8SuK1Q5GnaEizQVLHT/DfsiGWuNeVdQcEMNA=
859859
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
860860
github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI=
861861
github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=

x/vm/statedb/statedb.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ func (s *StateDB) GetStorageRoot(addr common.Address) common.Hash {
104104
return sr.Hash()
105105
}
106106

107+
func (s *StateDB) IsStorageEmpty(addr common.Address) bool {
108+
empty := true
109+
s.keeper.ForEachStorage(s.ctx, addr, func(key, value common.Hash) bool {
110+
empty = false
111+
return false
112+
})
113+
return empty
114+
}
115+
107116
/*
108117
PointCache, Witness, and AccessEvents are all utilized for verkle trees.
109118
For now, we just return nil and verkle trees are not supported.

0 commit comments

Comments
 (0)