test: Add tests to raise coverage of AMM (#4971)

---------

Co-authored-by: Howard Hinnant <howard.hinnant@gmail.com>
Co-authored-by: Mark Travis <mtravis@ripple.com>
Co-authored-by: Bronek Kozicki <brok@incorrekt.com>
Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
Co-authored-by: Chenna Keshava <ckeshavabs@gmail.com>
This commit is contained in:
John Freeman
2024-04-18 14:25:22 -05:00
committed by GitHub
parent aae438315f
commit 24a275ba25
15 changed files with 581 additions and 287 deletions

View File

@@ -472,6 +472,32 @@ Env::st(JTx const& jt)
return nullptr;
}
std::shared_ptr<STTx const>
Env::ust(JTx const& jt)
{
// The parse must succeed, since we
// generated the JSON ourselves.
std::optional<STObject> obj;
try
{
obj = jtx::parse(jt.jv);
}
catch (jtx::parse_error const&)
{
test.log << "Exception: parse_error\n" << pretty(jt.jv) << std::endl;
Rethrow();
}
try
{
return std::make_shared<STTx const>(std::move(*obj));
}
catch (std::exception const&)
{
}
return nullptr;
}
Json::Value
Env::do_rpc(
unsigned apiVersion,