Introduce Credentials support (XLS-70d): (#5103)

Amendment:
    - Credentials

    New Transactions:
    - CredentialCreate
    - CredentialAccept
    - CredentialDelete

    Modified Transactions:
    - DepositPreauth
    - Payment
    - EscrowFinish
    - PaymentChannelClaim
    - AccountDelete

    New Object:
    - Credential

    Modified Object:
    - DepositPreauth

    API updates:
    - ledger_entry
    - account_objects
    - ledger_data
    - deposit_authorized

    Read full spec: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0070d-credentials
This commit is contained in:
Olek
2026-02-20 02:21:22 +09:00
committed by tequ
parent 879bfb453e
commit 2867b6eac5
60 changed files with 5484 additions and 179 deletions

View File

@@ -301,14 +301,23 @@ MPTTester::pay(
Account const& src,
Account const& dest,
std::int64_t amount,
std::optional<TER> err)
std::optional<TER> err,
std::optional<std::vector<std::string>> credentials)
{
if (!id_)
Throw<std::runtime_error>("MPT has not been created");
auto const srcAmt = getBalance(src);
auto const destAmt = getBalance(dest);
auto const outstnAmt = getBalance(issuer_);
env_(jtx::pay(src, dest, mpt(amount)), ter(err.value_or(tesSUCCESS)));
if (credentials)
env_(
jtx::pay(src, dest, mpt(amount)),
ter(err.value_or(tesSUCCESS)),
credentials::ids(*credentials));
else
env_(jtx::pay(src, dest, mpt(amount)), ter(err.value_or(tesSUCCESS)));
if (env_.ter() != tesSUCCESS)
amount = 0;
if (close_)