rippled
Loading...
Searching...
No Matches
SignerUtils.h
1#ifndef XRPL_TEST_JTX_SIGNERUTILS_H_INCLUDED
2#define XRPL_TEST_JTX_SIGNERUTILS_H_INCLUDED
3
4#include <test/jtx/Account.h>
5
6#include <vector>
7
8namespace ripple {
9namespace test {
10namespace jtx {
11
12struct Reg
13{
16
17 Reg(Account const& masterSig) : acct(masterSig), sig(masterSig)
18 {
19 }
20
21 Reg(Account const& acct_, Account const& regularSig)
22 : acct(acct_), sig(regularSig)
23 {
24 }
25
26 Reg(char const* masterSig) : acct(masterSig), sig(masterSig)
27 {
28 }
29
30 Reg(char const* acct_, char const* regularSig)
31 : acct(acct_), sig(regularSig)
32 {
33 }
34
35 bool
36 operator<(Reg const& rhs) const
37 {
38 return acct < rhs.acct;
39 }
40};
41
42// Utility function to sort signers
43inline void
45{
47 signers.begin(), signers.end(), [](Reg const& lhs, Reg const& rhs) {
48 return lhs.acct < rhs.acct;
49 });
50}
51
52} // namespace jtx
53} // namespace test
54} // namespace ripple
55
56#endif
const_iterator begin() const
const_iterator end() const
Immutable cryptographic account descriptor.
Definition Account.h:20
Set the regular signature on a JTx.
Definition sig.h:16
Json::Value signers(Account const &account, std::uint32_t quorum, std::vector< signer > const &v)
Definition multisign.cpp:15
void sortSigners(std::vector< Reg > &signers)
Definition SignerUtils.h:44
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
T sort(T... args)
bool operator<(Reg const &rhs) const
Definition SignerUtils.h:36
Reg(Account const &masterSig)
Definition SignerUtils.h:17
Reg(Account const &acct_, Account const &regularSig)
Definition SignerUtils.h:21
Reg(char const *masterSig)
Definition SignerUtils.h:26
Reg(char const *acct_, char const *regularSig)
Definition SignerUtils.h:30