refactor: rename STTx::getFeePayer to getInitiator (#7603)

This commit is contained in:
Mayukha Vadari
2026-06-23 15:48:51 -04:00
committed by GitHub
parent 51264617f3
commit 05bb41056d
5 changed files with 8 additions and 8 deletions

View File

@@ -84,7 +84,7 @@ public:
getSeqValue() const;
AccountID
getFeePayer() const;
getInitiator() const;
boost::container::flat_set<AccountID>
getMentionedAccounts() const;

View File

@@ -213,7 +213,7 @@ STTx::getSeqValue() const
}
AccountID
STTx::getFeePayer() const
STTx::getInitiator() const
{
// If sfDelegate is present, the delegate account is the payer
// note: if a delegate is specified, its authorization to act on behalf of the account is
@@ -546,7 +546,7 @@ STTx::checkMultiSign(Rules const& rules, STObject const& sigObject) const
// For delegated transactions sfDelegate is the account whose signer list is checked,
// the delegate account itself can not be among the signers.
auto const txnAccountID =
&sigObject != this ? std::nullopt : std::optional<AccountID>(getFeePayer());
&sigObject != this ? std::nullopt : std::optional<AccountID>(getInitiator());
// We can ease the computational load inside the loop a bit by
// pre-constructing part of the data that we hash. Fill a Serializer

View File

@@ -1349,7 +1349,7 @@ Transactor::getFeePayer(ReadView const& view, STTx const& tx)
.type = FeePayerType::SponsorPreFunded};
}
auto const payerAccountKeylet = keylet::account(tx.getFeePayer());
auto const payerAccountKeylet = keylet::account(tx.getInitiator());
auto const payerType =
tx.isFieldPresent(sfDelegate) ? FeePayerType::Delegate : FeePayerType::Account;

View File

@@ -640,7 +640,7 @@ Payment::doApply()
// In a delegated payment, the fee payer is the delegated account,
// not the source account (accountID_).
bool const accountIsPayer = (ctx_.tx.getFeePayer() == accountID_);
bool const accountIsPayer = (ctx_.tx.getInitiator() == accountID_);
// preFeeBalance_ is the balance on the source account (accountID_) BEFORE the fees
// were charged. If source account is the fee payer, it must also cover the fee.

View File

@@ -1256,7 +1256,7 @@ transactionSignFor(
// The array must be sorted and validated.
// For delegated transactions, the delegate account is
// the one forbidden from appearing in its own Signers array.
auto err = sortAndValidateSigners(signers, sttx->getFeePayer());
auto err = sortAndValidateSigners(signers, sttx->getInitiator());
if (RPC::containsError(err))
return err;
}
@@ -1423,9 +1423,9 @@ transactionSubmitMultiSigned(
}
// The array must be sorted and validated.
// For delegated transactions, getFeePayer() returns sfDelegate,
// For delegated transactions, getInitiator() returns sfDelegate,
// that account is the one forbidden from appearing in its own Signers array.
auto err = sortAndValidateSigners(signers, stTx->getFeePayer());
auto err = sortAndValidateSigners(signers, stTx->getInitiator());
if (RPC::containsError(err))
return err;