xrpld
Loading...
Searching...
No Matches
sig.h
1#pragma once
2
3#include <test/jtx/Env.h>
4
5#include <optional>
6
7namespace xrpl::test::jtx {
8
12class Sig
13{
14private:
15 bool manual_ = true;
20 SField const* const subField_ = nullptr;
29 static constexpr SField const* kTopLevel = nullptr;
30
31public:
32 explicit Sig(AutofillT) : manual_(false)
33 {
34 }
35
36 explicit Sig(NoneT)
37 {
38 }
39
40 explicit Sig(SField const* subField, Account const& account)
41 : subField_(subField), account_(account)
42 {
43 }
44
45 explicit Sig(SField const& subField, Account const& account) : Sig(&subField, account)
46 {
47 }
48
49 explicit Sig(Account const& account) : Sig(kTopLevel, account)
50 {
51 }
52
53 void
54 operator()(Env&, JTx& jt) const;
55};
56
57} // namespace xrpl::test::jtx
Identifies fields.
Definition SField.h:130
Immutable cryptographic account descriptor.
Definition jtx/Account.h:17
A transaction testing environment.
Definition Env.h:143
std::optional< Account > account_
Account that will generate the signature.
Definition sig.h:26
Sig(SField const *subField, Account const &account)
Definition sig.h:40
static constexpr SField const * kTopLevel
Used solely as a convenience placeholder for ctors that do not specify a subfield.
Definition sig.h:29
Sig(AutofillT)
Definition sig.h:32
SField const *const subField_
Alternative transaction object field in which to place the signature.
Definition sig.h:20
Sig(Account const &account)
Definition sig.h:49
Sig(SField const &subField, Account const &account)
Definition sig.h:45
void operator()(Env &, JTx &jt) const
Definition sig.cpp:10
Execution context for applying a JSON transaction.
Definition JTx.h:23