mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user