mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 07:10:53 +00:00
42 lines
942 B
C++
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
|