We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
storage
1 parent f835186 commit 213793dCopy full SHA for 213793d
test/statetest/statetest_loader.cpp
@@ -184,10 +184,14 @@ state::State from_json<state::State>(const json::json& j)
184
.balance = from_json<intx::uint256>(j_acc.at("balance")),
185
.code = from_json<bytes>(j_acc.at("code"))});
186
187
- for (const auto& [j_key, j_value] : j_acc.at("storage").items())
+ if (const auto storage_it = j_acc.find("storage"); storage_it != j_acc.end())
188
{
189
- const auto value = from_json<bytes32>(j_value);
190
- acc.storage.insert({from_json<bytes32>(j_key), {.current = value, .original = value}});
+ for (const auto& [j_key, j_value] : storage_it->items())
+ {
191
+ const auto value = from_json<bytes32>(j_value);
192
+ acc.storage.insert(
193
+ {from_json<bytes32>(j_key), {.current = value, .original = value}});
194
+ }
195
}
196
197
return o;
0 commit comments