rippled
Loading...
Searching...
No Matches
sig.cpp
1#include <test/jtx/sig.h>
2#include <test/jtx/utility.h>
3
4namespace ripple {
5namespace test {
6namespace jtx {
7
8void
10{
11 if (!manual_)
12 return;
13 if (!subField_)
14 jt.fill_sig = false;
15 if (account_)
16 {
17 // VFALCO Inefficient pre-C++14
18 auto const account = *account_;
19 auto callback = [subField = subField_, account](Env&, JTx& jtx) {
20 // Where to put the signature. Supports sfCounterPartySignature.
21 auto& sigObject = subField ? jtx[*subField] : jtx.jv;
22
23 jtx::sign(jtx.jv, account, sigObject);
24 };
25 if (!subField_)
26 jt.mainSigners.emplace_back(callback);
27 else
28 jt.postSigners.emplace_back(callback);
29 }
30}
31
32} // namespace jtx
33} // namespace test
34} // namespace ripple
A transaction testing environment.
Definition Env.h:102
std::optional< Account > account_
Account that will generate the signature.
Definition sig.h:29
void operator()(Env &, JTx &jt) const
Definition sig.cpp:9
SField const *const subField_
Alternative transaction object field in which to place the signature.
Definition sig.h:23
void sign(Json::Value &jv, Account const &account, Json::Value &sigObject)
Sign automatically into a specific Json field of the jv object.
Definition utility.cpp:28
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Execution context for applying a JSON transaction.
Definition JTx.h:26
std::vector< std::function< void(Env &, JTx &)> > postSigners
Definition JTx.h:42
std::vector< std::function< void(Env &, JTx &)> > mainSigners
Definition JTx.h:39