Files
rippled/src/test/jtx/impl/sig.cpp
2026-04-17 16:43:49 +00:00

42 lines
942 B
C++

#include <test/jtx/sig.h>
#include <test/jtx/Env.h>
#include <test/jtx/JTx.h>
#include <test/jtx/utility.h>
namespace xrpl {
namespace test {
namespace jtx {
void
sig::operator()(Env&, JTx& jt) const
{
if (!manual_)
return;
if (subField_ == nullptr)
jt.fill_sig = false;
if (account_)
{
// VFALCO Inefficient pre-C++14
auto const account = *account_;
auto callback = [subField = subField_, account](Env&, JTx& jtx) {
// Where to put the signature. Supports sfCounterPartySignature.
auto& sigObject = subField ? jtx[*subField] : jtx.jv;
jtx::sign(jtx.jv, account, sigObject);
};
if (subField_ == nullptr)
{
jt.mainSigners.emplace_back(callback);
}
else
{
jt.postSigners.emplace_back(callback);
}
}
}
} // namespace jtx
} // namespace test
} // namespace xrpl