Skip to content

Commit faf3422

Browse files
author
Aurélien Richez
committed
[ETCM-868] fix storeGenesisAccountStorageData and stSpecialTest
1 parent 56e61b6 commit faf3422

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/scala/io/iohk/ethereum/jsonrpc/TestService.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ class TestService(
181181
Account.EmptyStorageRootHash,
182182
blockchain.getStateStorage.getBackingStorage(0)
183183
)
184-
val storagesToPersist = accounts.map(pair => pair._2.storage).collect { case Some(map) if map.nonEmpty => map }
184+
val storagesToPersist = accounts
185+
.flatMap(pair => pair._2.storage)
186+
.map(accountStorage => accountStorage.filterNot { case (_, v) => v.isZero })
187+
.filter(_.nonEmpty)
185188
for { storage <- storagesToPersist } {
186189
storage.foldLeft(emptyStorage) { case (storage, (key, value)) => storage.put(key, value) }
187190
}

0 commit comments

Comments
 (0)