rippled
Loading...
Searching...
No Matches
sig.h
1#ifndef XRPL_TEST_JTX_SIG_H_INCLUDED
2#define XRPL_TEST_JTX_SIG_H_INCLUDED
3
4#include <test/jtx/Env.h>
5
6#include <optional>
7
8namespace ripple {
9namespace test {
10namespace jtx {
11
15class sig
16{
17private:
18 bool manual_ = true;
23 SField const* const subField_ = nullptr;
32 static constexpr SField* const topLevel = nullptr;
33
34public:
35 explicit sig(autofill_t) : manual_(false)
36 {
37 }
38
39 explicit sig(none_t)
40 {
41 }
42
43 explicit sig(SField const* subField, Account const& account)
44 : subField_(subField), account_(account)
45 {
46 }
47
48 explicit sig(SField const& subField, Account const& account)
49 : sig(&subField, account)
50 {
51 }
52
53 explicit sig(Account const& account) : sig(topLevel, account)
54 {
55 }
56
57 void
58 operator()(Env&, JTx& jt) const;
59};
60
61} // namespace jtx
62} // namespace test
63} // namespace ripple
64
65#endif
Identifies fields.
Definition SField.h:127
Immutable cryptographic account descriptor.
Definition Account.h:20
A transaction testing environment.
Definition Env.h:102
Set the regular signature on a JTx.
Definition sig.h:16
sig(autofill_t)
Definition sig.h:35
static constexpr SField *const topLevel
Used solely as a convenience placeholder for ctors that do not specify a subfield.
Definition sig.h:32
sig(SField const *subField, Account const &account)
Definition sig.h:43
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
sig(Account const &account)
Definition sig.h:53
sig(SField const &subField, Account const &account)
Definition sig.h:48
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