Skip to content

Commit

Permalink
t8n: Output txs.rlp file with all transactions
Browse files Browse the repository at this point in the history
Returning for exec-spec-tests.
  • Loading branch information
rodiazet authored and chfast committed Mar 29, 2023
1 parent ae3aa2b commit 3c96e41
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/t8n/t8n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ int main(int argc, const char* argv[])
fs::path output_dir;
fs::path output_result_file;
fs::path output_alloc_file;
fs::path output_body_file;
std::optional<intx::uint256> block_reward;
uint64_t chain_id = 0;

Expand Down Expand Up @@ -59,6 +60,8 @@ int main(int argc, const char* argv[])
block_reward = intx::from_string<intx::uint256>(argv[i]);
else if (arg == "--state.chainid" && ++i < argc)
chain_id = intx::from_string<uint64_t>(argv[i]);
else if (arg == "--output.body" && ++i < argc)
output_body_file = argv[i];
}

state::BlockInfo block;
Expand Down Expand Up @@ -182,6 +185,9 @@ int main(int argc, const char* argv[])
}

std::ofstream{output_dir / output_alloc_file} << std::setw(2) << j_alloc;

if (!output_body_file.empty())
std::ofstream{output_dir / output_body_file} << hex0x(rlp::encode(transactions));
}
catch (const std::exception& e)
{
Expand Down

0 comments on commit 3c96e41

Please sign in to comment.