File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,14 @@ state::BlockInfo from_json<state::BlockInfo>(const json::json& j)
130130 const auto current_difficulty_it = j.find (" currentDifficulty" );
131131 const auto parent_difficulty_it = j.find (" parentDifficulty" );
132132 if (prev_randao_it != j.end ())
133- difficulty = from_json<evmc::bytes32>(*prev_randao_it);
133+ {
134+ // Special case to handle "0". Required by exec-spec-tests.
135+ // TODO: Get rid of it.
136+ if (prev_randao_it->is_string () && prev_randao_it->get <std::string>() == " 0" )
137+ difficulty = 0x0000000000000000000000000000000000000000000000000000000000000000_bytes32;
138+ else
139+ difficulty = from_json<evmc::bytes32>(*prev_randao_it);
140+ }
134141 else if (current_difficulty_it != j.end ())
135142 difficulty = from_json<evmc::bytes32>(*current_difficulty_it);
136143 else if (parent_difficulty_it != j.end ())
You can’t perform that action at this time.
0 commit comments