Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support optional to field in txs input #607

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/statetest/statetest_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ static void from_json_tx_common(const json::json& j, state::Transaction& o)
{
o.sender = from_json<evmc::address>(j.at("sender"));

if (const auto& to = j.at("to"); !to.get<std::string>().empty())
o.to = from_json<evmc::address>(to);
if (const auto to_it = j.find("to"); to_it != j.end() && !to_it->get<std::string>().empty())
o.to = from_json<evmc::address>(*to_it);

if (const auto gas_price_it = j.find("gasPrice"); gas_price_it != j.end())
{
Expand Down