113 Account const alice2(
"alice2");
114 Account const alice3(
"alice3");
115 Account const alice4(
"alice4");
116 Account const alice5(
"alice5");
117 Account const alice6(
"alice6");
118 Account const alice7(
"alice7");
119 Account const alice8(
"alice8");
120 Account const alice9(
"alice9");
121 Account const alice10(
"alice10");
122 Account const alice11(
"alice11");
123 Account const alice12(
"alice12");
124 auto const setFee(
drops(env.
current()->fees().increment));
131 {.issuer = alice2, .credType =
"credential1"},
132 {.issuer = alice3, .credType =
"credential2"},
133 {.issuer = alice4, .credType =
"credential3"},
134 {.issuer = alice5, .credType =
"credential4"},
135 {.issuer = alice6, .credType =
"credential5"},
136 {.issuer = alice7, .credType =
"credential6"},
137 {.issuer = alice8, .credType =
"credential7"},
138 {.issuer = alice9, .credType =
"credential8"},
139 {.issuer = alice10, .credType =
"credential9"},
140 {.issuer = alice11, .credType =
"credential10"},
141 {.issuer = alice12, .credType =
"credential11"}};
146 Account const nobody(
"nobody");
148 {.issuer = alice2, .credType =
"credential1"},
149 {.issuer = alice3, .credType =
"credential2"},
150 {.issuer = alice4, .credType =
"credential3"},
151 {.issuer = nobody, .credType =
"credential4"},
152 {.issuer = alice5, .credType =
"credential5"},
153 {.issuer = alice6, .credType =
"credential6"},
154 {.issuer = alice7, .credType =
"credential7"}};
161 {.issuer = alice2, .credType =
"credential1"},
162 {.issuer = alice3, .credType =
"credential2"},
163 {.issuer = alice4, .credType =
"credential3"},
164 {.issuer = alice5, .credType =
"credential4"},
166 auto txJsonMutable =
pdomain::setTx(account, credentials4, domain);
167 auto const credentialOrig = txJsonMutable[
"AcceptedCredentials"][2u];
170 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(jss::Issuer);
171 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
174 txJsonMutable[
"AcceptedCredentials"][2u] = credentialOrig;
175 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential][
"CredentialType"] =
"";
180 "Cred0123456789012345678901234567890123456789012345678901234567890";
182 txJsonMutable[
"AcceptedCredentials"][2u] = credentialOrig;
183 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential][
"CredentialType"] =
185 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
188 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(
"CredentialType");
189 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
192 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(jss::Issuer);
193 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
199 {.issuer = alice7, .credType =
"credential6"},
200 {.issuer = alice2, .credType =
"credential1"},
201 {.issuer = alice3, .credType =
"credential2"},
202 {.issuer = alice2, .credType =
"credential1"},
203 {.issuer = alice5, .credType =
"credential4"},
207 for (
auto const& c : credentialsDup)
208 human2Acc.
emplace(c.issuer.human(), c.issuer);
211 BEAST_EXPECT(sorted.size() == 4);
230 BEAST_EXPECT(fromObject == sortedCreds);
237 {.issuer = alice2, .credType =
"credential3"},
238 {.issuer = alice3, .credType =
"credential2"},
239 {.issuer = alice2, .credType =
"credential9"},
240 {.issuer = alice5, .credType =
"credential4"},
241 {.issuer = alice2, .credType =
"credential6"},
244 for (
auto const& c : credentialsSame)
245 human2Acc.
emplace(c.issuer.human(), c.issuer);
263 BEAST_EXPECT(fromObject == sortedCreds);
272 Env env(*
this, features);
275 int const accNum = 12;
276 Account const alice[accNum] = {
290 for (
auto const& c : alice)
291 human2Acc.
emplace(c.human(), c);
293 for (
auto const& account : alice)
302 BEAST_EXPECT(tx[jss::TransactionType] ==
"PermissionedDomainSet");
303 BEAST_EXPECT(tx[
"Account"] == alice[0].human());
305 auto domain = objects.begin()->first;
306 BEAST_EXPECT(domain.isNonZero());
307 auto object = objects.begin()->second;
308 BEAST_EXPECT(
object[
"LedgerEntryType"] ==
"PermissionedDomain");
309 BEAST_EXPECT(
object[
"Owner"] == alice[0].human());
310 BEAST_EXPECT(
object[
"Sequence"] == tx[
"Sequence"]);
317 "Cred0123456789012345678901234567890123456789012345678901234567"
321 {.issuer = alice[1], .credType =
std::string(kLongCredentialType)}};
329 BEAST_EXPECT(tx[jss::TransactionType] ==
"PermissionedDomainSet");
330 BEAST_EXPECT(tx[
"Account"] == alice[0].human());
332 bool findSeq =
false;
335 findSeq =
object[
"Sequence"] == tx[
"Sequence"];
338 BEAST_EXPECT(domain.isNonZero());
339 BEAST_EXPECT(
object[
"LedgerEntryType"] ==
"PermissionedDomain");
340 BEAST_EXPECT(
object[
"Owner"] == alice[0].human());
346 BEAST_EXPECT(findSeq);
352 {.issuer = alice[2], .credType =
"credential1"},
353 {.issuer = alice[3], .credType =
"credential2"},
354 {.issuer = alice[4], .credType =
"credential3"},
355 {.issuer = alice[5], .credType =
"credential4"},
356 {.issuer = alice[6], .credType =
"credential5"},
357 {.issuer = alice[7], .credType =
"credential6"},
358 {.issuer = alice[8], .credType =
"credential7"},
359 {.issuer = alice[9], .credType =
"credential8"},
360 {.issuer = alice[10], .credType =
"credential9"},
361 {.issuer = alice[0], .credType =
"credential10"},
371 auto object = objects[domain2];
408 auto const acctDelFee(
drops(env.
current()->fees().increment));
413 while (kDeleteDelta + ownerSeq > env.
current()->seq())
424 while (kDeleteDelta + ownerSeq > env.
current()->seq())