112 Account const alice2(
"alice2");
113 Account const alice3(
"alice3");
114 Account const alice4(
"alice4");
115 Account const alice5(
"alice5");
116 Account const alice6(
"alice6");
117 Account const alice7(
"alice7");
118 Account const alice8(
"alice8");
119 Account const alice9(
"alice9");
120 Account const alice10(
"alice10");
121 Account const alice11(
"alice11");
122 Account const alice12(
"alice12");
123 auto const setFee(
drops(env.
current()->fees().increment));
130 {.issuer = alice2, .credType =
"credential1"},
131 {.issuer = alice3, .credType =
"credential2"},
132 {.issuer = alice4, .credType =
"credential3"},
133 {.issuer = alice5, .credType =
"credential4"},
134 {.issuer = alice6, .credType =
"credential5"},
135 {.issuer = alice7, .credType =
"credential6"},
136 {.issuer = alice8, .credType =
"credential7"},
137 {.issuer = alice9, .credType =
"credential8"},
138 {.issuer = alice10, .credType =
"credential9"},
139 {.issuer = alice11, .credType =
"credential10"},
140 {.issuer = alice12, .credType =
"credential11"}};
145 Account const nobody(
"nobody");
147 {.issuer = alice2, .credType =
"credential1"},
148 {.issuer = alice3, .credType =
"credential2"},
149 {.issuer = alice4, .credType =
"credential3"},
150 {.issuer = nobody, .credType =
"credential4"},
151 {.issuer = alice5, .credType =
"credential5"},
152 {.issuer = alice6, .credType =
"credential6"},
153 {.issuer = alice7, .credType =
"credential7"}};
160 {.issuer = alice2, .credType =
"credential1"},
161 {.issuer = alice3, .credType =
"credential2"},
162 {.issuer = alice4, .credType =
"credential3"},
163 {.issuer = alice5, .credType =
"credential4"},
165 auto txJsonMutable =
pdomain::setTx(account, credentials4, domain);
166 auto const credentialOrig = txJsonMutable[
"AcceptedCredentials"][2u];
169 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(jss::Issuer);
170 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
173 txJsonMutable[
"AcceptedCredentials"][2u] = credentialOrig;
174 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential][
"CredentialType"] =
"";
179 "Cred0123456789012345678901234567890123456789012345678901234567890";
181 txJsonMutable[
"AcceptedCredentials"][2u] = credentialOrig;
182 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential][
"CredentialType"] =
184 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
187 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(
"CredentialType");
188 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
191 txJsonMutable[
"AcceptedCredentials"][2u][jss::Credential].removeMember(jss::Issuer);
192 BEAST_EXPECT(
exceptionExpected(env, txJsonMutable).starts_with(
"invalidParams"));
198 {.issuer = alice7, .credType =
"credential6"},
199 {.issuer = alice2, .credType =
"credential1"},
200 {.issuer = alice3, .credType =
"credential2"},
201 {.issuer = alice2, .credType =
"credential1"},
202 {.issuer = alice5, .credType =
"credential4"},
206 for (
auto const& c : credentialsDup)
207 human2Acc.
emplace(c.issuer.human(), c.issuer);
210 BEAST_EXPECT(sorted.size() == 4);
229 BEAST_EXPECT(fromObject == sortedCreds);
236 {.issuer = alice2, .credType =
"credential3"},
237 {.issuer = alice3, .credType =
"credential2"},
238 {.issuer = alice2, .credType =
"credential9"},
239 {.issuer = alice5, .credType =
"credential4"},
240 {.issuer = alice2, .credType =
"credential6"},
243 for (
auto const& c : credentialsSame)
244 human2Acc.
emplace(c.issuer.human(), c.issuer);
262 BEAST_EXPECT(fromObject == sortedCreds);
271 Env env(*
this, features);
274 int const accNum = 12;
275 Account const alice[accNum] = {
289 for (
auto const& c : alice)
290 human2Acc.
emplace(c.human(), c);
292 for (
int i = 0; i < accNum; ++i)
301 BEAST_EXPECT(tx[jss::TransactionType] ==
"PermissionedDomainSet");
302 BEAST_EXPECT(tx[
"Account"] == alice[0].human());
304 auto domain = objects.begin()->first;
305 BEAST_EXPECT(domain.isNonZero());
306 auto object = objects.begin()->second;
307 BEAST_EXPECT(
object[
"LedgerEntryType"] ==
"PermissionedDomain");
308 BEAST_EXPECT(
object[
"Owner"] == alice[0].human());
309 BEAST_EXPECT(
object[
"Sequence"] == tx[
"Sequence"]);
316 "Cred0123456789012345678901234567890123456789012345678901234567"
320 {.issuer = alice[1], .credType =
std::string(kLongCredentialType)}};
328 BEAST_EXPECT(tx[jss::TransactionType] ==
"PermissionedDomainSet");
329 BEAST_EXPECT(tx[
"Account"] == alice[0].human());
331 bool findSeq =
false;
334 findSeq =
object[
"Sequence"] == tx[
"Sequence"];
337 BEAST_EXPECT(domain.isNonZero());
338 BEAST_EXPECT(
object[
"LedgerEntryType"] ==
"PermissionedDomain");
339 BEAST_EXPECT(
object[
"Owner"] == alice[0].human());
345 BEAST_EXPECT(findSeq);
351 {.issuer = alice[2], .credType =
"credential1"},
352 {.issuer = alice[3], .credType =
"credential2"},
353 {.issuer = alice[4], .credType =
"credential3"},
354 {.issuer = alice[5], .credType =
"credential4"},
355 {.issuer = alice[6], .credType =
"credential5"},
356 {.issuer = alice[7], .credType =
"credential6"},
357 {.issuer = alice[8], .credType =
"credential7"},
358 {.issuer = alice[9], .credType =
"credential8"},
359 {.issuer = alice[10], .credType =
"credential9"},
360 {.issuer = alice[0], .credType =
"credential10"},
370 auto object = objects[domain2];
407 auto const acctDelFee(
drops(env.
current()->fees().increment));
412 while (kDeleteDelta + ownerSeq > env.
current()->seq())
423 while (kDeleteDelta + ownerSeq > env.
current()->seq())