rippled
Loading...
Searching...
No Matches
sig.h
1#pragma once
2
3#include <test/jtx/Env.h>
4
5#include <optional>
6
7namespace xrpl {
8namespace test {
9namespace jtx {
10
14class sig
15{
16private:
17 bool manual_ = true;
22 SField const* const subField_ = nullptr;
31 static constexpr SField* const topLevel = nullptr;
32
33public:
34 explicit sig(autofill_t) : manual_(false)
35 {
36 }
37
38 explicit sig(none_t)
39 {
40 }
41
42 explicit sig(SField const* subField, Account const& account) : subField_(subField), account_(account)
43 {
44 }
45
46 explicit sig(SField const& subField, Account const& account) : sig(&subField, account)
47 {
48 }
49
50 explicit sig(Account const& account) : sig(topLevel, account)
51 {
52 }
53
54 void
55 operator()(Env&, JTx& jt) const;
56};
57
58} // namespace jtx
59} // namespace test
60} // namespace xrpl
Identifies fields.
Definition SField.h:126
Immutable cryptographic account descriptor.
Definition Account.h:19
A transaction testing environment.
Definition Env.h:119
Set the regular signature on a JTx.
Definition sig.h:15
sig(none_t)
Definition sig.h:38
sig(autofill_t)
Definition sig.h:34
sig(SField const *subField, Account const &account)
Definition sig.h:42
sig(Account const &account)
Definition sig.h:50
sig(SField const &subField, Account const &account)
Definition sig.h:46
SField const *const subField_
Alternative transaction object field in which to place the signature.
Definition sig.h:22
void operator()(Env &, JTx &jt) const
Definition sig.cpp:9
static constexpr SField *const topLevel
Used solely as a convenience placeholder for ctors that do not specify a subfield.
Definition sig.h:31
std::optional< Account > account_
Account that will generate the signature.
Definition sig.h:28
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Execution context for applying a JSON transaction.
Definition JTx.h:25