mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
@@ -40,6 +40,7 @@ public:
|
||||
IOU(std::string_view currencyCode, Account const& issuer)
|
||||
: currency_(to_currency(std::string(currencyCode))), issuer_(issuer.id())
|
||||
{
|
||||
XRPL_ASSERT(!isXRP(currency_), "IOU: currency code must not resolve to XRP");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -100,17 +100,24 @@ TxTest::submit(std::shared_ptr<STTx const> stx)
|
||||
void
|
||||
TxTest::createAccount(Account const& account, XRPAmount xrp, uint32_t accountFlags)
|
||||
{
|
||||
ASSERT_EQ(
|
||||
submit(transactions::PaymentBuilder{Account::master, account, xrp}, Account::master).ter,
|
||||
tesSUCCESS);
|
||||
auto const paymentTer =
|
||||
submit(transactions::PaymentBuilder{Account::master, account, xrp}, Account::master).ter;
|
||||
|
||||
if (paymentTer != tesSUCCESS)
|
||||
{
|
||||
throw std::runtime_error("TxTest::createAccount: failed to create account");
|
||||
}
|
||||
|
||||
close();
|
||||
|
||||
if (accountFlags != 0)
|
||||
{
|
||||
ASSERT_EQ(
|
||||
submit(transactions::AccountSetBuilder{account}.setSetFlag(accountFlags), account).ter,
|
||||
tesSUCCESS);
|
||||
auto const accountSetTer =
|
||||
submit(transactions::AccountSetBuilder{account}.setSetFlag(accountFlags), account).ter;
|
||||
if (accountSetTer != tesSUCCESS)
|
||||
{
|
||||
throw std::runtime_error("TxTest::createAccount: failed to set account flags");
|
||||
}
|
||||
close();
|
||||
}
|
||||
}
|
||||
@@ -174,7 +181,10 @@ TxTest::close()
|
||||
for (auto const& [key, tx] : txSet)
|
||||
{
|
||||
auto result = apply(registry_, accum, *tx, tapNONE, registry_.journal("apply"));
|
||||
ASSERT_TRUE(result.applied) << "TxTest::close: failed to apply transaction";
|
||||
if (!result.applied)
|
||||
{
|
||||
throw std::runtime_error("TxTest::close: failed to apply transaction");
|
||||
}
|
||||
}
|
||||
accum.apply(*newLedger);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ asfToLsf(std::uint32_t asf)
|
||||
case asfAllowTrustLineLocking:
|
||||
return lsfAllowTrustLineLocking;
|
||||
default:
|
||||
return 0;
|
||||
throw std::runtime_error("Unknown asf flag");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user