Add Remit test to AMM Account

This commit is contained in:
tequ
2025-07-19 19:18:03 +09:00
parent 117bdb1c42
commit 43a4a3a3e2
3 changed files with 14 additions and 7 deletions

View File

@@ -3302,6 +3302,13 @@ private:
ter(tecNO_PERMISSION));
});
// Can't pay into AMM with Remit.
testAMM([&](AMM& ammAlice, Env& env) {
env(remit::remit(carol, ammAlice.ammAccount()),
remit::amts({XRP(1)}),
ter(tecNO_PERMISSION));
});
// Pay amounts close to one side of the pool
testAMM(
[&](AMM& ammAlice, Env& env) {

View File

@@ -27,15 +27,15 @@ namespace remit {
Json::Value
remit(
jtx::Account const& account,
jtx::Account const& dest,
AccountID const& account,
AccountID const& dest,
std::optional<std::uint32_t> const& dstTag)
{
using namespace jtx;
Json::Value jv;
jv[jss::TransactionType] = jss::Remit;
jv[jss::Account] = account.human();
jv[jss::Destination] = dest.human();
jv[jss::Account] = to_string(account);
jv[jss::Destination] = to_string(dest);
if (dstTag)
jv[sfDestinationTag.jsonName] = *dstTag;
return jv;

View File

@@ -32,8 +32,8 @@ namespace remit {
Json::Value
remit(
jtx::Account const& account,
jtx::Account const& dest,
AccountID const& account,
AccountID const& dest,
std::optional<std::uint32_t> const& dstTag = std::nullopt);
/** Sets the optional Amount on a JTx. */
@@ -125,4 +125,4 @@ public:
} // namespace test
} // namespace ripple
#endif // RIPPLE_TEST_JTX_REMIT_H_INCLUDED
#endif // RIPPLE_TEST_JTX_REMIT_H_INCLUDED