xrpld
Loading...
Searching...
No Matches
SignerUtils.h
1#pragma once
2
3#include <test/jtx/Account.h>
4
5#include <algorithm>
6#include <utility>
7#include <vector>
8
9namespace xrpl::test::jtx {
10
11struct Reg
12{
15
16 Reg(Account const& masterSig) : acct(masterSig), sig(masterSig)
17 {
18 }
19
20 Reg(Account acct, Account regularSig) : acct(std::move(acct)), sig(std::move(regularSig))
21 {
22 }
23
24 Reg(char const* masterSig) : acct(masterSig), sig(masterSig)
25 {
26 }
27
28 Reg(char const* acct, char const* regularSig) : acct(acct), sig(regularSig)
29 {
30 }
31
32 bool
33 operator<(Reg const& rhs) const
34 {
35 return acct < rhs.acct;
36 }
37};
38
39// Utility function to sort signers
40inline void
42{
43 std::ranges::sort(signers, [](Reg const& lhs, Reg const& rhs) { return lhs.acct < rhs.acct; });
44}
45
46} // namespace xrpl::test::jtx
Immutable cryptographic account descriptor.
Definition jtx/Account.h:17
STL namespace.
json::Value signers(Account const &account, std::uint32_t quorum, std::vector< Signer > const &v)
Definition multisign.cpp:31
void sortSigners(std::vector< Reg > &signers)
Definition SignerUtils.h:41
T sort(T... args)
bool operator<(Reg const &rhs) const
Definition SignerUtils.h:33
Reg(char const *masterSig)
Definition SignerUtils.h:24
Reg(Account acct, Account regularSig)
Definition SignerUtils.h:20
Reg(char const *acct, char const *regularSig)
Definition SignerUtils.h:28
Reg(Account const &masterSig)
Definition SignerUtils.h:16