115 Account const alice2(
"alice2");
116 Account const alice3(
"alice3");
117 Account const alice4(
"alice4");
118 Account const alice5(
"alice5");
119 Account const alice6(
"alice6");
120 Account const alice7(
"alice7");
121 Account const alice8(
"alice8");
122 Account const alice9(
"alice9");
123 Account const alice10(
"alice10");
124 Account const alice11(
"alice11");
125 Account const alice12(
"alice12");
126 auto const setFee(
drops(env.
current()->fees().increment));
133 {.issuer = alice2, .credType =
"credential1"},
134 {.issuer = alice3, .credType =
"credential2"},
135 {.issuer = alice4, .credType =
"credential3"},
136 {.issuer = alice5, .credType =
"credential4"},
137 {.issuer = alice6, .credType =
"credential5"},
138 {.issuer = alice7, .credType =
"credential6"},
139 {.issuer = alice8, .credType =
"credential7"},
140 {.issuer = alice9, .credType =
"credential8"},
141 {.issuer = alice10, .credType =
"credential9"},
142 {.issuer = alice11, .credType =
"credential10"},
143 {.issuer = alice12, .credType =
"credential11"},
149 Account const nobody(
"nobody");
151 {.issuer = alice2, .credType =
"credential1"},
152 {.issuer = alice3, .credType =
"credential2"},
153 {.issuer = alice4, .credType =
"credential3"},
154 {.issuer = nobody, .credType =
"credential4"},
155 {.issuer = alice5, .credType =
"credential5"},
156 {.issuer = alice6, .credType =
"credential6"},
157 {.issuer = alice7, .credType =
"credential7"},
165 {.issuer = alice2, .credType =
"credential1"},
166 {.issuer = alice3, .credType =
"credential2"},
167 {.issuer = alice4, .credType =
"credential3"},
168 {.issuer = alice5, .credType =
"credential4"},
170 auto txJsonMutable =
pdomain::setTx(account, credentials4, domain);
171 auto const credentialOrig = txJsonMutable[
"AcceptedCredentials"][2u];
174 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(jss::Issuer);
175 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
178 txJsonMutable[
"AcceptedCredentials"][2u] = credentialOrig;
179 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential][
"CredentialType"] =
"";
184 "Cred0123456789012345678901234567890123456789012345678901234567890";
186 txJsonMutable[
"AcceptedCredentials"][2u] = credentialOrig;
187 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential][
"CredentialType"] =
189 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
192 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(
"CredentialType");
193 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
196 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(jss::Issuer);
197 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
203 {.issuer = alice7, .credType =
"credential6"},
204 {.issuer = alice2, .credType =
"credential1"},
205 {.issuer = alice3, .credType =
"credential2"},
206 {.issuer = alice2, .credType =
"credential1"},
207 {.issuer = alice5, .credType =
"credential4"},
211 for (
auto const& c : credentialsDup)
212 human2Acc.
emplace(c.issuer.human(), c.issuer);
215 BEAST_EXPECT(sorted.size() == 4);
234 BEAST_EXPECT(fromObject == sortedCreds);
241 {.issuer = alice2, .credType =
"credential3"},
242 {.issuer = alice3, .credType =
"credential2"},
243 {.issuer = alice2, .credType =
"credential9"},
244 {.issuer = alice5, .credType =
"credential4"},
245 {.issuer = alice2, .credType =
"credential6"},
248 for (
auto const& c : credentialsSame)
249 human2Acc.
emplace(c.issuer.human(), c.issuer);
267 BEAST_EXPECT(fromObject == sortedCreds);
276 Env env(*
this, features);
279 int const accNum = 12;
280 Account const alice[accNum] = {
295 for (
auto const& c : alice)
296 human2Acc.
emplace(c.human(), c);
298 for (
auto const& account : alice)
307 BEAST_EXPECT(tx[jss::TransactionType] ==
"PermissionedDomainSet");
308 BEAST_EXPECT(tx[
"Account"] == alice[0].human());
310 auto const domain = objects.begin()->first;
311 BEAST_EXPECT(domain.isNonZero());
312 auto object = objects.begin()->second;
313 BEAST_EXPECT(
object[
"LedgerEntryType"] ==
"PermissionedDomain");
314 BEAST_EXPECT(
object[
"Owner"] == alice[0].human());
315 BEAST_EXPECT(
object[
"Sequence"] == tx[
"Sequence"]);
322 "Cred0123456789012345678901234567890123456789012345678901234567"
326 {.issuer = alice[1], .credType =
std::string(kLongCredentialType)},
335 BEAST_EXPECT(tx[jss::TransactionType] ==
"PermissionedDomainSet");
336 BEAST_EXPECT(tx[
"Account"] == alice[0].human());
338 bool findSeq =
false;
341 findSeq =
object[
"Sequence"] == tx[
"Sequence"];
344 BEAST_EXPECT(domain.isNonZero());
345 BEAST_EXPECT(
object[
"LedgerEntryType"] ==
"PermissionedDomain");
346 BEAST_EXPECT(
object[
"Owner"] == alice[0].human());
352 BEAST_EXPECT(findSeq);
358 {.issuer = alice[2], .credType =
"credential1"},
359 {.issuer = alice[3], .credType =
"credential2"},
360 {.issuer = alice[4], .credType =
"credential3"},
361 {.issuer = alice[5], .credType =
"credential4"},
362 {.issuer = alice[6], .credType =
"credential5"},
363 {.issuer = alice[7], .credType =
"credential6"},
364 {.issuer = alice[8], .credType =
"credential7"},
365 {.issuer = alice[9], .credType =
"credential8"},
366 {.issuer = alice[10], .credType =
"credential9"},
367 {.issuer = alice[0], .credType =
"credential10"},
377 auto const object = objects[domain2];
414 auto const acctDelFee(
drops(env.
current()->fees().increment));
419 while (kDeleteDelta + ownerSeq > env.
current()->seq())
430 while (kDeleteDelta + ownerSeq > env.
current()->seq())