22#include <xrpl/protocol/Feature.h>
32 using namespace test::jtx;
35 Env env{*
this, supported_amendments() - fixMasterKeyAsRegularKey};
36 Account
const alice(
"alice");
37 Account
const bob(
"bob");
38 env.fund(XRP(10000), alice, bob);
40 env(regkey(alice, bob));
41 auto const ar = env.le(alice);
43 ar->isFieldPresent(sfRegularKey) &&
44 (ar->getAccountID(sfRegularKey) == bob.id()));
46 env(
noop(alice), sig(bob));
47 env(
noop(alice), sig(alice));
51 env(
noop(alice), sig(bob));
60 env(
noop(alice), sig(bob));
61 env(
noop(alice), sig(alice));
64 env(regkey(alice, disabled));
66 env(
noop(alice), sig(alice));
72 using namespace test::jtx;
75 Env env{*
this, supported_amendments() | fixMasterKeyAsRegularKey};
76 Account
const alice(
"alice");
77 Account
const bob(
"bob");
78 env.fund(XRP(10000), alice, bob);
80 env(regkey(alice, bob));
81 env(
noop(alice), sig(bob));
82 env(
noop(alice), sig(alice));
86 env(
noop(alice), sig(bob));
95 env(
noop(alice), sig(bob));
96 env(
noop(alice), sig(alice));
99 env(regkey(alice, disabled));
101 env(
noop(alice), sig(alice));
107 using namespace test::jtx;
111 "Set regular key to master key (before fixMasterKeyAsRegularKey)");
112 Env env{*
this, supported_amendments() - fixMasterKeyAsRegularKey};
113 Account
const alice(
"alice");
114 env.fund(XRP(10000), alice);
117 env(regkey(alice, alice), sig(alice));
125 env.enableFeature(fixMasterKeyAsRegularKey);
127 env(
noop(alice), sig(alice));
131 env(regkey(alice, disabled));
138 using namespace test::jtx;
141 "Set regular key to master key (after fixMasterKeyAsRegularKey)");
142 Env env{*
this, supported_amendments() | fixMasterKeyAsRegularKey};
143 Account
const alice(
"alice");
144 env.fund(XRP(10000), alice);
153 using namespace test::jtx;
157 Account
const alice(
"alice");
158 Account
const bob(
"bob");
159 env.fund(XRP(10000), alice, bob);
161 auto ar = env.le(alice);
163 ar->isFieldPresent(sfFlags) &&
166 env(regkey(alice, bob), sig(alice), fee(0));
170 ar->isFieldPresent(sfFlags) &&
177 env.trust(bob[
"USD"](1), alice);
178 env(pay(bob, alice, bob[
"USD"](1)));
181 ar->isFieldPresent(sfFlags) &&
188 using namespace test::jtx;
192 Account
const alice(
"alice");
193 Account
const bob(
"bob");
194 env.fund(XRP(10000), alice, bob);
196 auto jv = regkey(alice, bob);
204 using namespace test::jtx;
209 env.fund(XRP(1000), alice);
213 env(ticket::create(alice, 4));
219 env(regkey(alice, alie), ticket::use(--ticketSeq));
225 ticket::use(--ticketSeq));
234 BEAST_EXPECT(env.seq(alice) == aliceSeq + 1);
239 ticket::use(--ticketSeq));
243 env(regkey(alice, disabled), sig(alie), ticket::use(--ticketSeq));
testcase_t testcase
Memberspace for declaring test cases.
void testDisableMasterKeyAfterFix()
void testDisableRegularKeyAfterFix()
void run() override
Runs the suite.
void testDisableMasterKey()
void testDisabledRegularKey()
void testTicketRegularKey()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::uint32_t asfDisableMaster
constexpr std::uint32_t tfUniversalMask