diff --git a/AccountChannels_8cpp_source.html b/AccountChannels_8cpp_source.html index c91c2cb441..b180a38891 100644 --- a/AccountChannels_8cpp_source.html +++ b/AccountChannels_8cpp_source.html @@ -322,7 +322,7 @@ $(function() {
ripple::rpcACT_MALFORMED
@ rpcACT_MALFORMED
Definition: ErrorCodes.h:90
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:31
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::ltANY
@ ltANY
A special type, matching any ledger entry type.
Definition: LedgerFormats.h:78
diff --git a/AmendmentTable__test_8cpp_source.html b/AmendmentTable__test_8cpp_source.html index b2f29095e8..37a298afaa 100644 --- a/AmendmentTable__test_8cpp_source.html +++ b/AmendmentTable__test_8cpp_source.html @@ -1478,7 +1478,7 @@ $(function() {
ripple::QualityDirection::in
@ in
ripple::TxSearched::all
@ all
ripple::KeyType::secp256k1
@ secp256k1
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::VoteBehavior
VoteBehavior
Definition: Feature.h:87
ripple::VoteBehavior::DefaultNo
@ DefaultNo
ripple::VoteBehavior::DefaultYes
@ DefaultYes
diff --git a/Change_8cpp_source.html b/Change_8cpp_source.html index ec20d6718b..d237c7fefd 100644 --- a/Change_8cpp_source.html +++ b/Change_8cpp_source.html @@ -663,7 +663,7 @@ $(function() {
ripple::lsfLowReserve
@ lsfLowReserve
Definition: LedgerFormats.h:159
ripple::tefFAILURE
@ tefFAILURE
Definition: TER.h:166
ripple::tefALREADY
@ tefALREADY
Definition: TER.h:167
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::isFlagLedger
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition: Ledger.cpp:957
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
diff --git a/Handshake_8cpp_source.html b/Handshake_8cpp_source.html index ab59843aef..928e423977 100644 --- a/Handshake_8cpp_source.html +++ b/Handshake_8cpp_source.html @@ -524,7 +524,7 @@ $(function() {
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::makeFeaturesResponseHeader
std::string makeFeaturesResponseHeader(http_request_type const &headers, bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled)
Make response header X-Protocol-Ctl value with supported features.
Definition: Handshake.cpp:94
ripple::TokenType::NodePublic
@ NodePublic
-
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:238
+
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:239
ripple::DELIM_FEATURE
static constexpr char DELIM_FEATURE[]
Definition: Handshake.h:148
ripple::http_response_type
boost::beast::http::response< boost::beast::http::dynamic_body > http_response_type
Definition: Handoff.h:36
ripple::buildHandshake
void buildHandshake(boost::beast::http::fields &h, ripple::uint256 const &sharedValue, std::optional< std::uint32_t > networkID, beast::IP::Address public_ip, beast::IP::Address remote_ip, Application &app)
Insert fields headers necessary for upgrading the link to the peer protocol.
Definition: Handshake.cpp:178
@@ -536,7 +536,7 @@ $(function() {
ripple::isFeatureValue
bool isFeatureValue(boost::beast::http::fields const &headers, std::string const &feature, std::string const &value)
Check if a feature's value is equal to the specified value.
Definition: Handshake.cpp:55
ripple::makeSharedValue
std::optional< uint256 > makeSharedValue(stream_type &ssl, beast::Journal journal)
Computes a shared value based on the SSL connection state.
Definition: Handshake.cpp:146
ripple::supportedProtocolVersions
std::string const & supportedProtocolVersions()
The list of all the protocol versions we support.
Definition: ProtocolVersion.cpp:159
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::hashLastMessage
static std::optional< base_uint< 512 > > hashLastMessage(SSL const *ssl, size_t(*get)(const SSL *, void *, size_t))
Hashes the latest finished message from an SSL stream.
Definition: Handshake.cpp:128
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
diff --git a/LedgerTrie__test_8cpp_source.html b/LedgerTrie__test_8cpp_source.html index e84d566a75..1617f326c9 100644 --- a/LedgerTrie__test_8cpp_source.html +++ b/LedgerTrie__test_8cpp_source.html @@ -391,332 +391,330 @@ $(function() {
313 testSupport()
314 {
315 using namespace csf;
-
316 using Seq = Ledger::Seq;
-
317
-
318 LedgerTrie<Ledger> t;
-
319 LedgerHistoryHelper h;
-
320 BEAST_EXPECT(t.tipSupport(h["a"]) == 0);
-
321 BEAST_EXPECT(t.tipSupport(h["axy"]) == 0);
-
322
-
323 BEAST_EXPECT(t.branchSupport(h["a"]) == 0);
-
324 BEAST_EXPECT(t.branchSupport(h["axy"]) == 0);
-
325
-
326 t.insert(h["abc"]);
-
327 BEAST_EXPECT(t.tipSupport(h["a"]) == 0);
-
328 BEAST_EXPECT(t.tipSupport(h["ab"]) == 0);
-
329 BEAST_EXPECT(t.tipSupport(h["abc"]) == 1);
-
330 BEAST_EXPECT(t.tipSupport(h["abcd"]) == 0);
-
331
-
332 BEAST_EXPECT(t.branchSupport(h["a"]) == 1);
-
333 BEAST_EXPECT(t.branchSupport(h["ab"]) == 1);
-
334 BEAST_EXPECT(t.branchSupport(h["abc"]) == 1);
-
335 BEAST_EXPECT(t.branchSupport(h["abcd"]) == 0);
-
336
-
337 t.insert(h["abe"]);
-
338 BEAST_EXPECT(t.tipSupport(h["a"]) == 0);
-
339 BEAST_EXPECT(t.tipSupport(h["ab"]) == 0);
-
340 BEAST_EXPECT(t.tipSupport(h["abc"]) == 1);
-
341 BEAST_EXPECT(t.tipSupport(h["abe"]) == 1);
-
342
-
343 BEAST_EXPECT(t.branchSupport(h["a"]) == 2);
-
344 BEAST_EXPECT(t.branchSupport(h["ab"]) == 2);
-
345 BEAST_EXPECT(t.branchSupport(h["abc"]) == 1);
-
346 BEAST_EXPECT(t.branchSupport(h["abe"]) == 1);
-
347
-
348 t.remove(h["abc"]);
-
349 BEAST_EXPECT(t.tipSupport(h["a"]) == 0);
-
350 BEAST_EXPECT(t.tipSupport(h["ab"]) == 0);
-
351 BEAST_EXPECT(t.tipSupport(h["abc"]) == 0);
-
352 BEAST_EXPECT(t.tipSupport(h["abe"]) == 1);
-
353
-
354 BEAST_EXPECT(t.branchSupport(h["a"]) == 1);
-
355 BEAST_EXPECT(t.branchSupport(h["ab"]) == 1);
-
356 BEAST_EXPECT(t.branchSupport(h["abc"]) == 0);
-
357 BEAST_EXPECT(t.branchSupport(h["abe"]) == 1);
-
358 }
-
359
-
360 void
-
361 testGetPreferred()
-
362 {
-
363 using namespace csf;
-
364 using Seq = Ledger::Seq;
-
365 // Empty
-
366 {
-
367 LedgerTrie<Ledger> t;
-
368 BEAST_EXPECT(t.getPreferred(Seq{0}) == std::nullopt);
-
369 BEAST_EXPECT(t.getPreferred(Seq{2}) == std::nullopt);
-
370 }
-
371 // Genesis support is NOT empty
-
372 {
-
373 LedgerTrie<Ledger> t;
-
374 LedgerHistoryHelper h;
-
375 Ledger genesis = h[""];
-
376 t.insert(genesis);
-
377 BEAST_EXPECT(t.getPreferred(Seq{0})->id == genesis.id());
-
378 BEAST_EXPECT(t.remove(genesis));
-
379 BEAST_EXPECT(t.getPreferred(Seq{0}) == std::nullopt);
-
380 BEAST_EXPECT(!t.remove(genesis));
-
381 }
-
382 // Single node no children
-
383 {
-
384 LedgerTrie<Ledger> t;
-
385 LedgerHistoryHelper h;
-
386 t.insert(h["abc"]);
-
387 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
-
388 }
-
389 // Single node smaller child support
-
390 {
-
391 LedgerTrie<Ledger> t;
-
392 LedgerHistoryHelper h;
-
393 t.insert(h["abc"]);
-
394 t.insert(h["abcd"]);
-
395 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
-
396 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
-
397 }
-
398 // Single node larger child
-
399 {
-
400 LedgerTrie<Ledger> t;
-
401 LedgerHistoryHelper h;
-
402 t.insert(h["abc"]);
-
403 t.insert(h["abcd"], 2);
-
404 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abcd"].id());
-
405 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcd"].id());
-
406 }
-
407 // Single node smaller children support
-
408 {
-
409 LedgerTrie<Ledger> t;
-
410 LedgerHistoryHelper h;
-
411 t.insert(h["abc"]);
-
412 t.insert(h["abcd"]);
-
413 t.insert(h["abce"]);
-
414 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
-
415 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
-
416
-
417 t.insert(h["abc"]);
-
418 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
-
419 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
-
420 }
-
421 // Single node larger children
-
422 {
-
423 LedgerTrie<Ledger> t;
-
424 LedgerHistoryHelper h;
-
425 t.insert(h["abc"]);
-
426 t.insert(h["abcd"], 2);
-
427 t.insert(h["abce"]);
-
428 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
-
429 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
-
430
-
431 t.insert(h["abcd"]);
-
432 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abcd"].id());
-
433 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcd"].id());
-
434 }
-
435 // Tie-breaker by id
-
436 {
-
437 LedgerTrie<Ledger> t;
-
438 LedgerHistoryHelper h;
-
439 t.insert(h["abcd"], 2);
-
440 t.insert(h["abce"], 2);
-
441
-
442 BEAST_EXPECT(h["abce"].id() > h["abcd"].id());
-
443 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abce"].id());
-
444
-
445 t.insert(h["abcd"]);
-
446 BEAST_EXPECT(h["abce"].id() > h["abcd"].id());
-
447 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcd"].id());
-
448 }
-
449
-
450 // Tie-breaker not needed
-
451 {
-
452 LedgerTrie<Ledger> t;
-
453 LedgerHistoryHelper h;
-
454 t.insert(h["abc"]);
-
455 t.insert(h["abcd"]);
-
456 t.insert(h["abce"], 2);
-
457 // abce only has a margin of 1, but it owns the tie-breaker
-
458 BEAST_EXPECT(h["abce"].id() > h["abcd"].id());
-
459 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abce"].id());
-
460 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abce"].id());
-
461
-
462 // Switch support from abce to abcd, tie-breaker now needed
-
463 t.remove(h["abce"]);
-
464 t.insert(h["abcd"]);
-
465 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
-
466 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
-
467 }
-
468
-
469 // Single node larger grand child
-
470 {
-
471 LedgerTrie<Ledger> t;
-
472 LedgerHistoryHelper h;
-
473 t.insert(h["abc"]);
-
474 t.insert(h["abcd"], 2);
-
475 t.insert(h["abcde"], 4);
-
476 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abcde"].id());
-
477 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcde"].id());
-
478 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["abcde"].id());
-
479 }
-
480
-
481 // Too much uncommitted support from competing branches
-
482 {
-
483 LedgerTrie<Ledger> t;
-
484 LedgerHistoryHelper h;
-
485 t.insert(h["abc"]);
-
486 t.insert(h["abcde"], 2);
-
487 t.insert(h["abcfg"], 2);
-
488 // 'de' and 'fg' are tied without 'abc' vote
-
489 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
-
490 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
-
491 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["abc"].id());
-
492
-
493 t.remove(h["abc"]);
-
494 t.insert(h["abcd"]);
-
495
-
496 // 'de' branch has 3 votes to 2, so earlier sequences see it as
-
497 // preferred
-
498 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abcde"].id());
-
499 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcde"].id());
-
500
-
501 // However, if you validated a ledger with Seq 5, potentially on
-
502 // a different branch, you do not yet know if they chose abcd
-
503 // or abcf because of you, so abc remains preferred
-
504 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["abc"].id());
-
505 }
-
506
-
507 // Changing largestSeq perspective changes preferred branch
-
508 {
-
520 LedgerTrie<Ledger> t;
-
521 LedgerHistoryHelper h;
-
522 t.insert(h["ab"]);
-
523 t.insert(h["ac"]);
-
524 t.insert(h["acf"]);
-
525 t.insert(h["abde"], 2);
-
526
-
527 // B has more branch support
-
528 BEAST_EXPECT(t.getPreferred(Seq{1})->id == h["ab"].id());
-
529 BEAST_EXPECT(t.getPreferred(Seq{2})->id == h["ab"].id());
-
530 // But if you last validated D,F or E, you do not yet know
-
531 // if someone used that validation to commit to B or C
-
532 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["a"].id());
-
533 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["a"].id());
-
534
-
546 t.remove(h["abde"]);
-
547 t.insert(h["abdeg"]);
-
548
-
549 BEAST_EXPECT(t.getPreferred(Seq{1})->id == h["ab"].id());
-
550 BEAST_EXPECT(t.getPreferred(Seq{2})->id == h["ab"].id());
-
551 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["a"].id());
-
552 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["a"].id());
-
553 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["a"].id());
-
554
-
566 t.remove(h["ac"]);
-
567 t.insert(h["abh"]);
-
568 BEAST_EXPECT(t.getPreferred(Seq{1})->id == h["ab"].id());
-
569 BEAST_EXPECT(t.getPreferred(Seq{2})->id == h["ab"].id());
-
570 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["ab"].id());
-
571 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["a"].id());
-
572 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["a"].id());
-
573
-
585 t.remove(h["acf"]);
-
586 t.insert(h["abde"]);
-
587 BEAST_EXPECT(t.getPreferred(Seq{1})->id == h["abde"].id());
-
588 BEAST_EXPECT(t.getPreferred(Seq{2})->id == h["abde"].id());
-
589 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abde"].id());
-
590 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["ab"].id());
-
591 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["ab"].id());
-
592 }
-
593 }
-
594
-
595 void
-
596 testRootRelated()
-
597 {
-
598 using namespace csf;
-
599 using Seq = Ledger::Seq;
-
600 // Since the root is a special node that breaks the no-single child
-
601 // invariant, do some tests that exercise it.
-
602
-
603 LedgerTrie<Ledger> t;
-
604 LedgerHistoryHelper h;
-
605 BEAST_EXPECT(!t.remove(h[""]));
-
606 BEAST_EXPECT(t.branchSupport(h[""]) == 0);
-
607 BEAST_EXPECT(t.tipSupport(h[""]) == 0);
-
608
-
609 t.insert(h["a"]);
-
610 BEAST_EXPECT(t.checkInvariants());
-
611 BEAST_EXPECT(t.branchSupport(h[""]) == 1);
-
612 BEAST_EXPECT(t.tipSupport(h[""]) == 0);
-
613
-
614 t.insert(h["e"]);
-
615 BEAST_EXPECT(t.checkInvariants());
-
616 BEAST_EXPECT(t.branchSupport(h[""]) == 2);
-
617 BEAST_EXPECT(t.tipSupport(h[""]) == 0);
-
618
-
619 BEAST_EXPECT(t.remove(h["e"]));
-
620 BEAST_EXPECT(t.checkInvariants());
-
621 BEAST_EXPECT(t.branchSupport(h[""]) == 1);
-
622 BEAST_EXPECT(t.tipSupport(h[""]) == 0);
-
623 }
-
624
-
625 void
-
626 testStress()
-
627 {
-
628 using namespace csf;
-
629 LedgerTrie<Ledger> t;
-
630 LedgerHistoryHelper h;
-
631
-
632 // Test quasi-randomly add/remove supporting for different ledgers
-
633 // from a branching history.
-
634
-
635 // Ledgers have sequence 1,2,3,4
-
636 std::uint32_t const depthConst = 4;
-
637 // Each ledger has 4 possible children
-
638 std::uint32_t const width = 4;
+
316
+
317 LedgerTrie<Ledger> t;
+
318 LedgerHistoryHelper h;
+
319 BEAST_EXPECT(t.tipSupport(h["a"]) == 0);
+
320 BEAST_EXPECT(t.tipSupport(h["axy"]) == 0);
+
321
+
322 BEAST_EXPECT(t.branchSupport(h["a"]) == 0);
+
323 BEAST_EXPECT(t.branchSupport(h["axy"]) == 0);
+
324
+
325 t.insert(h["abc"]);
+
326 BEAST_EXPECT(t.tipSupport(h["a"]) == 0);
+
327 BEAST_EXPECT(t.tipSupport(h["ab"]) == 0);
+
328 BEAST_EXPECT(t.tipSupport(h["abc"]) == 1);
+
329 BEAST_EXPECT(t.tipSupport(h["abcd"]) == 0);
+
330
+
331 BEAST_EXPECT(t.branchSupport(h["a"]) == 1);
+
332 BEAST_EXPECT(t.branchSupport(h["ab"]) == 1);
+
333 BEAST_EXPECT(t.branchSupport(h["abc"]) == 1);
+
334 BEAST_EXPECT(t.branchSupport(h["abcd"]) == 0);
+
335
+
336 t.insert(h["abe"]);
+
337 BEAST_EXPECT(t.tipSupport(h["a"]) == 0);
+
338 BEAST_EXPECT(t.tipSupport(h["ab"]) == 0);
+
339 BEAST_EXPECT(t.tipSupport(h["abc"]) == 1);
+
340 BEAST_EXPECT(t.tipSupport(h["abe"]) == 1);
+
341
+
342 BEAST_EXPECT(t.branchSupport(h["a"]) == 2);
+
343 BEAST_EXPECT(t.branchSupport(h["ab"]) == 2);
+
344 BEAST_EXPECT(t.branchSupport(h["abc"]) == 1);
+
345 BEAST_EXPECT(t.branchSupport(h["abe"]) == 1);
+
346
+
347 t.remove(h["abc"]);
+
348 BEAST_EXPECT(t.tipSupport(h["a"]) == 0);
+
349 BEAST_EXPECT(t.tipSupport(h["ab"]) == 0);
+
350 BEAST_EXPECT(t.tipSupport(h["abc"]) == 0);
+
351 BEAST_EXPECT(t.tipSupport(h["abe"]) == 1);
+
352
+
353 BEAST_EXPECT(t.branchSupport(h["a"]) == 1);
+
354 BEAST_EXPECT(t.branchSupport(h["ab"]) == 1);
+
355 BEAST_EXPECT(t.branchSupport(h["abc"]) == 0);
+
356 BEAST_EXPECT(t.branchSupport(h["abe"]) == 1);
+
357 }
+
358
+
359 void
+
360 testGetPreferred()
+
361 {
+
362 using namespace csf;
+
363 using Seq = Ledger::Seq;
+
364 // Empty
+
365 {
+
366 LedgerTrie<Ledger> t;
+
367 BEAST_EXPECT(t.getPreferred(Seq{0}) == std::nullopt);
+
368 BEAST_EXPECT(t.getPreferred(Seq{2}) == std::nullopt);
+
369 }
+
370 // Genesis support is NOT empty
+
371 {
+
372 LedgerTrie<Ledger> t;
+
373 LedgerHistoryHelper h;
+
374 Ledger genesis = h[""];
+
375 t.insert(genesis);
+
376 BEAST_EXPECT(t.getPreferred(Seq{0})->id == genesis.id());
+
377 BEAST_EXPECT(t.remove(genesis));
+
378 BEAST_EXPECT(t.getPreferred(Seq{0}) == std::nullopt);
+
379 BEAST_EXPECT(!t.remove(genesis));
+
380 }
+
381 // Single node no children
+
382 {
+
383 LedgerTrie<Ledger> t;
+
384 LedgerHistoryHelper h;
+
385 t.insert(h["abc"]);
+
386 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
+
387 }
+
388 // Single node smaller child support
+
389 {
+
390 LedgerTrie<Ledger> t;
+
391 LedgerHistoryHelper h;
+
392 t.insert(h["abc"]);
+
393 t.insert(h["abcd"]);
+
394 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
+
395 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
+
396 }
+
397 // Single node larger child
+
398 {
+
399 LedgerTrie<Ledger> t;
+
400 LedgerHistoryHelper h;
+
401 t.insert(h["abc"]);
+
402 t.insert(h["abcd"], 2);
+
403 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abcd"].id());
+
404 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcd"].id());
+
405 }
+
406 // Single node smaller children support
+
407 {
+
408 LedgerTrie<Ledger> t;
+
409 LedgerHistoryHelper h;
+
410 t.insert(h["abc"]);
+
411 t.insert(h["abcd"]);
+
412 t.insert(h["abce"]);
+
413 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
+
414 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
+
415
+
416 t.insert(h["abc"]);
+
417 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
+
418 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
+
419 }
+
420 // Single node larger children
+
421 {
+
422 LedgerTrie<Ledger> t;
+
423 LedgerHistoryHelper h;
+
424 t.insert(h["abc"]);
+
425 t.insert(h["abcd"], 2);
+
426 t.insert(h["abce"]);
+
427 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
+
428 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
+
429
+
430 t.insert(h["abcd"]);
+
431 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abcd"].id());
+
432 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcd"].id());
+
433 }
+
434 // Tie-breaker by id
+
435 {
+
436 LedgerTrie<Ledger> t;
+
437 LedgerHistoryHelper h;
+
438 t.insert(h["abcd"], 2);
+
439 t.insert(h["abce"], 2);
+
440
+
441 BEAST_EXPECT(h["abce"].id() > h["abcd"].id());
+
442 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abce"].id());
+
443
+
444 t.insert(h["abcd"]);
+
445 BEAST_EXPECT(h["abce"].id() > h["abcd"].id());
+
446 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcd"].id());
+
447 }
+
448
+
449 // Tie-breaker not needed
+
450 {
+
451 LedgerTrie<Ledger> t;
+
452 LedgerHistoryHelper h;
+
453 t.insert(h["abc"]);
+
454 t.insert(h["abcd"]);
+
455 t.insert(h["abce"], 2);
+
456 // abce only has a margin of 1, but it owns the tie-breaker
+
457 BEAST_EXPECT(h["abce"].id() > h["abcd"].id());
+
458 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abce"].id());
+
459 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abce"].id());
+
460
+
461 // Switch support from abce to abcd, tie-breaker now needed
+
462 t.remove(h["abce"]);
+
463 t.insert(h["abcd"]);
+
464 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
+
465 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
+
466 }
+
467
+
468 // Single node larger grand child
+
469 {
+
470 LedgerTrie<Ledger> t;
+
471 LedgerHistoryHelper h;
+
472 t.insert(h["abc"]);
+
473 t.insert(h["abcd"], 2);
+
474 t.insert(h["abcde"], 4);
+
475 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abcde"].id());
+
476 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcde"].id());
+
477 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["abcde"].id());
+
478 }
+
479
+
480 // Too much uncommitted support from competing branches
+
481 {
+
482 LedgerTrie<Ledger> t;
+
483 LedgerHistoryHelper h;
+
484 t.insert(h["abc"]);
+
485 t.insert(h["abcde"], 2);
+
486 t.insert(h["abcfg"], 2);
+
487 // 'de' and 'fg' are tied without 'abc' vote
+
488 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abc"].id());
+
489 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abc"].id());
+
490 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["abc"].id());
+
491
+
492 t.remove(h["abc"]);
+
493 t.insert(h["abcd"]);
+
494
+
495 // 'de' branch has 3 votes to 2, so earlier sequences see it as
+
496 // preferred
+
497 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abcde"].id());
+
498 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["abcde"].id());
+
499
+
500 // However, if you validated a ledger with Seq 5, potentially on
+
501 // a different branch, you do not yet know if they chose abcd
+
502 // or abcf because of you, so abc remains preferred
+
503 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["abc"].id());
+
504 }
+
505
+
506 // Changing largestSeq perspective changes preferred branch
+
507 {
+
519 LedgerTrie<Ledger> t;
+
520 LedgerHistoryHelper h;
+
521 t.insert(h["ab"]);
+
522 t.insert(h["ac"]);
+
523 t.insert(h["acf"]);
+
524 t.insert(h["abde"], 2);
+
525
+
526 // B has more branch support
+
527 BEAST_EXPECT(t.getPreferred(Seq{1})->id == h["ab"].id());
+
528 BEAST_EXPECT(t.getPreferred(Seq{2})->id == h["ab"].id());
+
529 // But if you last validated D,F or E, you do not yet know
+
530 // if someone used that validation to commit to B or C
+
531 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["a"].id());
+
532 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["a"].id());
+
533
+
545 t.remove(h["abde"]);
+
546 t.insert(h["abdeg"]);
+
547
+
548 BEAST_EXPECT(t.getPreferred(Seq{1})->id == h["ab"].id());
+
549 BEAST_EXPECT(t.getPreferred(Seq{2})->id == h["ab"].id());
+
550 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["a"].id());
+
551 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["a"].id());
+
552 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["a"].id());
+
553
+
565 t.remove(h["ac"]);
+
566 t.insert(h["abh"]);
+
567 BEAST_EXPECT(t.getPreferred(Seq{1})->id == h["ab"].id());
+
568 BEAST_EXPECT(t.getPreferred(Seq{2})->id == h["ab"].id());
+
569 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["ab"].id());
+
570 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["a"].id());
+
571 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["a"].id());
+
572
+
584 t.remove(h["acf"]);
+
585 t.insert(h["abde"]);
+
586 BEAST_EXPECT(t.getPreferred(Seq{1})->id == h["abde"].id());
+
587 BEAST_EXPECT(t.getPreferred(Seq{2})->id == h["abde"].id());
+
588 BEAST_EXPECT(t.getPreferred(Seq{3})->id == h["abde"].id());
+
589 BEAST_EXPECT(t.getPreferred(Seq{4})->id == h["ab"].id());
+
590 BEAST_EXPECT(t.getPreferred(Seq{5})->id == h["ab"].id());
+
591 }
+
592 }
+
593
+
594 void
+
595 testRootRelated()
+
596 {
+
597 using namespace csf;
+
598 // Since the root is a special node that breaks the no-single child
+
599 // invariant, do some tests that exercise it.
+
600
+
601 LedgerTrie<Ledger> t;
+
602 LedgerHistoryHelper h;
+
603 BEAST_EXPECT(!t.remove(h[""]));
+
604 BEAST_EXPECT(t.branchSupport(h[""]) == 0);
+
605 BEAST_EXPECT(t.tipSupport(h[""]) == 0);
+
606
+
607 t.insert(h["a"]);
+
608 BEAST_EXPECT(t.checkInvariants());
+
609 BEAST_EXPECT(t.branchSupport(h[""]) == 1);
+
610 BEAST_EXPECT(t.tipSupport(h[""]) == 0);
+
611
+
612 t.insert(h["e"]);
+
613 BEAST_EXPECT(t.checkInvariants());
+
614 BEAST_EXPECT(t.branchSupport(h[""]) == 2);
+
615 BEAST_EXPECT(t.tipSupport(h[""]) == 0);
+
616
+
617 BEAST_EXPECT(t.remove(h["e"]));
+
618 BEAST_EXPECT(t.checkInvariants());
+
619 BEAST_EXPECT(t.branchSupport(h[""]) == 1);
+
620 BEAST_EXPECT(t.tipSupport(h[""]) == 0);
+
621 }
+
622
+
623 void
+
624 testStress()
+
625 {
+
626 using namespace csf;
+
627 LedgerTrie<Ledger> t;
+
628 LedgerHistoryHelper h;
+
629
+
630 // Test quasi-randomly add/remove supporting for different ledgers
+
631 // from a branching history.
+
632
+
633 // Ledgers have sequence 1,2,3,4
+
634 std::uint32_t const depthConst = 4;
+
635 // Each ledger has 4 possible children
+
636 std::uint32_t const width = 4;
+
637
+
638 std::uint32_t const iterations = 10000;
639
-
640 std::uint32_t const iterations = 10000;
-
641
-
642 // Use explicit seed to have same results for CI
-
643 std::mt19937 gen{42};
-
644 std::uniform_int_distribution<> depthDist(0, depthConst - 1);
-
645 std::uniform_int_distribution<> widthDist(0, width - 1);
-
646 std::uniform_int_distribution<> flip(0, 1);
-
647 for (std::uint32_t i = 0; i < iterations; ++i)
-
648 {
-
649 // pick a random ledger history
-
650 std::string curr = "";
-
651 char depth = depthDist(gen);
-
652 char offset = 0;
-
653 for (char d = 0; d < depth; ++d)
-
654 {
-
655 char a = offset + widthDist(gen);
-
656 curr += a;
-
657 offset = (a + 1) * width;
-
658 }
-
659
-
660 // 50-50 to add remove
-
661 if (flip(gen) == 0)
-
662 t.insert(h[curr]);
-
663 else
-
664 t.remove(h[curr]);
-
665 if (!BEAST_EXPECT(t.checkInvariants()))
-
666 return;
-
667 }
-
668 }
-
669
-
670 void
-
671 run() override
-
672 {
-
673 testInsert();
-
674 testRemove();
-
675 testEmpty();
-
676 testSupport();
-
677 testGetPreferred();
-
678 testRootRelated();
-
679 testStress();
-
680 }
-
681};
-
682
-
683BEAST_DEFINE_TESTSUITE(LedgerTrie, consensus, ripple);
-
684} // namespace test
-
685} // namespace ripple
+
640 // Use explicit seed to have same results for CI
+
641 std::mt19937 gen{42};
+
642 std::uniform_int_distribution<> depthDist(0, depthConst - 1);
+
643 std::uniform_int_distribution<> widthDist(0, width - 1);
+
644 std::uniform_int_distribution<> flip(0, 1);
+
645 for (std::uint32_t i = 0; i < iterations; ++i)
+
646 {
+
647 // pick a random ledger history
+
648 std::string curr = "";
+
649 char depth = depthDist(gen);
+
650 char offset = 0;
+
651 for (char d = 0; d < depth; ++d)
+
652 {
+
653 char a = offset + widthDist(gen);
+
654 curr += a;
+
655 offset = (a + 1) * width;
+
656 }
+
657
+
658 // 50-50 to add remove
+
659 if (flip(gen) == 0)
+
660 t.insert(h[curr]);
+
661 else
+
662 t.remove(h[curr]);
+
663 if (!BEAST_EXPECT(t.checkInvariants()))
+
664 return;
+
665 }
+
666 }
+
667
+
668 void
+
669 run() override
+
670 {
+
671 testInsert();
+
672 testRemove();
+
673 testEmpty();
+
674 testSupport();
+
675 testGetPreferred();
+
676 testRootRelated();
+
677 testStress();
+
678 }
+
679};
+
680
+
681BEAST_DEFINE_TESTSUITE(LedgerTrie, consensus, ripple);
+
682} // namespace test
+
683} // namespace ripple
std::string
beast::unit_test::suite
A testsuite class.
Definition: suite.h:55
ripple::LedgerTrie
Ancestry trie of ledgers.
Definition: LedgerTrie.h:351
@@ -729,14 +727,14 @@ $(function() {
ripple::LedgerTrie::checkInvariants
bool checkInvariants() const
Check the compressed trie and support invariants.
Definition: LedgerTrie.h:812
ripple::Ledger
Holds a ledger.
Definition: Ledger.h:80
ripple::test::LedgerTrie_test
Definition: LedgerTrie_test.cpp:32
-
ripple::test::LedgerTrie_test::testStress
void testStress()
Definition: LedgerTrie_test.cpp:626
-
ripple::test::LedgerTrie_test::run
void run() override
Runs the suite.
Definition: LedgerTrie_test.cpp:671
+
ripple::test::LedgerTrie_test::testStress
void testStress()
Definition: LedgerTrie_test.cpp:624
+
ripple::test::LedgerTrie_test::run
void run() override
Runs the suite.
Definition: LedgerTrie_test.cpp:669
ripple::test::LedgerTrie_test::testInsert
void testInsert()
Definition: LedgerTrie_test.cpp:34
ripple::test::LedgerTrie_test::testRemove
void testRemove()
Definition: LedgerTrie_test.cpp:161
ripple::test::LedgerTrie_test::testSupport
void testSupport()
Definition: LedgerTrie_test.cpp:313
-
ripple::test::LedgerTrie_test::testGetPreferred
void testGetPreferred()
Definition: LedgerTrie_test.cpp:361
+
ripple::test::LedgerTrie_test::testGetPreferred
void testGetPreferred()
Definition: LedgerTrie_test.cpp:360
ripple::test::LedgerTrie_test::testEmpty
void testEmpty()
Definition: LedgerTrie_test.cpp:293
-
ripple::test::LedgerTrie_test::testRootRelated
void testRootRelated()
Definition: LedgerTrie_test.cpp:596
+
ripple::test::LedgerTrie_test::testRootRelated
void testRootRelated()
Definition: LedgerTrie_test.cpp:595
std::uint32_t
std::mt19937
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
diff --git a/Ledger_8cpp_source.html b/Ledger_8cpp_source.html index 7eb36aead1..91bfce3251 100644 --- a/Ledger_8cpp_source.html +++ b/Ledger_8cpp_source.html @@ -1403,7 +1403,7 @@ $(function() {
ripple::loadByHash
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition: Ledger.cpp:1127
ripple::ConsensusPhase::open
@ open
We haven't closed our ledger yet, but others might have.
ripple::HashRouterFlags::SAVED
@ SAVED
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::isFlagLedger
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition: Ledger.cpp:957
ripple::ledgerGenesisTimeResolution
auto constexpr ledgerGenesisTimeResolution
Close time resolution in genesis ledger.
Definition: LedgerTiming.h:47
ripple::sLCF_NoConsensusTime
static std::uint32_t const sLCF_NoConsensusTime
Definition: LedgerHeader.h:82
diff --git a/LogLevel_8cpp_source.html b/LogLevel_8cpp_source.html index a28f29be3e..7e2684f314 100644 --- a/LogLevel_8cpp_source.html +++ b/LogLevel_8cpp_source.html @@ -122,47 +122,46 @@ $(function() {
44 Logs::toString(Logs::fromSeverity(context.app.logs().threshold()));
45 std::vector<std::pair<std::string, std::string>> logTable(
46 context.app.logs().partition_severities());
-
47 using stringPair = std::map<std::string, std::string>::value_type;
-
48 for (auto const& [k, v] : logTable)
-
49 lev[k] = v;
-
50
-
51 ret[jss::levels] = lev;
-
52 return ret;
-
53 }
-
54
-
55 LogSeverity const sv(
-
56 Logs::fromString(context.params[jss::severity].asString()));
-
57
-
58 if (sv == lsINVALID)
-
59 return rpcError(rpcINVALID_PARAMS);
-
60
-
61 auto severity = Logs::toSeverity(sv);
-
62 // log_level severity
-
63 if (!context.params.isMember(jss::partition))
-
64 {
-
65 // set base log threshold
-
66 context.app.logs().threshold(severity);
-
67 return Json::objectValue;
-
68 }
-
69
-
70 // log_level partition severity base?
-
71 if (context.params.isMember(jss::partition))
-
72 {
-
73 // set partition threshold
-
74 std::string partition(context.params[jss::partition].asString());
-
75
-
76 if (boost::iequals(partition, "base"))
-
77 context.app.logs().threshold(severity);
-
78 else
-
79 context.app.logs().get(partition).threshold(severity);
-
80
-
81 return Json::objectValue;
-
82 }
-
83
-
84 return rpcError(rpcINVALID_PARAMS);
-
85}
-
86
-
87} // namespace ripple
+
47 for (auto const& [k, v] : logTable)
+
48 lev[k] = v;
+
49
+
50 ret[jss::levels] = lev;
+
51 return ret;
+
52 }
+
53
+
54 LogSeverity const sv(
+
55 Logs::fromString(context.params[jss::severity].asString()));
+
56
+
57 if (sv == lsINVALID)
+
58 return rpcError(rpcINVALID_PARAMS);
+
59
+
60 auto severity = Logs::toSeverity(sv);
+
61 // log_level severity
+
62 if (!context.params.isMember(jss::partition))
+
63 {
+
64 // set base log threshold
+
65 context.app.logs().threshold(severity);
+
66 return Json::objectValue;
+
67 }
+
68
+
69 // log_level partition severity base?
+
70 if (context.params.isMember(jss::partition))
+
71 {
+
72 // set partition threshold
+
73 std::string partition(context.params[jss::partition].asString());
+
74
+
75 if (boost::iequals(partition, "base"))
+
76 context.app.logs().threshold(severity);
+
77 else
+
78 context.app.logs().get(partition).threshold(severity);
+
79
+
80 return Json::objectValue;
+
81 }
+
82
+
83 return rpcError(rpcINVALID_PARAMS);
+
84}
+
85
+
86} // namespace ripple
std::string
Json::Value
Represents a JSON value.
Definition: json_value.h:149
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:482
@@ -176,7 +175,6 @@ $(function() {
ripple::Logs::toSeverity
static beast::severities::Severity toSeverity(LogSeverity level)
Definition: Log.cpp:253
ripple::Logs::partition_severities
std::vector< std::pair< std::string, std::string > > partition_severities() const
Definition: Log.cpp:181
ripple::Logs::fromSeverity
static LogSeverity fromSeverity(beast::severities::Severity level)
Definition: Log.cpp:226
-
std::map
Json::objectValue
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:45
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
diff --git a/Manifest_8cpp_source.html b/Manifest_8cpp_source.html index 792ca3e7b8..70dba70883 100644 --- a/Manifest_8cpp_source.html +++ b/Manifest_8cpp_source.html @@ -749,10 +749,10 @@ $(function() {
ripple::TokenType::NodePublic
@ NodePublic
ripple::strUnHex
std::optional< Blob > strUnHex(std::size_t strSize, Iterator begin, Iterator end)
Definition: StringUtilities.h:51
ripple::saveManifests
void saveManifests(soci::session &session, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted, hash_map< PublicKey, Manifest > const &map, beast::Journal j)
saveManifests Saves all given manifests to the database.
Definition: Wallet.cpp:94
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::base64_decode
std::string base64_decode(std::string_view data)
Definition: libxrpl/basics/base64.cpp:248
ripple::sfGeneric
SField const sfGeneric
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::logMftAct
Stream & logMftAct(Stream &s, std::string const &action, PublicKey const &pk, std::uint32_t seq)
Definition: Manifest.cpp:168
ripple::ManifestDisposition
ManifestDisposition
Definition: Manifest.h:215
ripple::ManifestDisposition::badMasterKey
@ badMasterKey
The master key is not acceptable to us.
diff --git a/Manifest__test_8cpp_source.html b/Manifest__test_8cpp_source.html index d8b1c6beb3..2c3e4b5099 100644 --- a/Manifest__test_8cpp_source.html +++ b/Manifest__test_8cpp_source.html @@ -1227,13 +1227,13 @@ $(function() {
ripple::deserializeManifest
std::optional< Manifest > deserializeManifest(Slice s, beast::Journal journal)
Constructs Manifest from serialized string.
Definition: Manifest.cpp:54
ripple::TokenType::NodePrivate
@ NodePrivate
ripple::TokenType::NodePublic
@ NodePublic
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::randomSeed
Seed randomSeed()
Create a seed using secure random numbers.
Definition: Seed.cpp:66
ripple::sfGeneric
SField const sfGeneric
ripple::makeTestWalletDB
std::unique_ptr< DatabaseCon > makeTestWalletDB(DatabaseCon::Setup const &setup, std::string const &dbname, beast::Journal j)
makeTestWalletDB Opens a test wallet database with an arbitrary name.
Definition: Wallet.cpp:35
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:331
ripple::generateSecretKey
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
Definition: SecretKey.cpp:309
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::ManifestDisposition::badMasterKey
@ badMasterKey
The master key is not acceptable to us.
ripple::ManifestDisposition::stale
@ stale
Sequence is too old.
diff --git a/NegativeUNLVote_8cpp_source.html b/NegativeUNLVote_8cpp_source.html index 09c918a17a..c5e1a5f219 100644 --- a/NegativeUNLVote_8cpp_source.html +++ b/NegativeUNLVote_8cpp_source.html @@ -482,7 +482,7 @@ $(function() {
ripple::keylet::skip
Keylet const & skip() noexcept
The index of the "short" skip list.
Definition: Indexes.cpp:196
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::canAdd
bool canAdd(STAmount const &amt1, STAmount const &amt2)
Safely checks if two STAmount values can be added without overflow, underflow, or precision loss.
Definition: STAmount.cpp:528
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::make_shamapitem
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
Definition: SHAMapItem.h:161
ripple::SHAMapNodeType::tnTRANSACTION_NM
@ tnTRANSACTION_NM
ripple::FLAG_LEDGER_INTERVAL
std::uint32_t constexpr FLAG_LEDGER_INTERVAL
Definition: Ledger.h:426
diff --git a/NegativeUNL__test_8cpp_source.html b/NegativeUNL__test_8cpp_source.html index a34910864c..b5dd6b9837 100644 --- a/NegativeUNL__test_8cpp_source.html +++ b/NegativeUNL__test_8cpp_source.html @@ -2074,12 +2074,12 @@ $(function() {
ripple::SHAMapType::TRANSACTION
@ TRANSACTION
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:331
ripple::tefFAILURE
@ tefFAILURE
Definition: TER.h:166
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::randomSecretKey
SecretKey randomSecretKey()
Create a secret key using secure random numbers.
Definition: SecretKey.cpp:299
ripple::KeyType::ed25519
@ ed25519
ripple::KeyType::secp256k1
@ secp256k1
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::apply
ApplyResult apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition: apply.cpp:148
ripple::create_genesis
create_genesis_t const create_genesis
Definition: Ledger.cpp:51
diff --git a/PayChanClaim_8cpp_source.html b/PayChanClaim_8cpp_source.html index 21d1dc0f90..f743909c97 100644 --- a/PayChanClaim_8cpp_source.html +++ b/PayChanClaim_8cpp_source.html @@ -267,12 +267,12 @@ $(function() {
ripple::rpcINVALID_PARAMS
@ rpcINVALID_PARAMS
Definition: ErrorCodes.h:84
ripple::rpcINTERNAL
@ rpcINTERNAL
Definition: ErrorCodes.h:130
ripple::rpcCHANNEL_MALFORMED
@ rpcCHANNEL_MALFORMED
Definition: ErrorCodes.h:100
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::to_uint64
std::optional< std::uint64_t > to_uint64(std::string const &s)
Definition: StringUtilities.cpp:123
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:31
ripple::serializePayChanAuthorization
void serializePayChanAuthorization(Serializer &msg, uint256 const &key, XRPAmount const &amt)
Definition: include/xrpl/protocol/PayChan.h:31
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::Role::ADMIN
@ ADMIN
diff --git a/PayChan_8cpp_source.html b/PayChan_8cpp_source.html index 5227d75c3e..4332609c5e 100644 --- a/PayChan_8cpp_source.html +++ b/PayChan_8cpp_source.html @@ -730,7 +730,7 @@ $(function() {
ripple::closeChannel
static TER closeChannel(std::shared_ptr< SLE > const &slep, ApplyView &view, uint256 const &key, beast::Journal j)
Definition: PayChan.cpp:117
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
ripple::tfRenew
constexpr std::uint32_t tfRenew
Definition: TxFlags.h:132
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::lsfRequireDestTag
@ lsfRequireDestTag
Definition: LedgerFormats.h:126
ripple::lsfDisallowIncomingPayChan
@ lsfDisallowIncomingPayChan
Definition: LedgerFormats.h:144
ripple::lsfDisallowXRP
@ lsfDisallowXRP
Definition: LedgerFormats.h:130
@@ -740,7 +740,7 @@ $(function() {
ripple::serializePayChanAuthorization
void serializePayChanAuthorization(Serializer &msg, uint256 const &key, XRPAmount const &amt)
Definition: include/xrpl/protocol/PayChan.h:31
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::tecNO_ENTRY
@ tecNO_ENTRY
Definition: TER.h:306
diff --git a/PeerImp_8cpp_source.html b/PeerImp_8cpp_source.html index 206ac8461d..9f6d0ff566 100644 --- a/PeerImp_8cpp_source.html +++ b/PeerImp_8cpp_source.html @@ -3890,7 +3890,7 @@ $(function() {
ripple::HashRouterFlags
HashRouterFlags
Definition: HashRouter.h:34
ripple::HashRouterFlags::TRUSTED
@ TRUSTED
ripple::HashRouterFlags::BAD
@ BAD
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::rand_int
std::enable_if_t< std::is_integral< Integral >::value &&detail::is_engine< Engine >::value, Integral > rand_int(Engine &engine, Integral min, Integral max)
Return a uniformly distributed random integer.
Definition: include/xrpl/basics/random.h:115
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::getPeerWithLedger
static std::shared_ptr< PeerImp > getPeerWithLedger(OverlayImpl &ov, uint256 const &ledgerHash, LedgerIndex ledger, PeerImp const *skip)
Definition: PeerImp.cpp:3093
@@ -3898,7 +3898,7 @@ $(function() {
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::stopwatch
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Definition: chrono.h:119
ripple::http_request_type
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
Definition: Handoff.h:33
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::getPeerWithTree
static std::shared_ptr< PeerImp > getPeerWithTree(OverlayImpl &ov, uint256 const &rootHash, PeerImp const *skip)
Definition: PeerImp.cpp:3069
ripple::peerFeatureEnabled
bool peerFeatureEnabled(headers const &request, std::string const &feature, std::string value, bool config)
Check if a feature should be enabled for a peer.
Definition: Handshake.h:198
ripple::forceValidity
void forceValidity(HashRouter &router, uint256 const &txid, Validity validity)
Sets the validity of a given transaction in the cache.
Definition: apply.cpp:118
diff --git a/PublicKey_8cpp_source.html b/PublicKey_8cpp_source.html index 7023ae2352..86d45996df 100644 --- a/PublicKey_8cpp_source.html +++ b/PublicKey_8cpp_source.html @@ -185,213 +185,214 @@ $(function() {
107 }
108 for (int i = 0; i < slice.size(); ++i)
109 {
-
110 s += "0123456789ABCDEF"[((slice[i] & 0xf0) >> 4)];
-
111 s += "0123456789ABCDEF"[((slice[i] & 0x0f) >> 0)];
-
112 }
-
113 return s;
-
114}
-
115
-
128std::optional<ECDSACanonicality>
-
129ecdsaCanonicality(Slice const& sig)
-
130{
-
131 using uint264 =
-
132 boost::multiprecision::number<boost::multiprecision::cpp_int_backend<
-
133 264,
+
110 constexpr char hex[] = "0123456789ABCDEF";
+
111 s += hex[((slice[i] & 0xf0) >> 4)];
+
112 s += hex[((slice[i] & 0x0f) >> 0)];
+
113 }
+
114 return s;
+
115}
+
116
+
129std::optional<ECDSACanonicality>
+
130ecdsaCanonicality(Slice const& sig)
+
131{
+
132 using uint264 =
+
133 boost::multiprecision::number<boost::multiprecision::cpp_int_backend<
134 264,
-
135 boost::multiprecision::signed_magnitude,
-
136 boost::multiprecision::unchecked,
-
137 void>>;
-
138
-
139 static uint264 const G(
-
140 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141");
-
141
-
142 // The format of a signature should be:
-
143 // <30> <len> [ <02> <lenR> <R> ] [ <02> <lenS> <S> ]
-
144 if ((sig.size() < 8) || (sig.size() > 72))
-
145 return std::nullopt;
-
146 if ((sig[0] != 0x30) || (sig[1] != (sig.size() - 2)))
-
147 return std::nullopt;
-
148 Slice p = sig + 2;
-
149 auto r = sigPart(p);
-
150 auto s = sigPart(p);
-
151 if (!r || !s || !p.empty())
-
152 return std::nullopt;
-
153
-
154 uint264 R(sliceToHex(*r));
-
155 if (R >= G)
-
156 return std::nullopt;
-
157
-
158 uint264 S(sliceToHex(*s));
-
159 if (S >= G)
-
160 return std::nullopt;
-
161
-
162 // (R,S) and (R,G-S) are canonical,
-
163 // but is fully canonical when S <= G-S
-
164 auto const Sp = G - S;
-
165 if (S > Sp)
-
166 return ECDSACanonicality::canonical;
-
167 return ECDSACanonicality::fullyCanonical;
-
168}
-
169
-
170static bool
-
171ed25519Canonical(Slice const& sig)
-
172{
-
173 if (sig.size() != 64)
-
174 return false;
-
175 // Big-endian Order, the Ed25519 subgroup order
-
176 std::uint8_t const Order[] = {
-
177 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
178 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0xDE, 0xF9, 0xDE, 0xA2, 0xF7,
-
179 0x9C, 0xD6, 0x58, 0x12, 0x63, 0x1A, 0x5C, 0xF5, 0xD3, 0xED,
-
180 };
-
181 // Take the second half of signature
-
182 // and byte-reverse it to big-endian.
-
183 auto const le = sig.data() + 32;
-
184 std::uint8_t S[32];
-
185 std::reverse_copy(le, le + 32, S);
-
186 // Must be less than Order
-
187 return std::lexicographical_compare(S, S + 32, Order, Order + 32);
-
188}
-
189
-
190//------------------------------------------------------------------------------
-
191
-
192PublicKey::PublicKey(Slice const& slice)
-
193{
-
194 if (slice.size() < size_)
-
195 LogicError(
-
196 "PublicKey::PublicKey - Input slice cannot be an undersized "
-
197 "buffer");
-
198
-
199 if (!publicKeyType(slice))
-
200 LogicError("PublicKey::PublicKey invalid type");
-
201 std::memcpy(buf_, slice.data(), size_);
-
202}
-
203
-
204PublicKey::PublicKey(PublicKey const& other)
-
205{
-
206 std::memcpy(buf_, other.buf_, size_);
-
207}
-
208
-
209PublicKey&
-
210PublicKey::operator=(PublicKey const& other)
-
211{
-
212 if (this != &other)
-
213 {
-
214 std::memcpy(buf_, other.buf_, size_);
-
215 }
-
216
-
217 return *this;
-
218}
-
219
-
220//------------------------------------------------------------------------------
-
221
-
222std::optional<KeyType>
-
223publicKeyType(Slice const& slice)
-
224{
-
225 if (slice.size() == 33)
-
226 {
-
227 if (slice[0] == 0xED)
-
228 return KeyType::ed25519;
-
229
-
230 if (slice[0] == 0x02 || slice[0] == 0x03)
-
231 return KeyType::secp256k1;
-
232 }
-
233
-
234 return std::nullopt;
-
235}
-
236
-
237bool
-
238verifyDigest(
-
239 PublicKey const& publicKey,
-
240 uint256 const& digest,
-
241 Slice const& sig,
-
242 bool mustBeFullyCanonical) noexcept
-
243{
-
244 if (publicKeyType(publicKey) != KeyType::secp256k1)
-
245 LogicError("sign: secp256k1 required for digest signing");
-
246 auto const canonicality = ecdsaCanonicality(sig);
-
247 if (!canonicality)
-
248 return false;
-
249 if (mustBeFullyCanonical &&
-
250 (*canonicality != ECDSACanonicality::fullyCanonical))
-
251 return false;
-
252
-
253 secp256k1_pubkey pubkey_imp;
-
254 if (secp256k1_ec_pubkey_parse(
-
255 secp256k1Context(),
-
256 &pubkey_imp,
-
257 reinterpret_cast<unsigned char const*>(publicKey.data()),
-
258 publicKey.size()) != 1)
-
259 return false;
-
260
-
261 secp256k1_ecdsa_signature sig_imp;
-
262 if (secp256k1_ecdsa_signature_parse_der(
-
263 secp256k1Context(),
-
264 &sig_imp,
-
265 reinterpret_cast<unsigned char const*>(sig.data()),
-
266 sig.size()) != 1)
-
267 return false;
-
268 if (*canonicality != ECDSACanonicality::fullyCanonical)
-
269 {
-
270 secp256k1_ecdsa_signature sig_norm;
-
271 if (secp256k1_ecdsa_signature_normalize(
-
272 secp256k1Context(), &sig_norm, &sig_imp) != 1)
-
273 return false;
-
274 return secp256k1_ecdsa_verify(
-
275 secp256k1Context(),
-
276 &sig_norm,
-
277 reinterpret_cast<unsigned char const*>(digest.data()),
-
278 &pubkey_imp) == 1;
-
279 }
-
280 return secp256k1_ecdsa_verify(
-
281 secp256k1Context(),
-
282 &sig_imp,
-
283 reinterpret_cast<unsigned char const*>(digest.data()),
-
284 &pubkey_imp) == 1;
-
285}
-
286
-
287bool
-
288verify(
-
289 PublicKey const& publicKey,
-
290 Slice const& m,
-
291 Slice const& sig,
-
292 bool mustBeFullyCanonical) noexcept
-
293{
-
294 if (auto const type = publicKeyType(publicKey))
-
295 {
-
296 if (*type == KeyType::secp256k1)
-
297 {
-
298 return verifyDigest(
-
299 publicKey, sha512Half(m), sig, mustBeFullyCanonical);
-
300 }
-
301 else if (*type == KeyType::ed25519)
-
302 {
-
303 if (!ed25519Canonical(sig))
-
304 return false;
-
305
-
306 // We internally prefix Ed25519 keys with a 0xED
-
307 // byte to distinguish them from secp256k1 keys
-
308 // so when verifying the signature, we need to
-
309 // first strip that prefix.
-
310 return ed25519_sign_open(
-
311 m.data(), m.size(), publicKey.data() + 1, sig.data()) ==
-
312 0;
-
313 }
-
314 }
-
315 return false;
-
316}
-
317
-
318NodeID
-
319calcNodeID(PublicKey const& pk)
-
320{
-
321 static_assert(NodeID::bytes == sizeof(ripesha_hasher::result_type));
-
322
-
323 ripesha_hasher h;
-
324 h(pk.data(), pk.size());
-
325 return NodeID{static_cast<ripesha_hasher::result_type>(h)};
-
326}
-
327
-
328} // namespace ripple
+
135 264,
+
136 boost::multiprecision::signed_magnitude,
+
137 boost::multiprecision::unchecked,
+
138 void>>;
+
139
+
140 static uint264 const G(
+
141 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141");
+
142
+
143 // The format of a signature should be:
+
144 // <30> <len> [ <02> <lenR> <R> ] [ <02> <lenS> <S> ]
+
145 if ((sig.size() < 8) || (sig.size() > 72))
+
146 return std::nullopt;
+
147 if ((sig[0] != 0x30) || (sig[1] != (sig.size() - 2)))
+
148 return std::nullopt;
+
149 Slice p = sig + 2;
+
150 auto r = sigPart(p);
+
151 auto s = sigPart(p);
+
152 if (!r || !s || !p.empty())
+
153 return std::nullopt;
+
154
+
155 uint264 R(sliceToHex(*r));
+
156 if (R >= G)
+
157 return std::nullopt;
+
158
+
159 uint264 S(sliceToHex(*s));
+
160 if (S >= G)
+
161 return std::nullopt;
+
162
+
163 // (R,S) and (R,G-S) are canonical,
+
164 // but is fully canonical when S <= G-S
+
165 auto const Sp = G - S;
+
166 if (S > Sp)
+
167 return ECDSACanonicality::canonical;
+
168 return ECDSACanonicality::fullyCanonical;
+
169}
+
170
+
171static bool
+
172ed25519Canonical(Slice const& sig)
+
173{
+
174 if (sig.size() != 64)
+
175 return false;
+
176 // Big-endian Order, the Ed25519 subgroup order
+
177 std::uint8_t const Order[] = {
+
178 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
179 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0xDE, 0xF9, 0xDE, 0xA2, 0xF7,
+
180 0x9C, 0xD6, 0x58, 0x12, 0x63, 0x1A, 0x5C, 0xF5, 0xD3, 0xED,
+
181 };
+
182 // Take the second half of signature
+
183 // and byte-reverse it to big-endian.
+
184 auto const le = sig.data() + 32;
+
185 std::uint8_t S[32];
+
186 std::reverse_copy(le, le + 32, S);
+
187 // Must be less than Order
+
188 return std::lexicographical_compare(S, S + 32, Order, Order + 32);
+
189}
+
190
+
191//------------------------------------------------------------------------------
+
192
+
193PublicKey::PublicKey(Slice const& slice)
+
194{
+
195 if (slice.size() < size_)
+
196 LogicError(
+
197 "PublicKey::PublicKey - Input slice cannot be an undersized "
+
198 "buffer");
+
199
+
200 if (!publicKeyType(slice))
+
201 LogicError("PublicKey::PublicKey invalid type");
+
202 std::memcpy(buf_, slice.data(), size_);
+
203}
+
204
+
205PublicKey::PublicKey(PublicKey const& other)
+
206{
+
207 std::memcpy(buf_, other.buf_, size_);
+
208}
+
209
+
210PublicKey&
+
211PublicKey::operator=(PublicKey const& other)
+
212{
+
213 if (this != &other)
+
214 {
+
215 std::memcpy(buf_, other.buf_, size_);
+
216 }
+
217
+
218 return *this;
+
219}
+
220
+
221//------------------------------------------------------------------------------
+
222
+
223std::optional<KeyType>
+
224publicKeyType(Slice const& slice)
+
225{
+
226 if (slice.size() == 33)
+
227 {
+
228 if (slice[0] == 0xED)
+
229 return KeyType::ed25519;
+
230
+
231 if (slice[0] == 0x02 || slice[0] == 0x03)
+
232 return KeyType::secp256k1;
+
233 }
+
234
+
235 return std::nullopt;
+
236}
+
237
+
238bool
+
239verifyDigest(
+
240 PublicKey const& publicKey,
+
241 uint256 const& digest,
+
242 Slice const& sig,
+
243 bool mustBeFullyCanonical) noexcept
+
244{
+
245 if (publicKeyType(publicKey) != KeyType::secp256k1)
+
246 LogicError("sign: secp256k1 required for digest signing");
+
247 auto const canonicality = ecdsaCanonicality(sig);
+
248 if (!canonicality)
+
249 return false;
+
250 if (mustBeFullyCanonical &&
+
251 (*canonicality != ECDSACanonicality::fullyCanonical))
+
252 return false;
+
253
+
254 secp256k1_pubkey pubkey_imp;
+
255 if (secp256k1_ec_pubkey_parse(
+
256 secp256k1Context(),
+
257 &pubkey_imp,
+
258 reinterpret_cast<unsigned char const*>(publicKey.data()),
+
259 publicKey.size()) != 1)
+
260 return false;
+
261
+
262 secp256k1_ecdsa_signature sig_imp;
+
263 if (secp256k1_ecdsa_signature_parse_der(
+
264 secp256k1Context(),
+
265 &sig_imp,
+
266 reinterpret_cast<unsigned char const*>(sig.data()),
+
267 sig.size()) != 1)
+
268 return false;
+
269 if (*canonicality != ECDSACanonicality::fullyCanonical)
+
270 {
+
271 secp256k1_ecdsa_signature sig_norm;
+
272 if (secp256k1_ecdsa_signature_normalize(
+
273 secp256k1Context(), &sig_norm, &sig_imp) != 1)
+
274 return false;
+
275 return secp256k1_ecdsa_verify(
+
276 secp256k1Context(),
+
277 &sig_norm,
+
278 reinterpret_cast<unsigned char const*>(digest.data()),
+
279 &pubkey_imp) == 1;
+
280 }
+
281 return secp256k1_ecdsa_verify(
+
282 secp256k1Context(),
+
283 &sig_imp,
+
284 reinterpret_cast<unsigned char const*>(digest.data()),
+
285 &pubkey_imp) == 1;
+
286}
+
287
+
288bool
+
289verify(
+
290 PublicKey const& publicKey,
+
291 Slice const& m,
+
292 Slice const& sig,
+
293 bool mustBeFullyCanonical) noexcept
+
294{
+
295 if (auto const type = publicKeyType(publicKey))
+
296 {
+
297 if (*type == KeyType::secp256k1)
+
298 {
+
299 return verifyDigest(
+
300 publicKey, sha512Half(m), sig, mustBeFullyCanonical);
+
301 }
+
302 else if (*type == KeyType::ed25519)
+
303 {
+
304 if (!ed25519Canonical(sig))
+
305 return false;
+
306
+
307 // We internally prefix Ed25519 keys with a 0xED
+
308 // byte to distinguish them from secp256k1 keys
+
309 // so when verifying the signature, we need to
+
310 // first strip that prefix.
+
311 return ed25519_sign_open(
+
312 m.data(), m.size(), publicKey.data() + 1, sig.data()) ==
+
313 0;
+
314 }
+
315 }
+
316 return false;
+
317}
+
318
+
319NodeID
+
320calcNodeID(PublicKey const& pk)
+
321{
+
322 static_assert(NodeID::bytes == sizeof(ripesha_hasher::result_type));
+
323
+
324 ripesha_hasher h;
+
325 h(pk.data(), pk.size());
+
326 return NodeID{static_cast<ripesha_hasher::result_type>(h)};
+
327}
+
328
+
329} // namespace ripple
algorithm
std::array
std::ostream
@@ -403,7 +404,7 @@ $(function() {
ripple::PublicKey::PublicKey
PublicKey()=delete
ripple::PublicKey::buf_
std::uint8_t buf_[size_]
Definition: PublicKey.h:66
ripple::PublicKey::slice
Slice slice() const noexcept
Definition: PublicKey.h:122
-
ripple::PublicKey::operator=
PublicKey & operator=(PublicKey const &other)
Definition: PublicKey.cpp:210
+
ripple::PublicKey::operator=
PublicKey & operator=(PublicKey const &other)
Definition: PublicKey.cpp:211
ripple::Slice
An immutable linear range of bytes.
Definition: Slice.h:46
ripple::Slice::empty
bool empty() const noexcept
Return true if the byte range is empty.
Definition: Slice.h:70
ripple::Slice::data
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
Definition: Slice.h:98
@@ -417,26 +418,26 @@ $(function() {
std::memcpy
T memcpy(T... args)
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::secp256k1Context
secp256k1_context const * secp256k1Context()
Definition: secp256k1.h:29
-
ripple::ecdsaCanonicality
std::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determines the canonicality of a signature.
Definition: PublicKey.cpp:129
+
ripple::ecdsaCanonicality
std::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determines the canonicality of a signature.
Definition: PublicKey.cpp:130
ripple::TokenType
TokenType
Definition: tokens.h:38
-
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:238
+
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:239
ripple::ECDSACanonicality::fullyCanonical
@ fullyCanonical
ripple::ECDSACanonicality::canonical
@ canonical
ripple::parseBase58
std::optional< AccountID > parseBase58(std::string const &s)
Parse AccountID from checked, base58 string.
Definition: AccountID.cpp:124
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::sliceToHex
static std::string sliceToHex(Slice const &slice)
Definition: PublicKey.cpp:95
ripple::NodeID
base_uint< 160, detail::NodeIDTag > NodeID
NodeID is a 160-bit hash representing one node.
Definition: UintTypes.h:59
ripple::sigPart
static std::optional< Slice > sigPart(Slice &buf)
Definition: PublicKey.cpp:69
ripple::operator<<
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
Definition: base_uint.h:637
ripple::decodeBase58Token
std::string decodeBase58Token(std::string const &s, TokenType type)
Definition: tokens.cpp:209
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::digest
static Hasher::result_type digest(void const *data, std::size_t size) noexcept
Definition: tokens.cpp:156
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::KeyType::ed25519
@ ed25519
ripple::KeyType::secp256k1
@ secp256k1
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
-
ripple::ed25519Canonical
static bool ed25519Canonical(Slice const &sig)
Definition: PublicKey.cpp:171
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
+
ripple::ed25519Canonical
static bool ed25519Canonical(Slice const &sig)
Definition: PublicKey.cpp:172
ripple::sha512Half
sha512_half_hasher::result_type sha512Half(Args const &... args)
Returns the SHA512-Half of a series of objects.
Definition: digest.h:224
ripple::LogicError
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Definition: libxrpl/basics/contract.cpp:37
optional
diff --git a/PublicKey_8h_source.html b/PublicKey_8h_source.html index f7c68823a3..25f60928ad 100644 --- a/PublicKey_8h_source.html +++ b/PublicKey_8h_source.html @@ -317,7 +317,7 @@ $(function() {
ripple::PublicKey::end
const_iterator end() const noexcept
Definition: PublicKey.h:110
ripple::PublicKey::buf_
std::uint8_t buf_[size_]
Definition: PublicKey.h:66
ripple::PublicKey::slice
Slice slice() const noexcept
Definition: PublicKey.h:122
-
ripple::PublicKey::operator=
PublicKey & operator=(PublicKey const &other)
Definition: PublicKey.cpp:210
+
ripple::PublicKey::operator=
PublicKey & operator=(PublicKey const &other)
Definition: PublicKey.cpp:211
ripple::SField
Identifies fields.
Definition: SField.h:143
ripple::STBlob
Definition: STBlob.h:35
ripple::STBlob::data
std::uint8_t const * data() const
Definition: STBlob.h:117
@@ -333,28 +333,28 @@ $(function() {
Json::getOrThrow
ripple::AccountID getOrThrow(Json::Value const &v, ripple::SField const &field)
Definition: AccountID.h:131
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::AccountID
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition: AccountID.h:48
-
ripple::ecdsaCanonicality
std::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determines the canonicality of a signature.
Definition: PublicKey.cpp:129
+
ripple::ecdsaCanonicality
std::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determines the canonicality of a signature.
Definition: PublicKey.cpp:130
ripple::hash_append
void hash_append(Hasher &h, Slice const &v)
Definition: Slice.h:199
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::TokenType
TokenType
Definition: tokens.h:38
ripple::TokenType::AccountPublic
@ AccountPublic
ripple::TokenType::NodePublic
@ NodePublic
-
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:238
+
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:239
ripple::strUnHex
std::optional< Blob > strUnHex(std::size_t strSize, Iterator begin, Iterator end)
Definition: StringUtilities.h:51
ripple::ECDSACanonicality
ECDSACanonicality
Definition: PublicKey.h:193
ripple::ECDSACanonicality::fullyCanonical
@ fullyCanonical
ripple::ECDSACanonicality::canonical
@ canonical
ripple::parseBase58
std::optional< AccountID > parseBase58(std::string const &s)
Parse AccountID from checked, base58 string.
Definition: AccountID.cpp:124
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:558
ripple::NodeID
base_uint< 160, detail::NodeIDTag > NodeID
NodeID is a 160-bit hash representing one node.
Definition: UintTypes.h:59
ripple::operator<<
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
Definition: base_uint.h:637
ripple::encodeBase58Token
std::string encodeBase58Token(TokenType type, void const *token, std::size_t size)
Encode data in Base58Check format using XRPL alphabet.
Definition: tokens.cpp:199
ripple::calcAccountID
AccountID calcAccountID(PublicKey const &pk)
Definition: AccountID.cpp:168
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::digest
static Hasher::result_type digest(void const *data, std::size_t size) noexcept
Definition: tokens.cpp:156
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::operator<
bool operator<(Slice const &lhs, Slice const &rhs) noexcept
Definition: Slice.h:223
ripple::operator==
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
Definition: base_uint.h:585
optional
diff --git a/PublicKey__test_8cpp_source.html b/PublicKey__test_8cpp_source.html index 2bc64f5323..a65eaeae0d 100644 --- a/PublicKey__test_8cpp_source.html +++ b/PublicKey__test_8cpp_source.html @@ -571,7 +571,7 @@ $(function() {
std::hash
protocol
Definition: ValidatorList.h:38
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::ecdsaCanonicality
std::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determines the canonicality of a signature.
Definition: PublicKey.cpp:129
+
ripple::ecdsaCanonicality
std::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determines the canonicality of a signature.
Definition: PublicKey.cpp:130
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::TokenType::NodePublic
@ NodePublic
ripple::ECDSACanonicality::fullyCanonical
@ fullyCanonical
diff --git a/RCLCxPeerPos_8cpp_source.html b/RCLCxPeerPos_8cpp_source.html index 3361879618..a7081ad6e8 100644 --- a/RCLCxPeerPos_8cpp_source.html +++ b/RCLCxPeerPos_8cpp_source.html @@ -189,7 +189,7 @@ $(function() {
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::proposalUniqueId
uint256 proposalUniqueId(uint256 const &proposeHash, uint256 const &previousLedger, std::uint32_t proposeSeq, NetClock::time_point closeTime, Slice const &publicKey, Slice const &signature)
Calculate a unique identifier for a signed proposal.
Definition: RCLCxPeerPos.cpp:66
ripple::TokenType::NodePublic
@ NodePublic
-
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:238
+
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:239
ripple::HashPrefix::proposal
@ proposal
proposal for signing
std
STL namespace.
std::chrono::time_point
diff --git a/RCLValidations_8cpp_source.html b/RCLValidations_8cpp_source.html index 632c544b90..7c4b184ff8 100644 --- a/RCLValidations_8cpp_source.html +++ b/RCLValidations_8cpp_source.html @@ -377,7 +377,7 @@ $(function() {
ripple::ValStatus::current
@ current
This was a new validation and was added.
ripple::ValStatus::conflicting
@ conflicting
Multiple validations by a validator for different ledgers.
ripple::ValStatus::multiple
@ multiple
Multiple validations by a validator for the same ledger.
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::jtADVANCE
@ jtADVANCE
Definition: Job.h:67
ripple::BypassAccept
BypassAccept
Definition: RCLValidations.h:37
ripple::BypassAccept::yes
@ yes
diff --git a/RCLValidations__test_8cpp_source.html b/RCLValidations__test_8cpp_source.html index c9440da47d..c85a6b718b 100644 --- a/RCLValidations__test_8cpp_source.html +++ b/RCLValidations__test_8cpp_source.html @@ -307,109 +307,108 @@ $(function() {
229 // support for a ledger hash which is already in the trie.
230
231 using Seq = RCLValidatedLedger::Seq;
-
232 using ID = RCLValidatedLedger::ID;
-
233
-
234 // Max known ancestors for each ledger
-
235 Seq const maxAncestors = 256;
-
236 std::vector<std::shared_ptr<Ledger const>> history;
-
237
-
238 // Generate a chain of 256 + 10 ledgers
-
239 jtx::Env env(*this);
-
240 auto& j = env.journal;
-
241 Config config;
-
242 auto prev = std::make_shared<Ledger const>(
-
243 create_genesis,
-
244 config,
-
245 std::vector<uint256>{},
-
246 env.app().getNodeFamily());
-
247 history.push_back(prev);
-
248 for (auto i = 0; i < (maxAncestors + 10); ++i)
-
249 {
-
250 auto next = std::make_shared<Ledger>(
-
251 *prev, env.app().timeKeeper().closeTime());
-
252 next->updateSkipList();
-
253 history.push_back(next);
-
254 prev = next;
-
255 }
-
256
-
257 LedgerTrie<RCLValidatedLedger> trie;
-
258
-
259 // First, create the single branch trie, with ledgers
-
260 // separated by exactly 256 ledgers
-
261 auto ledg_002 = RCLValidatedLedger{history[1], j};
-
262 auto ledg_258 = RCLValidatedLedger{history[257], j};
-
263 auto ledg_259 = RCLValidatedLedger{history[258], j};
-
264
-
265 trie.insert(ledg_002);
-
266 trie.insert(ledg_258, 4);
-
267 // trie.dump(std::cout);
-
268 // 000000[0,1)(T:0,B:5)
-
269 // |-AB868A..36C8[1,3)(T:1,B:5)
-
270 // |-AB868A..37C8[3,259)(T:4,B:4)
-
271 BEAST_EXPECT(trie.tipSupport(ledg_002) == 1);
-
272 BEAST_EXPECT(trie.branchSupport(ledg_002) == 5);
-
273 BEAST_EXPECT(trie.tipSupport(ledg_258) == 4);
-
274 BEAST_EXPECT(trie.branchSupport(ledg_258) == 4);
-
275
-
276 // Move three of the s258 ledgers to s259, which splits the trie
-
277 // due to the 256 ancestory limit
-
278 BEAST_EXPECT(trie.remove(ledg_258, 3));
-
279 trie.insert(ledg_259, 3);
-
280 trie.getPreferred(1);
-
281 // trie.dump(std::cout);
-
282 // 000000[0,1)(T:0,B:5)
-
283 // |-AB868A..37C9[1,260)(T:3,B:3)
-
284 // |-AB868A..36C8[1,3)(T:1,B:2)
-
285 // |-AB868A..37C8[3,259)(T:1,B:1)
-
286 BEAST_EXPECT(trie.tipSupport(ledg_002) == 1);
-
287 BEAST_EXPECT(trie.branchSupport(ledg_002) == 2);
-
288 BEAST_EXPECT(trie.tipSupport(ledg_258) == 1);
-
289 BEAST_EXPECT(trie.branchSupport(ledg_258) == 1);
-
290 BEAST_EXPECT(trie.tipSupport(ledg_259) == 3);
-
291 BEAST_EXPECT(trie.branchSupport(ledg_259) == 3);
-
292
-
293 // The last call to trie.getPreferred cycled the children of the root
-
294 // node to make the new branch the first child (since it has support 3)
-
295 // then verify the remove call works
-
296 // past bug: remove had assumed the first child of a node in the trie
-
297 // which matches is the *only* child in the trie which matches.
-
298 // This is **NOT** true with the limited 256 ledger ancestory
-
299 // quirk of RCLValidation and prevents deleting the old support
-
300 // for ledger 257
-
301
-
302 BEAST_EXPECT(
-
303 trie.remove(RCLValidatedLedger{history[257], env.journal}, 1));
-
304 trie.insert(RCLValidatedLedger{history[258], env.journal}, 1);
-
305 trie.getPreferred(1);
-
306 // trie.dump(std::cout);
-
307 // 000000[0,1)(T:0,B:5)
-
308 // |-AB868A..37C9[1,260)(T:4,B:4)
-
309 // |-AB868A..36C8[1,3)(T:1,B:1)
-
310 BEAST_EXPECT(trie.tipSupport(ledg_002) == 1);
-
311 BEAST_EXPECT(trie.branchSupport(ledg_002) == 1);
-
312 BEAST_EXPECT(trie.tipSupport(ledg_258) == 0);
-
313 // 258 no longer lives on a tip in the tree, BUT it is an ancestor
-
314 // of 259 which is a tip and therefore gets it's branchSupport value
-
315 // implicitly
-
316 BEAST_EXPECT(trie.branchSupport(ledg_258) == 4);
-
317 BEAST_EXPECT(trie.tipSupport(ledg_259) == 4);
-
318 BEAST_EXPECT(trie.branchSupport(ledg_259) == 4);
-
319 }
-
320
-
321public:
-
322 void
-
323 run() override
-
324 {
-
325 testChangeTrusted();
-
326 testRCLValidatedLedger();
-
327 testLedgerTrieRCLValidatedLedger();
-
328 }
-
329};
-
330
-
331BEAST_DEFINE_TESTSUITE(RCLValidations, app, ripple);
-
332
-
333} // namespace test
-
334} // namespace ripple
+
232
+
233 // Max known ancestors for each ledger
+
234 Seq const maxAncestors = 256;
+
235 std::vector<std::shared_ptr<Ledger const>> history;
+
236
+
237 // Generate a chain of 256 + 10 ledgers
+
238 jtx::Env env(*this);
+
239 auto& j = env.journal;
+
240 Config config;
+
241 auto prev = std::make_shared<Ledger const>(
+
242 create_genesis,
+
243 config,
+
244 std::vector<uint256>{},
+
245 env.app().getNodeFamily());
+
246 history.push_back(prev);
+
247 for (auto i = 0; i < (maxAncestors + 10); ++i)
+
248 {
+
249 auto next = std::make_shared<Ledger>(
+
250 *prev, env.app().timeKeeper().closeTime());
+
251 next->updateSkipList();
+
252 history.push_back(next);
+
253 prev = next;
+
254 }
+
255
+
256 LedgerTrie<RCLValidatedLedger> trie;
+
257
+
258 // First, create the single branch trie, with ledgers
+
259 // separated by exactly 256 ledgers
+
260 auto ledg_002 = RCLValidatedLedger{history[1], j};
+
261 auto ledg_258 = RCLValidatedLedger{history[257], j};
+
262 auto ledg_259 = RCLValidatedLedger{history[258], j};
+
263
+
264 trie.insert(ledg_002);
+
265 trie.insert(ledg_258, 4);
+
266 // trie.dump(std::cout);
+
267 // 000000[0,1)(T:0,B:5)
+
268 // |-AB868A..36C8[1,3)(T:1,B:5)
+
269 // |-AB868A..37C8[3,259)(T:4,B:4)
+
270 BEAST_EXPECT(trie.tipSupport(ledg_002) == 1);
+
271 BEAST_EXPECT(trie.branchSupport(ledg_002) == 5);
+
272 BEAST_EXPECT(trie.tipSupport(ledg_258) == 4);
+
273 BEAST_EXPECT(trie.branchSupport(ledg_258) == 4);
+
274
+
275 // Move three of the s258 ledgers to s259, which splits the trie
+
276 // due to the 256 ancestory limit
+
277 BEAST_EXPECT(trie.remove(ledg_258, 3));
+
278 trie.insert(ledg_259, 3);
+
279 trie.getPreferred(1);
+
280 // trie.dump(std::cout);
+
281 // 000000[0,1)(T:0,B:5)
+
282 // |-AB868A..37C9[1,260)(T:3,B:3)
+
283 // |-AB868A..36C8[1,3)(T:1,B:2)
+
284 // |-AB868A..37C8[3,259)(T:1,B:1)
+
285 BEAST_EXPECT(trie.tipSupport(ledg_002) == 1);
+
286 BEAST_EXPECT(trie.branchSupport(ledg_002) == 2);
+
287 BEAST_EXPECT(trie.tipSupport(ledg_258) == 1);
+
288 BEAST_EXPECT(trie.branchSupport(ledg_258) == 1);
+
289 BEAST_EXPECT(trie.tipSupport(ledg_259) == 3);
+
290 BEAST_EXPECT(trie.branchSupport(ledg_259) == 3);
+
291
+
292 // The last call to trie.getPreferred cycled the children of the root
+
293 // node to make the new branch the first child (since it has support 3)
+
294 // then verify the remove call works
+
295 // past bug: remove had assumed the first child of a node in the trie
+
296 // which matches is the *only* child in the trie which matches.
+
297 // This is **NOT** true with the limited 256 ledger ancestory
+
298 // quirk of RCLValidation and prevents deleting the old support
+
299 // for ledger 257
+
300
+
301 BEAST_EXPECT(
+
302 trie.remove(RCLValidatedLedger{history[257], env.journal}, 1));
+
303 trie.insert(RCLValidatedLedger{history[258], env.journal}, 1);
+
304 trie.getPreferred(1);
+
305 // trie.dump(std::cout);
+
306 // 000000[0,1)(T:0,B:5)
+
307 // |-AB868A..37C9[1,260)(T:4,B:4)
+
308 // |-AB868A..36C8[1,3)(T:1,B:1)
+
309 BEAST_EXPECT(trie.tipSupport(ledg_002) == 1);
+
310 BEAST_EXPECT(trie.branchSupport(ledg_002) == 1);
+
311 BEAST_EXPECT(trie.tipSupport(ledg_258) == 0);
+
312 // 258 no longer lives on a tip in the tree, BUT it is an ancestor
+
313 // of 259 which is a tip and therefore gets it's branchSupport value
+
314 // implicitly
+
315 BEAST_EXPECT(trie.branchSupport(ledg_258) == 4);
+
316 BEAST_EXPECT(trie.tipSupport(ledg_259) == 4);
+
317 BEAST_EXPECT(trie.branchSupport(ledg_259) == 4);
+
318 }
+
319
+
320public:
+
321 void
+
322 run() override
+
323 {
+
324 testChangeTrusted();
+
325 testRCLValidatedLedger();
+
326 testLedgerTrieRCLValidatedLedger();
+
327 }
+
328};
+
329
+
330BEAST_DEFINE_TESTSUITE(RCLValidations, app, ripple);
+
331
+
332} // namespace test
+
333} // namespace ripple
std::vector::back
T back(T... args)
std::vector::begin
T begin(T... args)
beast::unit_test::suite
A testsuite class.
Definition: suite.h:55
@@ -434,7 +433,7 @@ $(function() {
ripple::test::RCLValidations_test
Definition: RCLValidations_test.cpp:32
ripple::test::RCLValidations_test::testRCLValidatedLedger
void testRCLValidatedLedger()
Definition: RCLValidations_test.cpp:58
ripple::test::RCLValidations_test::testChangeTrusted
void testChangeTrusted()
Definition: RCLValidations_test.cpp:34
-
ripple::test::RCLValidations_test::run
void run() override
Runs the suite.
Definition: RCLValidations_test.cpp:323
+
ripple::test::RCLValidations_test::run
void run() override
Runs the suite.
Definition: RCLValidations_test.cpp:322
ripple::test::RCLValidations_test::testLedgerTrieRCLValidatedLedger
void testLedgerTrieRCLValidatedLedger()
Definition: RCLValidations_test.cpp:219
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:121
ripple::test::jtx::Env::app
Application & app()
Definition: Env.h:261
@@ -444,7 +443,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::mismatch
RCLValidatedLedger::Seq mismatch(RCLValidatedLedger const &a, RCLValidatedLedger const &b)
Definition: RCLValidations.cpp:99
ripple::KeyType::secp256k1
@ secp256k1
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::create_genesis
create_genesis_t const create_genesis
Definition: Ledger.cpp:51
ripple::randomKeyPair
std::pair< PublicKey, SecretKey > randomKeyPair(KeyType type)
Create a key pair using secure random numbers.
Definition: SecretKey.cpp:386
std::vector::push_back
T push_back(T... args)
diff --git a/RPCCall_8cpp_source.html b/RPCCall_8cpp_source.html index 0c50f31a1a..9f02a47ea6 100644 --- a/RPCCall_8cpp_source.html +++ b/RPCCall_8cpp_source.html @@ -1924,7 +1924,7 @@ $(function() {
ripple::rpcNOT_SYNCED
@ rpcNOT_SYNCED
Definition: ErrorCodes.h:67
ripple::to_uint64
std::optional< std::uint64_t > to_uint64(std::string const &s)
Definition: StringUtilities.cpp:123
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:31
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::isRpcError
bool isRpcError(Json::Value jvResult)
Definition: RPCErr.cpp:40
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::setup_ServerHandler
ServerHandler::Setup setup_ServerHandler(Config const &config, std::ostream &&log)
Definition: ServerHandler.cpp:1256
diff --git a/STTx_8cpp_source.html b/STTx_8cpp_source.html index 4890ccd5ff..9c73d5ad76 100644 --- a/STTx_8cpp_source.html +++ b/STTx_8cpp_source.html @@ -734,12 +734,12 @@ $(function() {
671 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
672 "abcdefghijklmnopqrstuvwxyz");
673
-
674 for (char c : symbols)
+
674 for (unsigned char c : symbols)
675 a[c] = 1;
676 return a;
677 }();
678
-
679 for (auto c : *optData)
+
679 for (unsigned char c : *optData)
680 {
681 if (!allowedSymbols[c])
682 {
@@ -1002,7 +1002,7 @@ $(function() {
ripple::TxType
TxType
Transaction type identifiers.
Definition: TxFormats.h:57
ripple::isPseudoTx
bool isPseudoTx(STObject const &tx)
Check whether a transaction is a pseudo-transaction.
Definition: STTx.cpp:820
ripple::startMultiSigningData
Serializer startMultiSigningData(STObject const &obj)
Break the multi-signing hash computation into 2 parts for optimization.
Definition: Sign.cpp:104
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:558
ripple::isMemoOkay
static bool isMemoOkay(STObject const &st, std::string &reason)
Definition: STTx.cpp:606
ripple::isRawTransactionOkay
static bool isRawTransactionOkay(STObject const &st, std::string &reason)
Definition: STTx.cpp:739
@@ -1012,7 +1012,7 @@ $(function() {
ripple::txMinSizeBytes
std::size_t constexpr txMinSizeBytes
Protocol specific constants.
Definition: Protocol.h:42
ripple::getTxFormat
static auto getTxFormat(TxType type)
Definition: STTx.cpp:76
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::invalidMPTAmountInTx
static bool invalidMPTAmountInTx(STObject const &tx)
Definition: STTx.cpp:711
ripple::sqlBlobLiteral
std::string sqlBlobLiteral(Blob const &blob)
Format arbitrary binary data as an SQLite "blob literal".
Definition: StringUtilities.cpp:42
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
diff --git a/STValidation_8cpp_source.html b/STValidation_8cpp_source.html index c91992a4df..0b76b9c9af 100644 --- a/STValidation_8cpp_source.html +++ b/STValidation_8cpp_source.html @@ -262,8 +262,8 @@ $(function() {
cstddef
std::chrono::duration
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:238
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:239
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::KeyType::secp256k1
@ secp256k1
ripple::vfFullyCanonicalSig
constexpr std::uint32_t vfFullyCanonicalSig
Definition: STValidation.h:42
diff --git a/STValidation_8h_source.html b/STValidation_8h_source.html index ecddc3b5c9..cee08a2355 100644 --- a/STValidation_8h_source.html +++ b/STValidation_8h_source.html @@ -387,7 +387,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::TokenType::NodePublic
@ NodePublic
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::debugLog
beast::Journal debugLog()
Returns a debug journal.
Definition: Log.cpp:468
ripple::KeyType::secp256k1
@ secp256k1
diff --git a/STValidation__test_8cpp_source.html b/STValidation__test_8cpp_source.html index 316586f7df..a14a8f0ff0 100644 --- a/STValidation__test_8cpp_source.html +++ b/STValidation__test_8cpp_source.html @@ -456,7 +456,7 @@ $(function() {
protocol
Definition: ValidatorList.h:38
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
std::vector::push_back
T push_back(T... args)
std::vector::size
T size(T... args)
std::size_t
diff --git a/SecretKey_8cpp_source.html b/SecretKey_8cpp_source.html index 0ce7713bb0..f4b5878581 100644 --- a/SecretKey_8cpp_source.html +++ b/SecretKey_8cpp_source.html @@ -516,7 +516,7 @@ $(function() {
ripple::generateSecretKey
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
Definition: SecretKey.cpp:309
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
ripple::decodeBase58Token
std::string decodeBase58Token(std::string const &s, TokenType type)
Definition: tokens.cpp:209
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::QualityDirection::out
@ out
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::digest
static Hasher::result_type digest(void const *data, std::size_t size) noexcept
Definition: tokens.cpp:156
diff --git a/SecretKey__test_8cpp_source.html b/SecretKey__test_8cpp_source.html index c45e22340b..ae6cd8e245 100644 --- a/SecretKey__test_8cpp_source.html +++ b/SecretKey__test_8cpp_source.html @@ -1623,19 +1623,19 @@ $(function() {
beast::rngfill
void rngfill(void *const buffer, std::size_t const bytes, Generator &g)
Definition: rngfill.h:34
protocol
Definition: ValidatorList.h:38
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::ecdsaCanonicality
std::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determines the canonicality of a signature.
Definition: PublicKey.cpp:129
+
ripple::ecdsaCanonicality
std::optional< ECDSACanonicality > ecdsaCanonicality(Slice const &sig)
Determines the canonicality of a signature.
Definition: PublicKey.cpp:130
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::TokenType::NodePrivate
@ NodePrivate
-
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:238
+
ripple::verifyDigest
bool verifyDigest(PublicKey const &publicKey, uint256 const &digest, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a secp256k1 signature on the digest of a message.
Definition: PublicKey.cpp:239
ripple::ECDSACanonicality::fullyCanonical
@ fullyCanonical
ripple::generateKeyPair
std::pair< PublicKey, SecretKey > generateKeyPair(KeyType type, Seed const &seed)
Generate a key pair deterministically.
Definition: SecretKey.cpp:369
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::calcAccountID
AccountID calcAccountID(PublicKey const &pk)
Definition: AccountID.cpp:168
ripple::crypto_prng
csprng_engine & crypto_prng()
The default cryptographically secure PRNG.
Definition: libxrpl/crypto/csprng.cpp:103
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:331
ripple::generateSecretKey
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
Definition: SecretKey.cpp:309
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::digest
static Hasher::result_type digest(void const *data, std::size_t size) noexcept
Definition: tokens.cpp:156
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::randomSecretKey
SecretKey randomSecretKey()
Create a secret key using secure random numbers.
Definition: SecretKey.cpp:299
diff --git a/Seed__test_8cpp_source.html b/Seed__test_8cpp_source.html index 7415993a04..9b56c319e3 100644 --- a/Seed__test_8cpp_source.html +++ b/Seed__test_8cpp_source.html @@ -470,7 +470,7 @@ $(function() {
ripple::TokenType::AccountPublic
@ AccountPublic
ripple::TokenType::NodePublic
@ NodePublic
ripple::generateKeyPair
std::pair< PublicKey, SecretKey > generateKeyPair(KeyType type, Seed const &seed)
Generate a key pair deterministically.
Definition: SecretKey.cpp:369
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::randomSeed
Seed randomSeed()
Create a seed using secure random numbers.
Definition: Seed.cpp:66
ripple::calcAccountID
AccountID calcAccountID(PublicKey const &pk)
Definition: AccountID.cpp:168
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:331
@@ -479,7 +479,7 @@ $(function() {
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::KeyType::ed25519
@ ed25519
ripple::KeyType::secp256k1
@ secp256k1
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::randomKeyPair
std::pair< PublicKey, SecretKey > randomKeyPair(KeyType type)
Create a key pair using secure random numbers.
Definition: SecretKey.cpp:386
ripple::parseGenericSeed
std::optional< Seed > parseGenericSeed(std::string const &str, bool rfc1751=true)
Attempt to parse a string as a seed.
Definition: Seed.cpp:97
diff --git a/SetAccount_8cpp_source.html b/SetAccount_8cpp_source.html index fea34b9a5b..a91c76a0aa 100644 --- a/SetAccount_8cpp_source.html +++ b/SetAccount_8cpp_source.html @@ -824,7 +824,7 @@ $(function() {
ripple::asfDisableMaster
constexpr std::uint32_t asfDisableMaster
Definition: TxFlags.h:80
ripple::asfDisallowIncomingTrustline
constexpr std::uint32_t asfDisallowIncomingTrustline
Definition: TxFlags.h:93
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::loadGranularPermission
void loadGranularPermission(std::shared_ptr< SLE const > const &delegate, TxType const &type, std::unordered_set< GranularPermissionType > &granularPermissions)
Load the granular permissions granted to the delegate account for the specified transaction type.
Definition: DelegateUtils.cpp:45
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::asfAccountTxnID
constexpr std::uint32_t asfAccountTxnID
Definition: TxFlags.h:81
diff --git a/SetRegularKey_8cpp_source.html b/SetRegularKey_8cpp_source.html index 8181b70927..e403ab62e8 100644 --- a/SetRegularKey_8cpp_source.html +++ b/SetRegularKey_8cpp_source.html @@ -216,7 +216,7 @@ $(function() {
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::calcAccountID
AccountID calcAccountID(PublicKey const &pk)
Definition: AccountID.cpp:168
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::tecNO_ALTERNATIVE_KEY
@ tecNO_ALTERNATIVE_KEY
Definition: TER.h:296
diff --git a/Sign_8cpp_source.html b/Sign_8cpp_source.html index 78ec0fcc6e..d58f457618 100644 --- a/Sign_8cpp_source.html +++ b/Sign_8cpp_source.html @@ -202,7 +202,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::finishMultiSigningData
void finishMultiSigningData(AccountID const &signingID, Serializer &s)
Definition: Sign.h:84
ripple::startMultiSigningData
Serializer startMultiSigningData(STObject const &obj)
Break the multi-signing hash computation into 2 parts for optimization.
Definition: Sign.cpp:104
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::buildMultiSigningData
Serializer buildMultiSigningData(STObject const &obj, AccountID const &signingID)
Return a Serializer suitable for computing a multisigning TxnSignature.
Definition: Sign.cpp:96
ripple::set
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
Definition: BasicConfig.h:315
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
diff --git a/Sign_8h_source.html b/Sign_8h_source.html index b435c1091d..26f06b9a8b 100644 --- a/Sign_8h_source.html +++ b/Sign_8h_source.html @@ -143,7 +143,7 @@ $(function() {
ripple::SF_VL
TypedField< STBlob > SF_VL
Definition: SField.h:360
ripple::finishMultiSigningData
void finishMultiSigningData(AccountID const &signingID, Serializer &s)
Definition: Sign.h:84
ripple::startMultiSigningData
Serializer startMultiSigningData(STObject const &obj)
Break the multi-signing hash computation into 2 parts for optimization.
Definition: Sign.cpp:104
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::buildMultiSigningData
Serializer buildMultiSigningData(STObject const &obj, AccountID const &signingID)
Return a Serializer suitable for computing a multisigning TxnSignature.
Definition: Sign.cpp:96
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
ripple::KeyType
KeyType
Definition: KeyType.h:28
diff --git a/TransactionSign_8cpp_source.html b/TransactionSign_8cpp_source.html index 6d05c4c12a..24fb4c2a15 100644 --- a/TransactionSign_8cpp_source.html +++ b/TransactionSign_8cpp_source.html @@ -1642,7 +1642,7 @@ $(function() {
ripple::rpcHIGH_FEE
@ rpcHIGH_FEE
Definition: ErrorCodes.h:58
ripple::rpcNOT_SYNCED
@ rpcNOT_SYNCED
Definition: ErrorCodes.h:67
ripple::rpcSRC_ACT_MISSING
@ rpcSRC_ACT_MISSING
Definition: ErrorCodes.h:121
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::buildMultiSigningData
Serializer buildMultiSigningData(STObject const &obj, AccountID const &signingID)
Return a Serializer suitable for computing a multisigning TxnSignature.
Definition: Sign.cpp:96
ripple::calculateBaseFee
XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Compute only the expected base fee for a transaction.
Definition: applySteps.cpp:427
ripple::isLegalNet
bool isLegalNet(STAmount const &value)
Definition: STAmount.h:600
diff --git a/Transactor_8cpp_source.html b/Transactor_8cpp_source.html index ea8fdb24bf..1727bac04e 100644 --- a/Transactor_8cpp_source.html +++ b/Transactor_8cpp_source.html @@ -1493,7 +1493,7 @@ $(function() {
ripple::tefMASTER_DISABLED
@ tefMASTER_DISABLED
Definition: TER.h:177
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::ConsensusPhase::open
@ open
We haven't closed our ledger yet, but others might have.
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::removeExpiredCredentials
static void removeExpiredCredentials(ApplyView &view, std::vector< uint256 > const &creds, beast::Journal viewJ)
Definition: Transactor.cpp:955
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
ripple::transToken
std::string transToken(TER code)
Definition: TER.cpp:264
diff --git a/TrustedPublisherServer_8h_source.html b/TrustedPublisherServer_8h_source.html index 6befdc5f6f..c5b4eec970 100644 --- a/TrustedPublisherServer_8h_source.html +++ b/TrustedPublisherServer_8h_source.html @@ -878,7 +878,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::sfGeneric
SField const sfGeneric
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:331
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::from_string
bool from_string(RangeSet< T > &rs, std::string const &s)
Convert the given styled string to a RangeSet.
Definition: RangeSet.h:124
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
diff --git a/Validations__test_8cpp_source.html b/Validations__test_8cpp_source.html index 838eddc5e8..5cee1b49f8 100644 --- a/Validations__test_8cpp_source.html +++ b/Validations__test_8cpp_source.html @@ -883,350 +883,349 @@ $(function() {
805 Ledger ledgerACD = h["acd"];
806
807 using Seq = Ledger::Seq;
-
808 using ID = Ledger::ID;
-
809
-
810 auto pref = [](Ledger ledger) {
-
811 return std::make_pair(ledger.seq(), ledger.id());
-
812 };
-
813
-
814 // Empty (no ledgers)
-
815 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == std::nullopt);
-
816
-
817 // Single ledger
-
818 BEAST_EXPECT(ValStatus::current == harness.add(a.validate(ledgerB)));
-
819 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == pref(ledgerB));
-
820 BEAST_EXPECT(harness.vals().getPreferred(ledgerB) == pref(ledgerB));
-
821
-
822 // Minimum valid sequence
-
823 BEAST_EXPECT(
-
824 harness.vals().getPreferred(ledgerA, Seq{10}) == ledgerA.id());
-
825
-
826 // Untrusted doesn't impact preferred ledger
-
827 // (ledgerB has tie-break over ledgerA)
-
828 BEAST_EXPECT(ValStatus::current == harness.add(b.validate(ledgerA)));
-
829 BEAST_EXPECT(ValStatus::current == harness.add(c.validate(ledgerA)));
-
830 BEAST_EXPECT(ledgerB.id() > ledgerA.id());
-
831 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == pref(ledgerB));
-
832 BEAST_EXPECT(harness.vals().getPreferred(ledgerB) == pref(ledgerB));
-
833
-
834 // Partial does break ties
-
835 BEAST_EXPECT(ValStatus::current == harness.add(d.partial(ledgerA)));
-
836 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == pref(ledgerA));
-
837 BEAST_EXPECT(harness.vals().getPreferred(ledgerB) == pref(ledgerA));
-
838
-
839 harness.clock().advance(5s);
-
840
-
841 // Parent of preferred-> stick with ledger
-
842 for (auto const& node : {a, b, c, d})
-
843 BEAST_EXPECT(
-
844 ValStatus::current == harness.add(node.validate(ledgerAC)));
-
845 // Parent of preferred stays put
-
846 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == pref(ledgerA));
-
847 // Earlier different chain, switch
-
848 BEAST_EXPECT(harness.vals().getPreferred(ledgerB) == pref(ledgerAC));
-
849 // Later on chain, stays where it is
-
850 BEAST_EXPECT(harness.vals().getPreferred(ledgerACD) == pref(ledgerACD));
-
851
-
852 // Any later grandchild or different chain is preferred
-
853 harness.clock().advance(5s);
-
854 for (auto const& node : {a, b, c, d})
-
855 BEAST_EXPECT(
-
856 ValStatus::current == harness.add(node.validate(ledgerACD)));
-
857 for (auto const& ledger : {ledgerA, ledgerB, ledgerACD})
-
858 BEAST_EXPECT(
-
859 harness.vals().getPreferred(ledger) == pref(ledgerACD));
-
860 }
-
861
-
862 void
-
863 testGetPreferredLCL()
-
864 {
-
865 using namespace std::chrono_literals;
-
866 testcase("Get preferred LCL");
-
867
-
868 LedgerHistoryHelper h;
-
869 TestHarness harness(h.oracle);
-
870 Node a = harness.makeNode();
-
871
-
872 Ledger ledgerA = h["a"];
-
873 Ledger ledgerB = h["b"];
-
874 Ledger ledgerC = h["c"];
-
875
-
876 using ID = Ledger::ID;
-
877 using Seq = Ledger::Seq;
-
878
-
879 hash_map<ID, std::uint32_t> peerCounts;
-
880
-
881 // No trusted validations or counts sticks with current ledger
-
882 BEAST_EXPECT(
-
883 harness.vals().getPreferredLCL(ledgerA, Seq{0}, peerCounts) ==
-
884 ledgerA.id());
-
885
-
886 ++peerCounts[ledgerB.id()];
-
887
-
888 // No trusted validations, rely on peer counts
-
889 BEAST_EXPECT(
-
890 harness.vals().getPreferredLCL(ledgerA, Seq{0}, peerCounts) ==
-
891 ledgerB.id());
-
892
-
893 ++peerCounts[ledgerC.id()];
-
894 // No trusted validations, tied peers goes with larger ID
-
895 BEAST_EXPECT(ledgerC.id() > ledgerB.id());
-
896
-
897 BEAST_EXPECT(
-
898 harness.vals().getPreferredLCL(ledgerA, Seq{0}, peerCounts) ==
-
899 ledgerC.id());
-
900
-
901 peerCounts[ledgerC.id()] += 1000;
-
902
-
903 // Single trusted always wins over peer counts
-
904 BEAST_EXPECT(ValStatus::current == harness.add(a.validate(ledgerA)));
-
905 BEAST_EXPECT(
-
906 harness.vals().getPreferredLCL(ledgerA, Seq{0}, peerCounts) ==
-
907 ledgerA.id());
-
908 BEAST_EXPECT(
-
909 harness.vals().getPreferredLCL(ledgerB, Seq{0}, peerCounts) ==
-
910 ledgerA.id());
-
911 BEAST_EXPECT(
-
912 harness.vals().getPreferredLCL(ledgerC, Seq{0}, peerCounts) ==
-
913 ledgerA.id());
-
914
-
915 // Stick with current ledger if trusted validation ledger has too old
-
916 // of a sequence
-
917 BEAST_EXPECT(
-
918 harness.vals().getPreferredLCL(ledgerB, Seq{2}, peerCounts) ==
-
919 ledgerB.id());
-
920 }
-
921
-
922 void
-
923 testAcquireValidatedLedger()
-
924 {
-
925 using namespace std::chrono_literals;
-
926 testcase("Acquire validated ledger");
-
927
-
928 LedgerHistoryHelper h;
-
929 TestHarness harness(h.oracle);
-
930 Node a = harness.makeNode();
-
931 Node b = harness.makeNode();
-
932
-
933 using ID = Ledger::ID;
-
934 using Seq = Ledger::Seq;
-
935
-
936 // Validate the ledger before it is actually available
-
937 Validation val = a.validate(ID{2}, Seq{2}, 0s, 0s, true);
-
938
-
939 BEAST_EXPECT(ValStatus::current == harness.add(val));
-
940 // Validation is available
-
941 BEAST_EXPECT(harness.vals().numTrustedForLedger(ID{2}) == 1);
-
942 // but ledger based data is not
-
943 BEAST_EXPECT(harness.vals().getNodesAfter(genesisLedger, ID{0}) == 0);
-
944 // Initial preferred branch falls back to the ledger we are trying to
-
945 // acquire
-
946 BEAST_EXPECT(
-
947 harness.vals().getPreferred(genesisLedger) ==
-
948 std::make_pair(Seq{2}, ID{2}));
-
949
-
950 // After adding another unavailable validation, the preferred ledger
-
951 // breaks ties via higher ID
-
952 BEAST_EXPECT(
-
953 ValStatus::current ==
-
954 harness.add(b.validate(ID{3}, Seq{2}, 0s, 0s, true)));
-
955 BEAST_EXPECT(
-
956 harness.vals().getPreferred(genesisLedger) ==
-
957 std::make_pair(Seq{2}, ID{3}));
-
958
-
959 // Create the ledger
-
960 Ledger ledgerAB = h["ab"];
-
961 // Now it should be available
-
962 BEAST_EXPECT(harness.vals().getNodesAfter(genesisLedger, ID{0}) == 1);
-
963
-
964 // Create a validation that is not available
-
965 harness.clock().advance(5s);
-
966 Validation val2 = a.validate(ID{4}, Seq{4}, 0s, 0s, true);
-
967 BEAST_EXPECT(ValStatus::current == harness.add(val2));
-
968 BEAST_EXPECT(harness.vals().numTrustedForLedger(ID{4}) == 1);
-
969 BEAST_EXPECT(
-
970 harness.vals().getPreferred(genesisLedger) ==
-
971 std::make_pair(ledgerAB.seq(), ledgerAB.id()));
-
972
-
973 // Another node requesting that ledger still doesn't change things
-
974 Validation val3 = b.validate(ID{4}, Seq{4}, 0s, 0s, true);
-
975 BEAST_EXPECT(ValStatus::current == harness.add(val3));
-
976 BEAST_EXPECT(harness.vals().numTrustedForLedger(ID{4}) == 2);
-
977 BEAST_EXPECT(
-
978 harness.vals().getPreferred(genesisLedger) ==
-
979 std::make_pair(ledgerAB.seq(), ledgerAB.id()));
-
980
-
981 // Switch to validation that is available
-
982 harness.clock().advance(5s);
-
983 Ledger ledgerABCDE = h["abcde"];
-
984 BEAST_EXPECT(ValStatus::current == harness.add(a.partial(ledgerABCDE)));
-
985 BEAST_EXPECT(ValStatus::current == harness.add(b.partial(ledgerABCDE)));
-
986 BEAST_EXPECT(
-
987 harness.vals().getPreferred(genesisLedger) ==
-
988 std::make_pair(ledgerABCDE.seq(), ledgerABCDE.id()));
-
989 }
-
990
-
991 void
-
992 testNumTrustedForLedger()
-
993 {
-
994 testcase("NumTrustedForLedger");
-
995 LedgerHistoryHelper h;
-
996 TestHarness harness(h.oracle);
-
997 Node a = harness.makeNode();
-
998 Node b = harness.makeNode();
-
999 Ledger ledgerA = h["a"];
-
1000
-
1001 BEAST_EXPECT(ValStatus::current == harness.add(a.partial(ledgerA)));
-
1002 BEAST_EXPECT(harness.vals().numTrustedForLedger(ledgerA.id()) == 0);
-
1003
-
1004 BEAST_EXPECT(ValStatus::current == harness.add(b.validate(ledgerA)));
-
1005 BEAST_EXPECT(harness.vals().numTrustedForLedger(ledgerA.id()) == 1);
-
1006 }
-
1007
-
1008 void
-
1009 testSeqEnforcer()
-
1010 {
-
1011 testcase("SeqEnforcer");
-
1012 using Seq = Ledger::Seq;
-
1013 using namespace std::chrono;
-
1014
-
1015 beast::manual_clock<steady_clock> clock;
-
1016 SeqEnforcer<Seq> enforcer;
-
1017
-
1018 ValidationParms p;
-
1019
-
1020 BEAST_EXPECT(enforcer(clock.now(), Seq{1}, p));
-
1021 BEAST_EXPECT(enforcer(clock.now(), Seq{10}, p));
-
1022 BEAST_EXPECT(!enforcer(clock.now(), Seq{5}, p));
-
1023 BEAST_EXPECT(!enforcer(clock.now(), Seq{9}, p));
-
1024 clock.advance(p.validationSET_EXPIRES - 1ms);
-
1025 BEAST_EXPECT(!enforcer(clock.now(), Seq{1}, p));
-
1026 clock.advance(2ms);
-
1027 BEAST_EXPECT(enforcer(clock.now(), Seq{1}, p));
-
1028 }
-
1029
-
1030 void
-
1031 testTrustChanged()
-
1032 {
-
1033 testcase("TrustChanged");
-
1034 using namespace std::chrono;
-
1035
-
1036 auto checker = [this](
-
1037 TestValidations& vals,
-
1038 hash_set<PeerID> const& listed,
-
1039 std::vector<Validation> const& trustedVals) {
-
1040 Ledger::ID testID = trustedVals.empty() ? this->genesisLedger.id()
-
1041 : trustedVals[0].ledgerID();
-
1042 Ledger::Seq testSeq = trustedVals.empty()
-
1043 ? this->genesisLedger.seq()
-
1044 : trustedVals[0].seq();
-
1045 BEAST_EXPECT(vals.currentTrusted() == trustedVals);
-
1046 BEAST_EXPECT(vals.getCurrentNodeIDs() == listed);
-
1047 BEAST_EXPECT(
-
1048 vals.getNodesAfter(this->genesisLedger, genesisLedger.id()) ==
-
1049 trustedVals.size());
-
1050 if (trustedVals.empty())
-
1051 BEAST_EXPECT(
-
1052 vals.getPreferred(this->genesisLedger) == std::nullopt);
-
1053 else
-
1054 BEAST_EXPECT(
-
1055 vals.getPreferred(this->genesisLedger)->second == testID);
-
1056 BEAST_EXPECT(
-
1057 vals.getTrustedForLedger(testID, testSeq) == trustedVals);
-
1058 BEAST_EXPECT(
-
1059 vals.numTrustedForLedger(testID) == trustedVals.size());
-
1060 };
-
1061
-
1062 {
-
1063 // Trusted to untrusted
-
1064 LedgerHistoryHelper h;
-
1065 TestHarness harness(h.oracle);
-
1066 Node a = harness.makeNode();
-
1067 Ledger ledgerAB = h["ab"];
-
1068 Validation v = a.validate(ledgerAB);
-
1069 BEAST_EXPECT(ValStatus::current == harness.add(v));
-
1070
-
1071 hash_set<PeerID> listed({a.nodeID()});
-
1072 std::vector<Validation> trustedVals({v});
-
1073 checker(harness.vals(), listed, trustedVals);
-
1074
-
1075 trustedVals.clear();
-
1076 harness.vals().trustChanged({}, {a.nodeID()});
-
1077 checker(harness.vals(), listed, trustedVals);
-
1078 }
-
1079
-
1080 {
-
1081 // Untrusted to trusted
-
1082 LedgerHistoryHelper h;
-
1083 TestHarness harness(h.oracle);
-
1084 Node a = harness.makeNode();
-
1085 a.untrust();
-
1086 Ledger ledgerAB = h["ab"];
-
1087 Validation v = a.validate(ledgerAB);
-
1088 BEAST_EXPECT(ValStatus::current == harness.add(v));
-
1089
-
1090 hash_set<PeerID> listed({a.nodeID()});
-
1091 std::vector<Validation> trustedVals;
-
1092 checker(harness.vals(), listed, trustedVals);
-
1093
-
1094 trustedVals.push_back(v);
-
1095 harness.vals().trustChanged({a.nodeID()}, {});
-
1096 checker(harness.vals(), listed, trustedVals);
-
1097 }
-
1098
-
1099 {
-
1100 // Trusted but not acquired -> untrusted
-
1101 LedgerHistoryHelper h;
-
1102 TestHarness harness(h.oracle);
-
1103 Node a = harness.makeNode();
-
1104 Validation v =
-
1105 a.validate(Ledger::ID{2}, Ledger::Seq{2}, 0s, 0s, true);
-
1106 BEAST_EXPECT(ValStatus::current == harness.add(v));
-
1107
-
1108 hash_set<PeerID> listed({a.nodeID()});
-
1109 std::vector<Validation> trustedVals({v});
-
1110 auto& vals = harness.vals();
-
1111 BEAST_EXPECT(vals.currentTrusted() == trustedVals);
-
1112 BEAST_EXPECT(
-
1113 vals.getPreferred(genesisLedger)->second == v.ledgerID());
-
1114 BEAST_EXPECT(
-
1115 vals.getNodesAfter(genesisLedger, genesisLedger.id()) == 0);
-
1116
-
1117 trustedVals.clear();
-
1118 harness.vals().trustChanged({}, {a.nodeID()});
-
1119 // make acquiring ledger available
-
1120 h["ab"];
-
1121 BEAST_EXPECT(vals.currentTrusted() == trustedVals);
-
1122 BEAST_EXPECT(vals.getPreferred(genesisLedger) == std::nullopt);
-
1123 BEAST_EXPECT(
-
1124 vals.getNodesAfter(genesisLedger, genesisLedger.id()) == 0);
-
1125 }
-
1126 }
-
1127
-
1128 void
-
1129 run() override
-
1130 {
-
1131 testAddValidation();
-
1132 testOnStale();
-
1133 testGetNodesAfter();
-
1134 testCurrentTrusted();
-
1135 testGetCurrentPublicKeys();
-
1136 testTrustedByLedgerFunctions();
-
1137 testExpire();
-
1138 testFlush();
-
1139 testGetPreferredLedger();
-
1140 testGetPreferredLCL();
-
1141 testAcquireValidatedLedger();
-
1142 testNumTrustedForLedger();
-
1143 testSeqEnforcer();
-
1144 testTrustChanged();
-
1145 }
-
1146};
-
1147
-
1148BEAST_DEFINE_TESTSUITE(Validations, consensus, ripple);
-
1149} // namespace csf
-
1150} // namespace test
-
1151} // namespace ripple
+
808
+
809 auto pref = [](Ledger ledger) {
+
810 return std::make_pair(ledger.seq(), ledger.id());
+
811 };
+
812
+
813 // Empty (no ledgers)
+
814 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == std::nullopt);
+
815
+
816 // Single ledger
+
817 BEAST_EXPECT(ValStatus::current == harness.add(a.validate(ledgerB)));
+
818 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == pref(ledgerB));
+
819 BEAST_EXPECT(harness.vals().getPreferred(ledgerB) == pref(ledgerB));
+
820
+
821 // Minimum valid sequence
+
822 BEAST_EXPECT(
+
823 harness.vals().getPreferred(ledgerA, Seq{10}) == ledgerA.id());
+
824
+
825 // Untrusted doesn't impact preferred ledger
+
826 // (ledgerB has tie-break over ledgerA)
+
827 BEAST_EXPECT(ValStatus::current == harness.add(b.validate(ledgerA)));
+
828 BEAST_EXPECT(ValStatus::current == harness.add(c.validate(ledgerA)));
+
829 BEAST_EXPECT(ledgerB.id() > ledgerA.id());
+
830 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == pref(ledgerB));
+
831 BEAST_EXPECT(harness.vals().getPreferred(ledgerB) == pref(ledgerB));
+
832
+
833 // Partial does break ties
+
834 BEAST_EXPECT(ValStatus::current == harness.add(d.partial(ledgerA)));
+
835 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == pref(ledgerA));
+
836 BEAST_EXPECT(harness.vals().getPreferred(ledgerB) == pref(ledgerA));
+
837
+
838 harness.clock().advance(5s);
+
839
+
840 // Parent of preferred-> stick with ledger
+
841 for (auto const& node : {a, b, c, d})
+
842 BEAST_EXPECT(
+
843 ValStatus::current == harness.add(node.validate(ledgerAC)));
+
844 // Parent of preferred stays put
+
845 BEAST_EXPECT(harness.vals().getPreferred(ledgerA) == pref(ledgerA));
+
846 // Earlier different chain, switch
+
847 BEAST_EXPECT(harness.vals().getPreferred(ledgerB) == pref(ledgerAC));
+
848 // Later on chain, stays where it is
+
849 BEAST_EXPECT(harness.vals().getPreferred(ledgerACD) == pref(ledgerACD));
+
850
+
851 // Any later grandchild or different chain is preferred
+
852 harness.clock().advance(5s);
+
853 for (auto const& node : {a, b, c, d})
+
854 BEAST_EXPECT(
+
855 ValStatus::current == harness.add(node.validate(ledgerACD)));
+
856 for (auto const& ledger : {ledgerA, ledgerB, ledgerACD})
+
857 BEAST_EXPECT(
+
858 harness.vals().getPreferred(ledger) == pref(ledgerACD));
+
859 }
+
860
+
861 void
+
862 testGetPreferredLCL()
+
863 {
+
864 using namespace std::chrono_literals;
+
865 testcase("Get preferred LCL");
+
866
+
867 LedgerHistoryHelper h;
+
868 TestHarness harness(h.oracle);
+
869 Node a = harness.makeNode();
+
870
+
871 Ledger ledgerA = h["a"];
+
872 Ledger ledgerB = h["b"];
+
873 Ledger ledgerC = h["c"];
+
874
+
875 using ID = Ledger::ID;
+
876 using Seq = Ledger::Seq;
+
877
+
878 hash_map<ID, std::uint32_t> peerCounts;
+
879
+
880 // No trusted validations or counts sticks with current ledger
+
881 BEAST_EXPECT(
+
882 harness.vals().getPreferredLCL(ledgerA, Seq{0}, peerCounts) ==
+
883 ledgerA.id());
+
884
+
885 ++peerCounts[ledgerB.id()];
+
886
+
887 // No trusted validations, rely on peer counts
+
888 BEAST_EXPECT(
+
889 harness.vals().getPreferredLCL(ledgerA, Seq{0}, peerCounts) ==
+
890 ledgerB.id());
+
891
+
892 ++peerCounts[ledgerC.id()];
+
893 // No trusted validations, tied peers goes with larger ID
+
894 BEAST_EXPECT(ledgerC.id() > ledgerB.id());
+
895
+
896 BEAST_EXPECT(
+
897 harness.vals().getPreferredLCL(ledgerA, Seq{0}, peerCounts) ==
+
898 ledgerC.id());
+
899
+
900 peerCounts[ledgerC.id()] += 1000;
+
901
+
902 // Single trusted always wins over peer counts
+
903 BEAST_EXPECT(ValStatus::current == harness.add(a.validate(ledgerA)));
+
904 BEAST_EXPECT(
+
905 harness.vals().getPreferredLCL(ledgerA, Seq{0}, peerCounts) ==
+
906 ledgerA.id());
+
907 BEAST_EXPECT(
+
908 harness.vals().getPreferredLCL(ledgerB, Seq{0}, peerCounts) ==
+
909 ledgerA.id());
+
910 BEAST_EXPECT(
+
911 harness.vals().getPreferredLCL(ledgerC, Seq{0}, peerCounts) ==
+
912 ledgerA.id());
+
913
+
914 // Stick with current ledger if trusted validation ledger has too old
+
915 // of a sequence
+
916 BEAST_EXPECT(
+
917 harness.vals().getPreferredLCL(ledgerB, Seq{2}, peerCounts) ==
+
918 ledgerB.id());
+
919 }
+
920
+
921 void
+
922 testAcquireValidatedLedger()
+
923 {
+
924 using namespace std::chrono_literals;
+
925 testcase("Acquire validated ledger");
+
926
+
927 LedgerHistoryHelper h;
+
928 TestHarness harness(h.oracle);
+
929 Node a = harness.makeNode();
+
930 Node b = harness.makeNode();
+
931
+
932 using ID = Ledger::ID;
+
933 using Seq = Ledger::Seq;
+
934
+
935 // Validate the ledger before it is actually available
+
936 Validation val = a.validate(ID{2}, Seq{2}, 0s, 0s, true);
+
937
+
938 BEAST_EXPECT(ValStatus::current == harness.add(val));
+
939 // Validation is available
+
940 BEAST_EXPECT(harness.vals().numTrustedForLedger(ID{2}) == 1);
+
941 // but ledger based data is not
+
942 BEAST_EXPECT(harness.vals().getNodesAfter(genesisLedger, ID{0}) == 0);
+
943 // Initial preferred branch falls back to the ledger we are trying to
+
944 // acquire
+
945 BEAST_EXPECT(
+
946 harness.vals().getPreferred(genesisLedger) ==
+
947 std::make_pair(Seq{2}, ID{2}));
+
948
+
949 // After adding another unavailable validation, the preferred ledger
+
950 // breaks ties via higher ID
+
951 BEAST_EXPECT(
+
952 ValStatus::current ==
+
953 harness.add(b.validate(ID{3}, Seq{2}, 0s, 0s, true)));
+
954 BEAST_EXPECT(
+
955 harness.vals().getPreferred(genesisLedger) ==
+
956 std::make_pair(Seq{2}, ID{3}));
+
957
+
958 // Create the ledger
+
959 Ledger ledgerAB = h["ab"];
+
960 // Now it should be available
+
961 BEAST_EXPECT(harness.vals().getNodesAfter(genesisLedger, ID{0}) == 1);
+
962
+
963 // Create a validation that is not available
+
964 harness.clock().advance(5s);
+
965 Validation val2 = a.validate(ID{4}, Seq{4}, 0s, 0s, true);
+
966 BEAST_EXPECT(ValStatus::current == harness.add(val2));
+
967 BEAST_EXPECT(harness.vals().numTrustedForLedger(ID{4}) == 1);
+
968 BEAST_EXPECT(
+
969 harness.vals().getPreferred(genesisLedger) ==
+
970 std::make_pair(ledgerAB.seq(), ledgerAB.id()));
+
971
+
972 // Another node requesting that ledger still doesn't change things
+
973 Validation val3 = b.validate(ID{4}, Seq{4}, 0s, 0s, true);
+
974 BEAST_EXPECT(ValStatus::current == harness.add(val3));
+
975 BEAST_EXPECT(harness.vals().numTrustedForLedger(ID{4}) == 2);
+
976 BEAST_EXPECT(
+
977 harness.vals().getPreferred(genesisLedger) ==
+
978 std::make_pair(ledgerAB.seq(), ledgerAB.id()));
+
979
+
980 // Switch to validation that is available
+
981 harness.clock().advance(5s);
+
982 Ledger ledgerABCDE = h["abcde"];
+
983 BEAST_EXPECT(ValStatus::current == harness.add(a.partial(ledgerABCDE)));
+
984 BEAST_EXPECT(ValStatus::current == harness.add(b.partial(ledgerABCDE)));
+
985 BEAST_EXPECT(
+
986 harness.vals().getPreferred(genesisLedger) ==
+
987 std::make_pair(ledgerABCDE.seq(), ledgerABCDE.id()));
+
988 }
+
989
+
990 void
+
991 testNumTrustedForLedger()
+
992 {
+
993 testcase("NumTrustedForLedger");
+
994 LedgerHistoryHelper h;
+
995 TestHarness harness(h.oracle);
+
996 Node a = harness.makeNode();
+
997 Node b = harness.makeNode();
+
998 Ledger ledgerA = h["a"];
+
999
+
1000 BEAST_EXPECT(ValStatus::current == harness.add(a.partial(ledgerA)));
+
1001 BEAST_EXPECT(harness.vals().numTrustedForLedger(ledgerA.id()) == 0);
+
1002
+
1003 BEAST_EXPECT(ValStatus::current == harness.add(b.validate(ledgerA)));
+
1004 BEAST_EXPECT(harness.vals().numTrustedForLedger(ledgerA.id()) == 1);
+
1005 }
+
1006
+
1007 void
+
1008 testSeqEnforcer()
+
1009 {
+
1010 testcase("SeqEnforcer");
+
1011 using Seq = Ledger::Seq;
+
1012 using namespace std::chrono;
+
1013
+
1014 beast::manual_clock<steady_clock> clock;
+
1015 SeqEnforcer<Seq> enforcer;
+
1016
+
1017 ValidationParms p;
+
1018
+
1019 BEAST_EXPECT(enforcer(clock.now(), Seq{1}, p));
+
1020 BEAST_EXPECT(enforcer(clock.now(), Seq{10}, p));
+
1021 BEAST_EXPECT(!enforcer(clock.now(), Seq{5}, p));
+
1022 BEAST_EXPECT(!enforcer(clock.now(), Seq{9}, p));
+
1023 clock.advance(p.validationSET_EXPIRES - 1ms);
+
1024 BEAST_EXPECT(!enforcer(clock.now(), Seq{1}, p));
+
1025 clock.advance(2ms);
+
1026 BEAST_EXPECT(enforcer(clock.now(), Seq{1}, p));
+
1027 }
+
1028
+
1029 void
+
1030 testTrustChanged()
+
1031 {
+
1032 testcase("TrustChanged");
+
1033 using namespace std::chrono;
+
1034
+
1035 auto checker = [this](
+
1036 TestValidations& vals,
+
1037 hash_set<PeerID> const& listed,
+
1038 std::vector<Validation> const& trustedVals) {
+
1039 Ledger::ID testID = trustedVals.empty() ? this->genesisLedger.id()
+
1040 : trustedVals[0].ledgerID();
+
1041 Ledger::Seq testSeq = trustedVals.empty()
+
1042 ? this->genesisLedger.seq()
+
1043 : trustedVals[0].seq();
+
1044 BEAST_EXPECT(vals.currentTrusted() == trustedVals);
+
1045 BEAST_EXPECT(vals.getCurrentNodeIDs() == listed);
+
1046 BEAST_EXPECT(
+
1047 vals.getNodesAfter(this->genesisLedger, genesisLedger.id()) ==
+
1048 trustedVals.size());
+
1049 if (trustedVals.empty())
+
1050 BEAST_EXPECT(
+
1051 vals.getPreferred(this->genesisLedger) == std::nullopt);
+
1052 else
+
1053 BEAST_EXPECT(
+
1054 vals.getPreferred(this->genesisLedger)->second == testID);
+
1055 BEAST_EXPECT(
+
1056 vals.getTrustedForLedger(testID, testSeq) == trustedVals);
+
1057 BEAST_EXPECT(
+
1058 vals.numTrustedForLedger(testID) == trustedVals.size());
+
1059 };
+
1060
+
1061 {
+
1062 // Trusted to untrusted
+
1063 LedgerHistoryHelper h;
+
1064 TestHarness harness(h.oracle);
+
1065 Node a = harness.makeNode();
+
1066 Ledger ledgerAB = h["ab"];
+
1067 Validation v = a.validate(ledgerAB);
+
1068 BEAST_EXPECT(ValStatus::current == harness.add(v));
+
1069
+
1070 hash_set<PeerID> listed({a.nodeID()});
+
1071 std::vector<Validation> trustedVals({v});
+
1072 checker(harness.vals(), listed, trustedVals);
+
1073
+
1074 trustedVals.clear();
+
1075 harness.vals().trustChanged({}, {a.nodeID()});
+
1076 checker(harness.vals(), listed, trustedVals);
+
1077 }
+
1078
+
1079 {
+
1080 // Untrusted to trusted
+
1081 LedgerHistoryHelper h;
+
1082 TestHarness harness(h.oracle);
+
1083 Node a = harness.makeNode();
+
1084 a.untrust();
+
1085 Ledger ledgerAB = h["ab"];
+
1086 Validation v = a.validate(ledgerAB);
+
1087 BEAST_EXPECT(ValStatus::current == harness.add(v));
+
1088
+
1089 hash_set<PeerID> listed({a.nodeID()});
+
1090 std::vector<Validation> trustedVals;
+
1091 checker(harness.vals(), listed, trustedVals);
+
1092
+
1093 trustedVals.push_back(v);
+
1094 harness.vals().trustChanged({a.nodeID()}, {});
+
1095 checker(harness.vals(), listed, trustedVals);
+
1096 }
+
1097
+
1098 {
+
1099 // Trusted but not acquired -> untrusted
+
1100 LedgerHistoryHelper h;
+
1101 TestHarness harness(h.oracle);
+
1102 Node a = harness.makeNode();
+
1103 Validation v =
+
1104 a.validate(Ledger::ID{2}, Ledger::Seq{2}, 0s, 0s, true);
+
1105 BEAST_EXPECT(ValStatus::current == harness.add(v));
+
1106
+
1107 hash_set<PeerID> listed({a.nodeID()});
+
1108 std::vector<Validation> trustedVals({v});
+
1109 auto& vals = harness.vals();
+
1110 BEAST_EXPECT(vals.currentTrusted() == trustedVals);
+
1111 BEAST_EXPECT(
+
1112 vals.getPreferred(genesisLedger)->second == v.ledgerID());
+
1113 BEAST_EXPECT(
+
1114 vals.getNodesAfter(genesisLedger, genesisLedger.id()) == 0);
+
1115
+
1116 trustedVals.clear();
+
1117 harness.vals().trustChanged({}, {a.nodeID()});
+
1118 // make acquiring ledger available
+
1119 h["ab"];
+
1120 BEAST_EXPECT(vals.currentTrusted() == trustedVals);
+
1121 BEAST_EXPECT(vals.getPreferred(genesisLedger) == std::nullopt);
+
1122 BEAST_EXPECT(
+
1123 vals.getNodesAfter(genesisLedger, genesisLedger.id()) == 0);
+
1124 }
+
1125 }
+
1126
+
1127 void
+
1128 run() override
+
1129 {
+
1130 testAddValidation();
+
1131 testOnStale();
+
1132 testGetNodesAfter();
+
1133 testCurrentTrusted();
+
1134 testGetCurrentPublicKeys();
+
1135 testTrustedByLedgerFunctions();
+
1136 testExpire();
+
1137 testFlush();
+
1138 testGetPreferredLedger();
+
1139 testGetPreferredLCL();
+
1140 testAcquireValidatedLedger();
+
1141 testNumTrustedForLedger();
+
1142 testSeqEnforcer();
+
1143 testTrustChanged();
+
1144 }
+
1145};
+
1146
+
1147BEAST_DEFINE_TESTSUITE(Validations, consensus, ripple);
+
1148} // namespace csf
+
1149} // namespace test
+
1150} // namespace ripple
beast::abstract_clock
Abstract interface to a clock.
Definition: abstract_clock.h:55
beast::manual_clock
Manual clock implementation.
Definition: manual_clock.h:41
beast::unit_test::suite
A testsuite class.
Definition: suite.h:55
@@ -1296,7 +1295,7 @@ $(function() {
ripple::test::csf::Validations_test::TestHarness::p_
ValidationParms p_
Definition: Validations_test.cpp:217
ripple::test::csf::Validations_test
Definition: Validations_test.cpp:35
ripple::test::csf::Validations_test::testGetNodesAfter
void testGetNodesAfter()
Definition: Validations_test.cpp:452
-
ripple::test::csf::Validations_test::testAcquireValidatedLedger
void testAcquireValidatedLedger()
Definition: Validations_test.cpp:923
+
ripple::test::csf::Validations_test::testAcquireValidatedLedger
void testAcquireValidatedLedger()
Definition: Validations_test.cpp:922
ripple::test::csf::Validations_test::testGetPreferredLedger
void testGetPreferredLedger()
Definition: Validations_test.cpp:791
ripple::test::csf::Validations_test::testAddValidation
void testAddValidation()
Definition: Validations_test.cpp:261
ripple::test::csf::Validations_test::testGetCurrentPublicKeys
void testGetCurrentPublicKeys()
Definition: Validations_test.cpp:547
@@ -1304,14 +1303,14 @@ $(function() {
ripple::test::csf::Validations_test::testFlush
void testFlush()
Definition: Validations_test.cpp:759
ripple::test::csf::Validations_test::genesisLedger
Ledger const genesisLedger
Definition: Validations_test.cpp:258
ripple::test::csf::Validations_test::testExpire
void testExpire()
Definition: Validations_test.cpp:706
-
ripple::test::csf::Validations_test::testSeqEnforcer
void testSeqEnforcer()
Definition: Validations_test.cpp:1009
+
ripple::test::csf::Validations_test::testSeqEnforcer
void testSeqEnforcer()
Definition: Validations_test.cpp:1008
ripple::test::csf::Validations_test::clock_type
beast::abstract_clock< std::chrono::steady_clock > const clock_type
Definition: Validations_test.cpp:36
-
ripple::test::csf::Validations_test::testTrustChanged
void testTrustChanged()
Definition: Validations_test.cpp:1031
-
ripple::test::csf::Validations_test::testNumTrustedForLedger
void testNumTrustedForLedger()
Definition: Validations_test.cpp:992
-
ripple::test::csf::Validations_test::run
void run() override
Runs the suite.
Definition: Validations_test.cpp:1129
+
ripple::test::csf::Validations_test::testTrustChanged
void testTrustChanged()
Definition: Validations_test.cpp:1030
+
ripple::test::csf::Validations_test::testNumTrustedForLedger
void testNumTrustedForLedger()
Definition: Validations_test.cpp:991
+
ripple::test::csf::Validations_test::run
void run() override
Runs the suite.
Definition: Validations_test.cpp:1128
ripple::test::csf::Validations_test::testTrustedByLedgerFunctions
void testTrustedByLedgerFunctions()
Definition: Validations_test.cpp:590
ripple::test::csf::Validations_test::testOnStale
void testOnStale()
Definition: Validations_test.cpp:407
-
ripple::test::csf::Validations_test::testGetPreferredLCL
void testGetPreferredLCL()
Definition: Validations_test.cpp:863
+
ripple::test::csf::Validations_test::testGetPreferredLCL
void testGetPreferredLCL()
Definition: Validations_test.cpp:862
ripple::test::csf::Validations_test::toNetClock
static NetClock::time_point toNetClock(clock_type const &c)
Definition: Validations_test.cpp:41
ripple::test::jtx::fee
Set the fee on a JTx.
Definition: fee.h:37
std::chrono::duration
diff --git a/ValidatorKeys_8cpp_source.html b/ValidatorKeys_8cpp_source.html index 4f0da6f6dd..4d30cac086 100644 --- a/ValidatorKeys_8cpp_source.html +++ b/ValidatorKeys_8cpp_source.html @@ -189,7 +189,7 @@ $(function() {
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:331
ripple::generateSecretKey
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
Definition: SecretKey.cpp:309
ripple::KeyType::secp256k1
@ secp256k1
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::loadValidatorToken
std::optional< ValidatorToken > loadValidatorToken(std::vector< std::string > const &blob, beast::Journal journal)
Definition: Manifest.cpp:264
diff --git a/ValidatorKeys__test_8cpp_source.html b/ValidatorKeys__test_8cpp_source.html index 262a218a92..aae9c3f6cb 100644 --- a/ValidatorKeys__test_8cpp_source.html +++ b/ValidatorKeys__test_8cpp_source.html @@ -299,7 +299,7 @@ $(function() {
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:331
ripple::generateSecretKey
SecretKey generateSecretKey(KeyType type, Seed const &seed)
Generate a new secret key deterministically.
Definition: SecretKey.cpp:309
ripple::KeyType::secp256k1
@ secp256k1
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
string
std::vector
diff --git a/ValidatorList_8cpp_source.html b/ValidatorList_8cpp_source.html index 0d92ed3095..071ee0febe 100644 --- a/ValidatorList_8cpp_source.html +++ b/ValidatorList_8cpp_source.html @@ -2361,7 +2361,7 @@ $(function() {
ripple::TokenType::NodePublic
@ NodePublic
ripple::strUnHex
std::optional< Blob > strUnHex(std::size_t strSize, Iterator begin, Iterator end)
Definition: StringUtilities.h:51
ripple::ECDSACanonicality::canonical
@ canonical
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::ProtocolFeature::ValidatorListPropagation
@ ValidatorListPropagation
ripple::ProtocolFeature::ValidatorList2Propagation
@ ValidatorList2Propagation
ripple::base64_decode
std::string base64_decode(std::string_view data)
Definition: libxrpl/basics/base64.cpp:248
@@ -2379,12 +2379,12 @@ $(function() {
ripple::ListDisposition::expired
@ expired
List is expired, but has the largest non-pending sequence seen so far.
ripple::ListDisposition::invalid
@ invalid
Invalid format or signature.
ripple::make_error_code
std::error_code make_error_code(ripple::TokenCodecErrc e)
Definition: token_errors.h:97
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::ManifestDisposition::accepted
@ accepted
Manifest is valid.
ripple::ManifestDisposition::invalid
@ invalid
Timely, but invalid signature.
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::AttestationMatch::match
@ match
ripple::strViewUnHex
std::optional< Blob > strViewUnHex(std::string_view strSrc)
Definition: StringUtilities.h:112
ripple::PublisherStatus
PublisherStatus
Definition: ValidatorList.h:87
diff --git a/ValidatorList__test_8cpp_source.html b/ValidatorList__test_8cpp_source.html index f8236445a0..8b3718641c 100644 --- a/ValidatorList__test_8cpp_source.html +++ b/ValidatorList__test_8cpp_source.html @@ -4313,14 +4313,14 @@ $(function() {
ripple::ListDisposition::same_sequence
@ same_sequence
Same sequence as current list.
ripple::ListDisposition::expired
@ expired
List is expired, but has the largest non-pending sequence seen so far.
ripple::derivePublicKey
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
Definition: SecretKey.cpp:331
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:244
ripple::randomSecretKey
SecretKey randomSecretKey()
Create a secret key using secure random numbers.
Definition: SecretKey.cpp:299
ripple::KeyType::ed25519
@ ed25519
ripple::KeyType::secp256k1
@ secp256k1
ripple::base64_encode
std::string base64_encode(std::uint8_t const *data, std::size_t len)
Definition: libxrpl/basics/base64.cpp:239
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::PublisherStatus::revoked
@ revoked
ripple::PublisherStatus::available
@ available
ripple::randomKeyPair
std::pair< PublicKey, SecretKey > randomKeyPair(KeyType type)
Create a key pair using secure random numbers.
Definition: SecretKey.cpp:386
diff --git a/ValidatorRPC__test_8cpp_source.html b/ValidatorRPC__test_8cpp_source.html index 4e1ef2d611..c098b057e6 100644 --- a/ValidatorRPC__test_8cpp_source.html +++ b/ValidatorRPC__test_8cpp_source.html @@ -708,7 +708,7 @@ $(function() {
ripple::isAdmin
bool isAdmin(Port const &port, Json::Value const &params, beast::IP::Address const &remoteIp)
Definition: Role.cpp:85
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::KeyType::ed25519
@ ed25519
-
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:319
+
ripple::calcNodeID
NodeID calcNodeID(PublicKey const &)
Calculate the 160-bit node ID from a node public key.
Definition: PublicKey.cpp:320
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::randomKeyPair
std::pair< PublicKey, SecretKey > randomKeyPair(KeyType type)
Create a key pair using secure random numbers.
Definition: SecretKey.cpp:386
std::numeric_limits
diff --git a/XChainAttestations_8cpp_source.html b/XChainAttestations_8cpp_source.html index 6af05f3e00..6fd223b564 100644 --- a/XChainAttestations_8cpp_source.html +++ b/XChainAttestations_8cpp_source.html @@ -867,7 +867,7 @@ $(function() {
Json
JSON (JavaScript Object Notation).
Definition: json_errors.h:25
ripple::Attestations::operator==
bool operator==(AttestationClaim const &lhs, AttestationClaim const &rhs)
Definition: XChainAttestations.cpp:272
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:288
+
ripple::verify
bool verify(PublicKey const &publicKey, Slice const &m, Slice const &sig, bool mustBeFullyCanonical=true) noexcept
Verify a signature on a message.
Definition: PublicKey.cpp:289
ripple::isLegalNet
bool isLegalNet(STAmount const &value)
Definition: STAmount.h:600
ripple::sfGeneric
SField const sfGeneric
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
diff --git a/XChainBridge_8cpp_source.html b/XChainBridge_8cpp_source.html index f11555d49e..a83f4707de 100644 --- a/XChainBridge_8cpp_source.html +++ b/XChainBridge_8cpp_source.html @@ -2404,7 +2404,7 @@ $(function() {
ripple::isTefFailure
bool isTefFailure(TER x) noexcept
Definition: TER.h:662
ripple::no
@ no
Definition: Steps.h:45
ripple::yes
@ yes
Definition: Steps.h:45
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::tfClearAccountCreateAmount
constexpr std::uint32_t tfClearAccountCreateAmount
Definition: TxFlags.h:230
diff --git a/aged__associative__container__test_8cpp_source.html b/aged__associative__container__test_8cpp_source.html index d09037aaaa..9e403869c4 100644 --- a/aged__associative__container__test_8cpp_source.html +++ b/aged__associative__container__test_8cpp_source.html @@ -781,1297 +781,1249 @@ $(function() {
703 Values const& v)
704{
705 using Cont = typename std::remove_reference<C>::type;
-
706 using Traits = TestTraits<
-
707 Cont::is_unordered::value,
-
708 Cont::is_multi::value,
-
709 Cont::is_map::value>;
-
710 using size_type = typename Cont::size_type;
-
711
-
712 BEAST_EXPECT(c.size() == v.size());
-
713 BEAST_EXPECT(size_type(std::distance(c.begin(), c.end())) == v.size());
-
714 BEAST_EXPECT(size_type(std::distance(c.cbegin(), c.cend())) == v.size());
-
715 BEAST_EXPECT(
-
716 size_type(std::distance(
-
717 c.chronological.begin(), c.chronological.end())) == v.size());
-
718 BEAST_EXPECT(
-
719 size_type(std::distance(
-
720 c.chronological.cbegin(), c.chronological.cend())) == v.size());
-
721 BEAST_EXPECT(
-
722 size_type(std::distance(
-
723 c.chronological.rbegin(), c.chronological.rend())) == v.size());
-
724 BEAST_EXPECT(
-
725 size_type(std::distance(
-
726 c.chronological.crbegin(), c.chronological.crend())) == v.size());
-
727
-
728 checkUnorderedContentsRefRef(c, v);
-
729}
-
730
-
731template <class Cont, class Values>
-
732void
-
733aged_associative_container_test_base::checkContents(Cont& c, Values const& v)
-
734{
-
735 checkContentsRefRef(c, v);
-
736 checkContentsRefRef(const_cast<Cont const&>(c), v);
-
737 checkMapContents(c, v);
-
738}
-
739
-
740template <class Cont>
-
741void
-
742aged_associative_container_test_base::checkContents(Cont& c)
-
743{
-
744 using Traits = TestTraits<
-
745 Cont::is_unordered::value,
-
746 Cont::is_multi::value,
-
747 Cont::is_map::value>;
-
748 using Values = typename Traits::Values;
-
749 checkContents(c, Values());
-
750}
-
751
+
706 using size_type = typename Cont::size_type;
+
707
+
708 BEAST_EXPECT(c.size() == v.size());
+
709 BEAST_EXPECT(size_type(std::distance(c.begin(), c.end())) == v.size());
+
710 BEAST_EXPECT(size_type(std::distance(c.cbegin(), c.cend())) == v.size());
+
711 BEAST_EXPECT(
+
712 size_type(std::distance(
+
713 c.chronological.begin(), c.chronological.end())) == v.size());
+
714 BEAST_EXPECT(
+
715 size_type(std::distance(
+
716 c.chronological.cbegin(), c.chronological.cend())) == v.size());
+
717 BEAST_EXPECT(
+
718 size_type(std::distance(
+
719 c.chronological.rbegin(), c.chronological.rend())) == v.size());
+
720 BEAST_EXPECT(
+
721 size_type(std::distance(
+
722 c.chronological.crbegin(), c.chronological.crend())) == v.size());
+
723
+
724 checkUnorderedContentsRefRef(c, v);
+
725}
+
726
+
727template <class Cont, class Values>
+
728void
+
729aged_associative_container_test_base::checkContents(Cont& c, Values const& v)
+
730{
+
731 checkContentsRefRef(c, v);
+
732 checkContentsRefRef(const_cast<Cont const&>(c), v);
+
733 checkMapContents(c, v);
+
734}
+
735
+
736template <class Cont>
+
737void
+
738aged_associative_container_test_base::checkContents(Cont& c)
+
739{
+
740 using Traits = TestTraits<
+
741 Cont::is_unordered::value,
+
742 Cont::is_multi::value,
+
743 Cont::is_map::value>;
+
744 using Values = typename Traits::Values;
+
745 checkContents(c, Values());
+
746}
+
747
+
748//------------------------------------------------------------------------------
+
749//
+
750// Construction
+
751//
752//------------------------------------------------------------------------------
-
753//
-
754// Construction
-
755//
-
756//------------------------------------------------------------------------------
-
757
-
758// ordered
-
759template <bool IsUnordered, bool IsMulti, bool IsMap>
-
760typename std::enable_if<!IsUnordered>::type
-
761aged_associative_container_test_base::testConstructEmpty()
-
762{
-
763 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
764 using Value = typename Traits::Value;
-
765 using Key = typename Traits::Key;
-
766 using T = typename Traits::T;
-
767 using Clock = typename Traits::Clock;
-
768 using Comp = typename Traits::Comp;
-
769 using Alloc = typename Traits::Alloc;
-
770 using MyComp = typename Traits::MyComp;
-
771 using MyAlloc = typename Traits::MyAlloc;
-
772 typename Traits::ManualClock clock;
+
753
+
754// ordered
+
755template <bool IsUnordered, bool IsMulti, bool IsMap>
+
756typename std::enable_if<!IsUnordered>::type
+
757aged_associative_container_test_base::testConstructEmpty()
+
758{
+
759 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
760 using Comp = typename Traits::Comp;
+
761 using Alloc = typename Traits::Alloc;
+
762 using MyComp = typename Traits::MyComp;
+
763 using MyAlloc = typename Traits::MyAlloc;
+
764 typename Traits::ManualClock clock;
+
765
+
766 // testcase (Traits::name() + " empty");
+
767 testcase("empty");
+
768
+
769 {
+
770 typename Traits::template Cont<Comp, Alloc> c(clock);
+
771 checkContents(c);
+
772 }
773
-
774 // testcase (Traits::name() + " empty");
-
775 testcase("empty");
-
776
-
777 {
-
778 typename Traits::template Cont<Comp, Alloc> c(clock);
-
779 checkContents(c);
-
780 }
-
781
-
782 {
-
783 typename Traits::template Cont<MyComp, Alloc> c(clock, MyComp(1));
-
784 checkContents(c);
-
785 }
-
786
-
787 {
-
788 typename Traits::template Cont<Comp, MyAlloc> c(clock, MyAlloc(1));
-
789 checkContents(c);
-
790 }
-
791
-
792 {
-
793 typename Traits::template Cont<MyComp, MyAlloc> c(
-
794 clock, MyComp(1), MyAlloc(1));
-
795 checkContents(c);
-
796 }
-
797}
-
798
-
799// unordered
-
800template <bool IsUnordered, bool IsMulti, bool IsMap>
-
801typename std::enable_if<IsUnordered>::type
-
802aged_associative_container_test_base::testConstructEmpty()
-
803{
-
804 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
805 using Value = typename Traits::Value;
-
806 using Key = typename Traits::Key;
-
807 using T = typename Traits::T;
-
808 using Clock = typename Traits::Clock;
-
809 using Hash = typename Traits::Hash;
-
810 using Equal = typename Traits::Equal;
-
811 using Alloc = typename Traits::Alloc;
-
812 using MyHash = typename Traits::MyHash;
-
813 using MyEqual = typename Traits::MyEqual;
-
814 using MyAlloc = typename Traits::MyAlloc;
-
815 typename Traits::ManualClock clock;
-
816
-
817 // testcase (Traits::name() + " empty");
-
818 testcase("empty");
-
819 {
-
820 typename Traits::template Cont<Hash, Equal, Alloc> c(clock);
+
774 {
+
775 typename Traits::template Cont<MyComp, Alloc> c(clock, MyComp(1));
+
776 checkContents(c);
+
777 }
+
778
+
779 {
+
780 typename Traits::template Cont<Comp, MyAlloc> c(clock, MyAlloc(1));
+
781 checkContents(c);
+
782 }
+
783
+
784 {
+
785 typename Traits::template Cont<MyComp, MyAlloc> c(
+
786 clock, MyComp(1), MyAlloc(1));
+
787 checkContents(c);
+
788 }
+
789}
+
790
+
791// unordered
+
792template <bool IsUnordered, bool IsMulti, bool IsMap>
+
793typename std::enable_if<IsUnordered>::type
+
794aged_associative_container_test_base::testConstructEmpty()
+
795{
+
796 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
797 using Hash = typename Traits::Hash;
+
798 using Equal = typename Traits::Equal;
+
799 using Alloc = typename Traits::Alloc;
+
800 using MyHash = typename Traits::MyHash;
+
801 using MyEqual = typename Traits::MyEqual;
+
802 using MyAlloc = typename Traits::MyAlloc;
+
803 typename Traits::ManualClock clock;
+
804
+
805 // testcase (Traits::name() + " empty");
+
806 testcase("empty");
+
807 {
+
808 typename Traits::template Cont<Hash, Equal, Alloc> c(clock);
+
809 checkContents(c);
+
810 }
+
811
+
812 {
+
813 typename Traits::template Cont<MyHash, Equal, Alloc> c(
+
814 clock, MyHash(1));
+
815 checkContents(c);
+
816 }
+
817
+
818 {
+
819 typename Traits::template Cont<Hash, MyEqual, Alloc> c(
+
820 clock, MyEqual(1));
821 checkContents(c);
822 }
823
824 {
-
825 typename Traits::template Cont<MyHash, Equal, Alloc> c(
-
826 clock, MyHash(1));
+
825 typename Traits::template Cont<Hash, Equal, MyAlloc> c(
+
826 clock, MyAlloc(1));
827 checkContents(c);
828 }
829
830 {
-
831 typename Traits::template Cont<Hash, MyEqual, Alloc> c(
-
832 clock, MyEqual(1));
+
831 typename Traits::template Cont<MyHash, MyEqual, Alloc> c(
+
832 clock, MyHash(1), MyEqual(1));
833 checkContents(c);
834 }
835
836 {
-
837 typename Traits::template Cont<Hash, Equal, MyAlloc> c(
-
838 clock, MyAlloc(1));
+
837 typename Traits::template Cont<MyHash, Equal, MyAlloc> c(
+
838 clock, MyHash(1), MyAlloc(1));
839 checkContents(c);
840 }
841
842 {
-
843 typename Traits::template Cont<MyHash, MyEqual, Alloc> c(
-
844 clock, MyHash(1), MyEqual(1));
+
843 typename Traits::template Cont<Hash, MyEqual, MyAlloc> c(
+
844 clock, MyEqual(1), MyAlloc(1));
845 checkContents(c);
846 }
847
848 {
-
849 typename Traits::template Cont<MyHash, Equal, MyAlloc> c(
-
850 clock, MyHash(1), MyAlloc(1));
+
849 typename Traits::template Cont<MyHash, MyEqual, MyAlloc> c(
+
850 clock, MyHash(1), MyEqual(1), MyAlloc(1));
851 checkContents(c);
852 }
-
853
-
854 {
-
855 typename Traits::template Cont<Hash, MyEqual, MyAlloc> c(
-
856 clock, MyEqual(1), MyAlloc(1));
-
857 checkContents(c);
-
858 }
-
859
-
860 {
-
861 typename Traits::template Cont<MyHash, MyEqual, MyAlloc> c(
-
862 clock, MyHash(1), MyEqual(1), MyAlloc(1));
-
863 checkContents(c);
-
864 }
-
865}
-
866
-
867// ordered
-
868template <bool IsUnordered, bool IsMulti, bool IsMap>
-
869typename std::enable_if<!IsUnordered>::type
-
870aged_associative_container_test_base::testConstructRange()
-
871{
-
872 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
873 using Value = typename Traits::Value;
-
874 using Key = typename Traits::Key;
-
875 using T = typename Traits::T;
-
876 using Clock = typename Traits::Clock;
-
877 using Comp = typename Traits::Comp;
-
878 using Alloc = typename Traits::Alloc;
-
879 using MyComp = typename Traits::MyComp;
-
880 using MyAlloc = typename Traits::MyAlloc;
-
881 typename Traits::ManualClock clock;
-
882 auto const v(Traits::values());
-
883
-
884 // testcase (Traits::name() + " range");
-
885 testcase("range");
-
886
-
887 {
-
888 typename Traits::template Cont<Comp, Alloc> c(
-
889 v.begin(), v.end(), clock);
-
890 checkContents(c, v);
-
891 }
-
892
-
893 {
-
894 typename Traits::template Cont<MyComp, Alloc> c(
-
895 v.begin(), v.end(), clock, MyComp(1));
-
896 checkContents(c, v);
-
897 }
-
898
-
899 {
-
900 typename Traits::template Cont<Comp, MyAlloc> c(
-
901 v.begin(), v.end(), clock, MyAlloc(1));
-
902 checkContents(c, v);
+
853}
+
854
+
855// ordered
+
856template <bool IsUnordered, bool IsMulti, bool IsMap>
+
857typename std::enable_if<!IsUnordered>::type
+
858aged_associative_container_test_base::testConstructRange()
+
859{
+
860 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
861 using Comp = typename Traits::Comp;
+
862 using Alloc = typename Traits::Alloc;
+
863 using MyComp = typename Traits::MyComp;
+
864 using MyAlloc = typename Traits::MyAlloc;
+
865 typename Traits::ManualClock clock;
+
866 auto const v(Traits::values());
+
867
+
868 // testcase (Traits::name() + " range");
+
869 testcase("range");
+
870
+
871 {
+
872 typename Traits::template Cont<Comp, Alloc> c(
+
873 v.begin(), v.end(), clock);
+
874 checkContents(c, v);
+
875 }
+
876
+
877 {
+
878 typename Traits::template Cont<MyComp, Alloc> c(
+
879 v.begin(), v.end(), clock, MyComp(1));
+
880 checkContents(c, v);
+
881 }
+
882
+
883 {
+
884 typename Traits::template Cont<Comp, MyAlloc> c(
+
885 v.begin(), v.end(), clock, MyAlloc(1));
+
886 checkContents(c, v);
+
887 }
+
888
+
889 {
+
890 typename Traits::template Cont<MyComp, MyAlloc> c(
+
891 v.begin(), v.end(), clock, MyComp(1), MyAlloc(1));
+
892 checkContents(c, v);
+
893 }
+
894
+
895 // swap
+
896
+
897 {
+
898 typename Traits::template Cont<Comp, Alloc> c1(
+
899 v.begin(), v.end(), clock);
+
900 typename Traits::template Cont<Comp, Alloc> c2(clock);
+
901 std::swap(c1, c2);
+
902 checkContents(c2, v);
903 }
-
904
-
905 {
-
906 typename Traits::template Cont<MyComp, MyAlloc> c(
-
907 v.begin(), v.end(), clock, MyComp(1), MyAlloc(1));
-
908 checkContents(c, v);
-
909 }
-
910
-
911 // swap
-
912
-
913 {
-
914 typename Traits::template Cont<Comp, Alloc> c1(
-
915 v.begin(), v.end(), clock);
-
916 typename Traits::template Cont<Comp, Alloc> c2(clock);
-
917 std::swap(c1, c2);
-
918 checkContents(c2, v);
-
919 }
-
920}
-
921
-
922// unordered
-
923template <bool IsUnordered, bool IsMulti, bool IsMap>
-
924typename std::enable_if<IsUnordered>::type
-
925aged_associative_container_test_base::testConstructRange()
-
926{
-
927 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
928 using Value = typename Traits::Value;
-
929 using Key = typename Traits::Key;
-
930 using T = typename Traits::T;
-
931 using Clock = typename Traits::Clock;
-
932 using Hash = typename Traits::Hash;
-
933 using Equal = typename Traits::Equal;
-
934 using Alloc = typename Traits::Alloc;
-
935 using MyHash = typename Traits::MyHash;
-
936 using MyEqual = typename Traits::MyEqual;
-
937 using MyAlloc = typename Traits::MyAlloc;
-
938 typename Traits::ManualClock clock;
-
939 auto const v(Traits::values());
-
940
-
941 // testcase (Traits::name() + " range");
-
942 testcase("range");
-
943
-
944 {
-
945 typename Traits::template Cont<Hash, Equal, Alloc> c(
-
946 v.begin(), v.end(), clock);
-
947 checkContents(c, v);
-
948 }
-
949
-
950 {
-
951 typename Traits::template Cont<MyHash, Equal, Alloc> c(
-
952 v.begin(), v.end(), clock, MyHash(1));
-
953 checkContents(c, v);
-
954 }
-
955
-
956 {
-
957 typename Traits::template Cont<Hash, MyEqual, Alloc> c(
-
958 v.begin(), v.end(), clock, MyEqual(1));
-
959 checkContents(c, v);
-
960 }
-
961
-
962 {
-
963 typename Traits::template Cont<Hash, Equal, MyAlloc> c(
-
964 v.begin(), v.end(), clock, MyAlloc(1));
-
965 checkContents(c, v);
-
966 }
-
967
-
968 {
-
969 typename Traits::template Cont<MyHash, MyEqual, Alloc> c(
-
970 v.begin(), v.end(), clock, MyHash(1), MyEqual(1));
-
971 checkContents(c, v);
-
972 }
-
973
-
974 {
-
975 typename Traits::template Cont<MyHash, Equal, MyAlloc> c(
-
976 v.begin(), v.end(), clock, MyHash(1), MyAlloc(1));
-
977 checkContents(c, v);
-
978 }
-
979
-
980 {
-
981 typename Traits::template Cont<Hash, MyEqual, MyAlloc> c(
-
982 v.begin(), v.end(), clock, MyEqual(1), MyAlloc(1));
-
983 checkContents(c, v);
-
984 }
+
904}
+
905
+
906// unordered
+
907template <bool IsUnordered, bool IsMulti, bool IsMap>
+
908typename std::enable_if<IsUnordered>::type
+
909aged_associative_container_test_base::testConstructRange()
+
910{
+
911 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
912 using Hash = typename Traits::Hash;
+
913 using Equal = typename Traits::Equal;
+
914 using Alloc = typename Traits::Alloc;
+
915 using MyHash = typename Traits::MyHash;
+
916 using MyEqual = typename Traits::MyEqual;
+
917 using MyAlloc = typename Traits::MyAlloc;
+
918 typename Traits::ManualClock clock;
+
919 auto const v(Traits::values());
+
920
+
921 // testcase (Traits::name() + " range");
+
922 testcase("range");
+
923
+
924 {
+
925 typename Traits::template Cont<Hash, Equal, Alloc> c(
+
926 v.begin(), v.end(), clock);
+
927 checkContents(c, v);
+
928 }
+
929
+
930 {
+
931 typename Traits::template Cont<MyHash, Equal, Alloc> c(
+
932 v.begin(), v.end(), clock, MyHash(1));
+
933 checkContents(c, v);
+
934 }
+
935
+
936 {
+
937 typename Traits::template Cont<Hash, MyEqual, Alloc> c(
+
938 v.begin(), v.end(), clock, MyEqual(1));
+
939 checkContents(c, v);
+
940 }
+
941
+
942 {
+
943 typename Traits::template Cont<Hash, Equal, MyAlloc> c(
+
944 v.begin(), v.end(), clock, MyAlloc(1));
+
945 checkContents(c, v);
+
946 }
+
947
+
948 {
+
949 typename Traits::template Cont<MyHash, MyEqual, Alloc> c(
+
950 v.begin(), v.end(), clock, MyHash(1), MyEqual(1));
+
951 checkContents(c, v);
+
952 }
+
953
+
954 {
+
955 typename Traits::template Cont<MyHash, Equal, MyAlloc> c(
+
956 v.begin(), v.end(), clock, MyHash(1), MyAlloc(1));
+
957 checkContents(c, v);
+
958 }
+
959
+
960 {
+
961 typename Traits::template Cont<Hash, MyEqual, MyAlloc> c(
+
962 v.begin(), v.end(), clock, MyEqual(1), MyAlloc(1));
+
963 checkContents(c, v);
+
964 }
+
965
+
966 {
+
967 typename Traits::template Cont<MyHash, MyEqual, MyAlloc> c(
+
968 v.begin(), v.end(), clock, MyHash(1), MyEqual(1), MyAlloc(1));
+
969 checkContents(c, v);
+
970 }
+
971}
+
972
+
973// ordered
+
974template <bool IsUnordered, bool IsMulti, bool IsMap>
+
975typename std::enable_if<!IsUnordered>::type
+
976aged_associative_container_test_base::testConstructInitList()
+
977{
+
978 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
979 typename Traits::ManualClock clock;
+
980
+
981 // testcase (Traits::name() + " init-list");
+
982 testcase("init-list");
+
983
+
984 // VFALCO TODO
985
-
986 {
-
987 typename Traits::template Cont<MyHash, MyEqual, MyAlloc> c(
-
988 v.begin(), v.end(), clock, MyHash(1), MyEqual(1), MyAlloc(1));
-
989 checkContents(c, v);
-
990 }
-
991}
-
992
-
993// ordered
-
994template <bool IsUnordered, bool IsMulti, bool IsMap>
-
995typename std::enable_if<!IsUnordered>::type
-
996aged_associative_container_test_base::testConstructInitList()
-
997{
-
998 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
999 using Value = typename Traits::Value;
-
1000 using Key = typename Traits::Key;
-
1001 using T = typename Traits::T;
-
1002 using Clock = typename Traits::Clock;
-
1003 using Comp = typename Traits::Comp;
-
1004 using Alloc = typename Traits::Alloc;
-
1005 using MyComp = typename Traits::MyComp;
-
1006 using MyAlloc = typename Traits::MyAlloc;
-
1007 typename Traits::ManualClock clock;
-
1008
-
1009 // testcase (Traits::name() + " init-list");
-
1010 testcase("init-list");
-
1011
-
1012 // VFALCO TODO
-
1013
-
1014 pass();
-
1015}
-
1016
-
1017// unordered
-
1018template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1019typename std::enable_if<IsUnordered>::type
-
1020aged_associative_container_test_base::testConstructInitList()
-
1021{
-
1022 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1023 using Value = typename Traits::Value;
-
1024 using Key = typename Traits::Key;
-
1025 using T = typename Traits::T;
-
1026 using Clock = typename Traits::Clock;
-
1027 using Hash = typename Traits::Hash;
-
1028 using Equal = typename Traits::Equal;
-
1029 using Alloc = typename Traits::Alloc;
-
1030 using MyHash = typename Traits::MyHash;
-
1031 using MyEqual = typename Traits::MyEqual;
-
1032 using MyAlloc = typename Traits::MyAlloc;
-
1033 typename Traits::ManualClock clock;
-
1034
-
1035 // testcase (Traits::name() + " init-list");
-
1036 testcase("init-list");
-
1037
-
1038 // VFALCO TODO
-
1039 pass();
-
1040}
+
986 pass();
+
987}
+
988
+
989// unordered
+
990template <bool IsUnordered, bool IsMulti, bool IsMap>
+
991typename std::enable_if<IsUnordered>::type
+
992aged_associative_container_test_base::testConstructInitList()
+
993{
+
994 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
995 typename Traits::ManualClock clock;
+
996
+
997 // testcase (Traits::name() + " init-list");
+
998 testcase("init-list");
+
999
+
1000 // VFALCO TODO
+
1001 pass();
+
1002}
+
1003
+
1004//------------------------------------------------------------------------------
+
1005//
+
1006// Copy/Move construction and assign
+
1007//
+
1008//------------------------------------------------------------------------------
+
1009
+
1010template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1011void
+
1012aged_associative_container_test_base::testCopyMove()
+
1013{
+
1014 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1015 using Alloc = typename Traits::Alloc;
+
1016 typename Traits::ManualClock clock;
+
1017 auto const v(Traits::values());
+
1018
+
1019 // testcase (Traits::name() + " copy/move");
+
1020 testcase("copy/move");
+
1021
+
1022 // copy
+
1023
+
1024 {
+
1025 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
+
1026 typename Traits::template Cont<> c2(c);
+
1027 checkContents(c, v);
+
1028 checkContents(c2, v);
+
1029 BEAST_EXPECT(c == c2);
+
1030 unexpected(c != c2);
+
1031 }
+
1032
+
1033 {
+
1034 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
+
1035 typename Traits::template Cont<> c2(c, Alloc());
+
1036 checkContents(c, v);
+
1037 checkContents(c2, v);
+
1038 BEAST_EXPECT(c == c2);
+
1039 unexpected(c != c2);
+
1040 }
1041
-
1042//------------------------------------------------------------------------------
-
1043//
-
1044// Copy/Move construction and assign
-
1045//
-
1046//------------------------------------------------------------------------------
-
1047
-
1048template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1049void
-
1050aged_associative_container_test_base::testCopyMove()
-
1051{
-
1052 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1053 using Value = typename Traits::Value;
-
1054 using Alloc = typename Traits::Alloc;
-
1055 typename Traits::ManualClock clock;
-
1056 auto const v(Traits::values());
-
1057
-
1058 // testcase (Traits::name() + " copy/move");
-
1059 testcase("copy/move");
-
1060
-
1061 // copy
-
1062
-
1063 {
-
1064 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
-
1065 typename Traits::template Cont<> c2(c);
-
1066 checkContents(c, v);
-
1067 checkContents(c2, v);
-
1068 BEAST_EXPECT(c == c2);
-
1069 unexpected(c != c2);
-
1070 }
-
1071
-
1072 {
-
1073 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
-
1074 typename Traits::template Cont<> c2(c, Alloc());
-
1075 checkContents(c, v);
-
1076 checkContents(c2, v);
-
1077 BEAST_EXPECT(c == c2);
-
1078 unexpected(c != c2);
-
1079 }
-
1080
-
1081 {
-
1082 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
-
1083 typename Traits::template Cont<> c2(clock);
-
1084 c2 = c;
-
1085 checkContents(c, v);
-
1086 checkContents(c2, v);
-
1087 BEAST_EXPECT(c == c2);
-
1088 unexpected(c != c2);
-
1089 }
+
1042 {
+
1043 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
+
1044 typename Traits::template Cont<> c2(clock);
+
1045 c2 = c;
+
1046 checkContents(c, v);
+
1047 checkContents(c2, v);
+
1048 BEAST_EXPECT(c == c2);
+
1049 unexpected(c != c2);
+
1050 }
+
1051
+
1052 // move
+
1053
+
1054 {
+
1055 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
+
1056 typename Traits::template Cont<> c2(std::move(c));
+
1057 checkContents(c2, v);
+
1058 }
+
1059
+
1060 {
+
1061 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
+
1062 typename Traits::template Cont<> c2(std::move(c), Alloc());
+
1063 checkContents(c2, v);
+
1064 }
+
1065
+
1066 {
+
1067 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
+
1068 typename Traits::template Cont<> c2(clock);
+
1069 c2 = std::move(c);
+
1070 checkContents(c2, v);
+
1071 }
+
1072}
+
1073
+
1074//------------------------------------------------------------------------------
+
1075//
+
1076// Iterator construction and assignment
+
1077//
+
1078//------------------------------------------------------------------------------
+
1079
+
1080template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1081void
+
1082aged_associative_container_test_base::testIterator()
+
1083{
+
1084 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1085 typename Traits::ManualClock clock;
+
1086 auto const v(Traits::values());
+
1087
+
1088 // testcase (Traits::name() + " iterators");
+
1089 testcase("iterator");
1090
-
1091 // move
+
1091 typename Traits::template Cont<> c{clock};
1092
-
1093 {
-
1094 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
-
1095 typename Traits::template Cont<> c2(std::move(c));
-
1096 checkContents(c2, v);
-
1097 }
-
1098
-
1099 {
-
1100 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
-
1101 typename Traits::template Cont<> c2(std::move(c), Alloc());
-
1102 checkContents(c2, v);
-
1103 }
-
1104
-
1105 {
-
1106 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
-
1107 typename Traits::template Cont<> c2(clock);
-
1108 c2 = std::move(c);
-
1109 checkContents(c2, v);
-
1110 }
-
1111}
+
1093 using iterator = decltype(c.begin());
+
1094 using const_iterator = decltype(c.cbegin());
+
1095
+
1096 // Should be able to construct or assign an iterator from an iterator.
+
1097 iterator nnIt_0{c.begin()};
+
1098 iterator nnIt_1{nnIt_0};
+
1099 BEAST_EXPECT(nnIt_0 == nnIt_1);
+
1100 iterator nnIt_2;
+
1101 nnIt_2 = nnIt_1;
+
1102 BEAST_EXPECT(nnIt_1 == nnIt_2);
+
1103
+
1104 // Should be able to construct or assign a const_iterator from a
+
1105 // const_iterator.
+
1106 const_iterator ccIt_0{c.cbegin()};
+
1107 const_iterator ccIt_1{ccIt_0};
+
1108 BEAST_EXPECT(ccIt_0 == ccIt_1);
+
1109 const_iterator ccIt_2;
+
1110 ccIt_2 = ccIt_1;
+
1111 BEAST_EXPECT(ccIt_1 == ccIt_2);
1112
-
1113//------------------------------------------------------------------------------
-
1114//
-
1115// Iterator construction and assignment
-
1116//
-
1117//------------------------------------------------------------------------------
-
1118
-
1119template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1120void
-
1121aged_associative_container_test_base::testIterator()
-
1122{
-
1123 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1124 using Value = typename Traits::Value;
-
1125 using Alloc = typename Traits::Alloc;
-
1126 typename Traits::ManualClock clock;
-
1127 auto const v(Traits::values());
-
1128
-
1129 // testcase (Traits::name() + " iterators");
-
1130 testcase("iterator");
+
1113 // Comparison between iterator and const_iterator is okay
+
1114 BEAST_EXPECT(nnIt_0 == ccIt_0);
+
1115 BEAST_EXPECT(ccIt_1 == nnIt_1);
+
1116
+
1117 // Should be able to construct a const_iterator from an iterator.
+
1118 const_iterator ncIt_3{c.begin()};
+
1119 const_iterator ncIt_4{nnIt_0};
+
1120 BEAST_EXPECT(ncIt_3 == ncIt_4);
+
1121 const_iterator ncIt_5;
+
1122 ncIt_5 = nnIt_2;
+
1123 BEAST_EXPECT(ncIt_5 == ncIt_4);
+
1124
+
1125 // None of these should compile because they construct or assign to a
+
1126 // non-const iterator with a const_iterator.
+
1127
+
1128 // iterator cnIt_0 {c.cbegin()};
+
1129
+
1130 // iterator cnIt_1 {ccIt_0};
1131
-
1132 typename Traits::template Cont<> c{clock};
-
1133
-
1134 using iterator = decltype(c.begin());
-
1135 using const_iterator = decltype(c.cbegin());
-
1136
-
1137 // Should be able to construct or assign an iterator from an iterator.
-
1138 iterator nnIt_0{c.begin()};
-
1139 iterator nnIt_1{nnIt_0};
-
1140 BEAST_EXPECT(nnIt_0 == nnIt_1);
-
1141 iterator nnIt_2;
-
1142 nnIt_2 = nnIt_1;
-
1143 BEAST_EXPECT(nnIt_1 == nnIt_2);
-
1144
-
1145 // Should be able to construct or assign a const_iterator from a
-
1146 // const_iterator.
-
1147 const_iterator ccIt_0{c.cbegin()};
-
1148 const_iterator ccIt_1{ccIt_0};
-
1149 BEAST_EXPECT(ccIt_0 == ccIt_1);
-
1150 const_iterator ccIt_2;
-
1151 ccIt_2 = ccIt_1;
-
1152 BEAST_EXPECT(ccIt_1 == ccIt_2);
-
1153
-
1154 // Comparison between iterator and const_iterator is okay
-
1155 BEAST_EXPECT(nnIt_0 == ccIt_0);
-
1156 BEAST_EXPECT(ccIt_1 == nnIt_1);
-
1157
-
1158 // Should be able to construct a const_iterator from an iterator.
-
1159 const_iterator ncIt_3{c.begin()};
-
1160 const_iterator ncIt_4{nnIt_0};
-
1161 BEAST_EXPECT(ncIt_3 == ncIt_4);
-
1162 const_iterator ncIt_5;
-
1163 ncIt_5 = nnIt_2;
-
1164 BEAST_EXPECT(ncIt_5 == ncIt_4);
-
1165
-
1166 // None of these should compile because they construct or assign to a
-
1167 // non-const iterator with a const_iterator.
+
1132 // iterator cnIt_2;
+
1133 // cnIt_2 = ccIt_2;
+
1134}
+
1135
+
1136template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1137typename std::enable_if<!IsUnordered>::type
+
1138aged_associative_container_test_base::testReverseIterator()
+
1139{
+
1140 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1141 typename Traits::ManualClock clock;
+
1142 auto const v(Traits::values());
+
1143
+
1144 // testcase (Traits::name() + " reverse_iterators");
+
1145 testcase("reverse_iterator");
+
1146
+
1147 typename Traits::template Cont<> c{clock};
+
1148
+
1149 using iterator = decltype(c.begin());
+
1150 using reverse_iterator = decltype(c.rbegin());
+
1151 using const_reverse_iterator = decltype(c.crbegin());
+
1152
+
1153 // Naming decoder ring
+
1154 // constructed from ------+ +----- constructed type
+
1155 // /\/\ -- character pairs
+
1156 // xAyBit
+
1157 // r (reverse) or f (forward)--^-^
+
1158 // ^-^------ C (const) or N (non-const)
+
1159
+
1160 // Should be able to construct or assign a reverse_iterator from a
+
1161 // reverse_iterator.
+
1162 reverse_iterator rNrNit_0{c.rbegin()};
+
1163 reverse_iterator rNrNit_1{rNrNit_0};
+
1164 BEAST_EXPECT(rNrNit_0 == rNrNit_1);
+
1165 reverse_iterator xXrNit_2;
+
1166 xXrNit_2 = rNrNit_1;
+
1167 BEAST_EXPECT(rNrNit_1 == xXrNit_2);
1168
-
1169 // iterator cnIt_0 {c.cbegin()};
-
1170
-
1171 // iterator cnIt_1 {ccIt_0};
-
1172
-
1173 // iterator cnIt_2;
-
1174 // cnIt_2 = ccIt_2;
-
1175}
-
1176
-
1177template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1178typename std::enable_if<!IsUnordered>::type
-
1179aged_associative_container_test_base::testReverseIterator()
-
1180{
-
1181 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1182 using Value = typename Traits::Value;
-
1183 using Alloc = typename Traits::Alloc;
-
1184 typename Traits::ManualClock clock;
-
1185 auto const v(Traits::values());
-
1186
-
1187 // testcase (Traits::name() + " reverse_iterators");
-
1188 testcase("reverse_iterator");
+
1169 // Should be able to construct or assign a const_reverse_iterator from a
+
1170 // const_reverse_iterator
+
1171 const_reverse_iterator rCrCit_0{c.crbegin()};
+
1172 const_reverse_iterator rCrCit_1{rCrCit_0};
+
1173 BEAST_EXPECT(rCrCit_0 == rCrCit_1);
+
1174 const_reverse_iterator xXrCit_2;
+
1175 xXrCit_2 = rCrCit_1;
+
1176 BEAST_EXPECT(rCrCit_1 == xXrCit_2);
+
1177
+
1178 // Comparison between reverse_iterator and const_reverse_iterator is okay
+
1179 BEAST_EXPECT(rNrNit_0 == rCrCit_0);
+
1180 BEAST_EXPECT(rCrCit_1 == rNrNit_1);
+
1181
+
1182 // Should be able to construct or assign a const_reverse_iterator from a
+
1183 // reverse_iterator
+
1184 const_reverse_iterator rNrCit_0{c.rbegin()};
+
1185 const_reverse_iterator rNrCit_1{rNrNit_0};
+
1186 BEAST_EXPECT(rNrCit_0 == rNrCit_1);
+
1187 xXrCit_2 = rNrNit_1;
+
1188 BEAST_EXPECT(rNrCit_1 == xXrCit_2);
1189
-
1190 typename Traits::template Cont<> c{clock};
-
1191
-
1192 using iterator = decltype(c.begin());
-
1193 using const_iterator = decltype(c.cbegin());
-
1194 using reverse_iterator = decltype(c.rbegin());
-
1195 using const_reverse_iterator = decltype(c.crbegin());
-
1196
-
1197 // Naming decoder ring
-
1198 // constructed from ------+ +----- constructed type
-
1199 // /\/\ -- character pairs
-
1200 // xAyBit
-
1201 // r (reverse) or f (forward)--^-^
-
1202 // ^-^------ C (const) or N (non-const)
-
1203
-
1204 // Should be able to construct or assign a reverse_iterator from a
-
1205 // reverse_iterator.
-
1206 reverse_iterator rNrNit_0{c.rbegin()};
-
1207 reverse_iterator rNrNit_1{rNrNit_0};
-
1208 BEAST_EXPECT(rNrNit_0 == rNrNit_1);
-
1209 reverse_iterator xXrNit_2;
-
1210 xXrNit_2 = rNrNit_1;
-
1211 BEAST_EXPECT(rNrNit_1 == xXrNit_2);
-
1212
-
1213 // Should be able to construct or assign a const_reverse_iterator from a
-
1214 // const_reverse_iterator
-
1215 const_reverse_iterator rCrCit_0{c.crbegin()};
-
1216 const_reverse_iterator rCrCit_1{rCrCit_0};
-
1217 BEAST_EXPECT(rCrCit_0 == rCrCit_1);
-
1218 const_reverse_iterator xXrCit_2;
-
1219 xXrCit_2 = rCrCit_1;
-
1220 BEAST_EXPECT(rCrCit_1 == xXrCit_2);
-
1221
-
1222 // Comparison between reverse_iterator and const_reverse_iterator is okay
-
1223 BEAST_EXPECT(rNrNit_0 == rCrCit_0);
-
1224 BEAST_EXPECT(rCrCit_1 == rNrNit_1);
-
1225
-
1226 // Should be able to construct or assign a const_reverse_iterator from a
-
1227 // reverse_iterator
-
1228 const_reverse_iterator rNrCit_0{c.rbegin()};
-
1229 const_reverse_iterator rNrCit_1{rNrNit_0};
-
1230 BEAST_EXPECT(rNrCit_0 == rNrCit_1);
-
1231 xXrCit_2 = rNrNit_1;
-
1232 BEAST_EXPECT(rNrCit_1 == xXrCit_2);
-
1233
-
1234 // The standard allows these conversions:
-
1235 // o reverse_iterator is explicitly constructible from iterator.
-
1236 // o const_reverse_iterator is explicitly constructible from
-
1237 // const_iterator.
-
1238 // Should be able to construct or assign reverse_iterators from
-
1239 // non-reverse iterators.
-
1240 reverse_iterator fNrNit_0{c.begin()};
-
1241 const_reverse_iterator fNrCit_0{c.begin()};
-
1242 BEAST_EXPECT(fNrNit_0 == fNrCit_0);
-
1243 const_reverse_iterator fCrCit_0{c.cbegin()};
-
1244 BEAST_EXPECT(fNrCit_0 == fCrCit_0);
-
1245
-
1246 // None of these should compile because they construct a non-reverse
-
1247 // iterator from a reverse_iterator.
-
1248 // iterator rNfNit_0 {c.rbegin()};
-
1249 // const_iterator rNfCit_0 {c.rbegin()};
-
1250 // const_iterator rCfCit_0 {c.crbegin()};
-
1251
-
1252 // You should not be able to assign an iterator to a reverse_iterator or
-
1253 // vise-versa. So the following lines should not compile.
-
1254 iterator xXfNit_0;
-
1255 // xXfNit_0 = xXrNit_2;
-
1256 // xXrNit_2 = xXfNit_0;
-
1257}
-
1258
-
1259//------------------------------------------------------------------------------
-
1260//
-
1261// Modifiers
-
1262//
-
1263//------------------------------------------------------------------------------
-
1264
-
1265template <class Container, class Values>
-
1266void
-
1267aged_associative_container_test_base::checkInsertCopy(
-
1268 Container& c,
-
1269 Values const& v)
-
1270{
-
1271 for (auto const& e : v)
-
1272 c.insert(e);
-
1273 checkContents(c, v);
-
1274}
-
1275
-
1276template <class Container, class Values>
-
1277void
-
1278aged_associative_container_test_base::checkInsertMove(
-
1279 Container& c,
-
1280 Values const& v)
-
1281{
-
1282 Values v2(v);
-
1283 for (auto& e : v2)
-
1284 c.insert(std::move(e));
-
1285 checkContents(c, v);
-
1286}
-
1287
-
1288template <class Container, class Values>
-
1289void
-
1290aged_associative_container_test_base::checkInsertHintCopy(
-
1291 Container& c,
-
1292 Values const& v)
-
1293{
-
1294 for (auto const& e : v)
-
1295 c.insert(c.cend(), e);
-
1296 checkContents(c, v);
-
1297}
-
1298
-
1299template <class Container, class Values>
-
1300void
-
1301aged_associative_container_test_base::checkInsertHintMove(
-
1302 Container& c,
-
1303 Values const& v)
-
1304{
-
1305 Values v2(v);
-
1306 for (auto& e : v2)
-
1307 c.insert(c.cend(), std::move(e));
-
1308 checkContents(c, v);
-
1309}
+
1190 // The standard allows these conversions:
+
1191 // o reverse_iterator is explicitly constructible from iterator.
+
1192 // o const_reverse_iterator is explicitly constructible from
+
1193 // const_iterator.
+
1194 // Should be able to construct or assign reverse_iterators from
+
1195 // non-reverse iterators.
+
1196 reverse_iterator fNrNit_0{c.begin()};
+
1197 const_reverse_iterator fNrCit_0{c.begin()};
+
1198 BEAST_EXPECT(fNrNit_0 == fNrCit_0);
+
1199 const_reverse_iterator fCrCit_0{c.cbegin()};
+
1200 BEAST_EXPECT(fNrCit_0 == fCrCit_0);
+
1201
+
1202 // None of these should compile because they construct a non-reverse
+
1203 // iterator from a reverse_iterator.
+
1204 // iterator rNfNit_0 {c.rbegin()};
+
1205 // const_iterator rNfCit_0 {c.rbegin()};
+
1206 // const_iterator rCfCit_0 {c.crbegin()};
+
1207
+
1208 // You should not be able to assign an iterator to a reverse_iterator or
+
1209 // vise-versa. So the following lines should not compile.
+
1210 iterator xXfNit_0;
+
1211 // xXfNit_0 = xXrNit_2;
+
1212 // xXrNit_2 = xXfNit_0;
+
1213}
+
1214
+
1215//------------------------------------------------------------------------------
+
1216//
+
1217// Modifiers
+
1218//
+
1219//------------------------------------------------------------------------------
+
1220
+
1221template <class Container, class Values>
+
1222void
+
1223aged_associative_container_test_base::checkInsertCopy(
+
1224 Container& c,
+
1225 Values const& v)
+
1226{
+
1227 for (auto const& e : v)
+
1228 c.insert(e);
+
1229 checkContents(c, v);
+
1230}
+
1231
+
1232template <class Container, class Values>
+
1233void
+
1234aged_associative_container_test_base::checkInsertMove(
+
1235 Container& c,
+
1236 Values const& v)
+
1237{
+
1238 Values v2(v);
+
1239 for (auto& e : v2)
+
1240 c.insert(std::move(e));
+
1241 checkContents(c, v);
+
1242}
+
1243
+
1244template <class Container, class Values>
+
1245void
+
1246aged_associative_container_test_base::checkInsertHintCopy(
+
1247 Container& c,
+
1248 Values const& v)
+
1249{
+
1250 for (auto const& e : v)
+
1251 c.insert(c.cend(), e);
+
1252 checkContents(c, v);
+
1253}
+
1254
+
1255template <class Container, class Values>
+
1256void
+
1257aged_associative_container_test_base::checkInsertHintMove(
+
1258 Container& c,
+
1259 Values const& v)
+
1260{
+
1261 Values v2(v);
+
1262 for (auto& e : v2)
+
1263 c.insert(c.cend(), std::move(e));
+
1264 checkContents(c, v);
+
1265}
+
1266
+
1267template <class Container, class Values>
+
1268void
+
1269aged_associative_container_test_base::checkEmplace(
+
1270 Container& c,
+
1271 Values const& v)
+
1272{
+
1273 for (auto const& e : v)
+
1274 c.emplace(e);
+
1275 checkContents(c, v);
+
1276}
+
1277
+
1278template <class Container, class Values>
+
1279void
+
1280aged_associative_container_test_base::checkEmplaceHint(
+
1281 Container& c,
+
1282 Values const& v)
+
1283{
+
1284 for (auto const& e : v)
+
1285 c.emplace_hint(c.cend(), e);
+
1286 checkContents(c, v);
+
1287}
+
1288
+
1289template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1290void
+
1291aged_associative_container_test_base::testModifiers()
+
1292{
+
1293 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1294 typename Traits::ManualClock clock;
+
1295 auto const v(Traits::values());
+
1296 auto const l(make_list(v));
+
1297
+
1298 // testcase (Traits::name() + " modify");
+
1299 testcase("modify");
+
1300
+
1301 {
+
1302 typename Traits::template Cont<> c(clock);
+
1303 checkInsertCopy(c, v);
+
1304 }
+
1305
+
1306 {
+
1307 typename Traits::template Cont<> c(clock);
+
1308 checkInsertCopy(c, l);
+
1309 }
1310
-
1311template <class Container, class Values>
-
1312void
-
1313aged_associative_container_test_base::checkEmplace(
-
1314 Container& c,
-
1315 Values const& v)
-
1316{
-
1317 for (auto const& e : v)
-
1318 c.emplace(e);
-
1319 checkContents(c, v);
-
1320}
-
1321
-
1322template <class Container, class Values>
-
1323void
-
1324aged_associative_container_test_base::checkEmplaceHint(
-
1325 Container& c,
-
1326 Values const& v)
-
1327{
-
1328 for (auto const& e : v)
-
1329 c.emplace_hint(c.cend(), e);
-
1330 checkContents(c, v);
-
1331}
-
1332
-
1333template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1334void
-
1335aged_associative_container_test_base::testModifiers()
-
1336{
-
1337 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1338 typename Traits::ManualClock clock;
-
1339 auto const v(Traits::values());
-
1340 auto const l(make_list(v));
+
1311 {
+
1312 typename Traits::template Cont<> c(clock);
+
1313 checkInsertMove(c, v);
+
1314 }
+
1315
+
1316 {
+
1317 typename Traits::template Cont<> c(clock);
+
1318 checkInsertMove(c, l);
+
1319 }
+
1320
+
1321 {
+
1322 typename Traits::template Cont<> c(clock);
+
1323 checkInsertHintCopy(c, v);
+
1324 }
+
1325
+
1326 {
+
1327 typename Traits::template Cont<> c(clock);
+
1328 checkInsertHintCopy(c, l);
+
1329 }
+
1330
+
1331 {
+
1332 typename Traits::template Cont<> c(clock);
+
1333 checkInsertHintMove(c, v);
+
1334 }
+
1335
+
1336 {
+
1337 typename Traits::template Cont<> c(clock);
+
1338 checkInsertHintMove(c, l);
+
1339 }
+
1340}
1341
-
1342 // testcase (Traits::name() + " modify");
-
1343 testcase("modify");
-
1344
-
1345 {
-
1346 typename Traits::template Cont<> c(clock);
-
1347 checkInsertCopy(c, v);
-
1348 }
-
1349
-
1350 {
-
1351 typename Traits::template Cont<> c(clock);
-
1352 checkInsertCopy(c, l);
-
1353 }
-
1354
-
1355 {
-
1356 typename Traits::template Cont<> c(clock);
-
1357 checkInsertMove(c, v);
-
1358 }
-
1359
-
1360 {
-
1361 typename Traits::template Cont<> c(clock);
-
1362 checkInsertMove(c, l);
-
1363 }
-
1364
-
1365 {
-
1366 typename Traits::template Cont<> c(clock);
-
1367 checkInsertHintCopy(c, v);
-
1368 }
-
1369
+
1342//------------------------------------------------------------------------------
+
1343//
+
1344// Chronological ordering
+
1345//
+
1346//------------------------------------------------------------------------------
+
1347
+
1348template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1349void
+
1350aged_associative_container_test_base::testChronological()
+
1351{
+
1352 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1353 typename Traits::ManualClock clock;
+
1354 auto const v(Traits::values());
+
1355
+
1356 // testcase (Traits::name() + " chronological");
+
1357 testcase("chronological");
+
1358
+
1359 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
+
1360
+
1361 BEAST_EXPECT(std::equal(
+
1362 c.chronological.cbegin(),
+
1363 c.chronological.cend(),
+
1364 v.begin(),
+
1365 v.end(),
+
1366 equal_value<Traits>()));
+
1367
+
1368 // Test touch() with a non-const iterator.
+
1369 for (auto iter(v.crbegin()); iter != v.crend(); ++iter)
1370 {
-
1371 typename Traits::template Cont<> c(clock);
-
1372 checkInsertHintCopy(c, l);
-
1373 }
-
1374
-
1375 {
-
1376 typename Traits::template Cont<> c(clock);
-
1377 checkInsertHintMove(c, v);
+
1371 using iterator = typename decltype(c)::iterator;
+
1372 iterator found(c.find(Traits::extract(*iter)));
+
1373
+
1374 BEAST_EXPECT(found != c.cend());
+
1375 if (found == c.cend())
+
1376 return;
+
1377 c.touch(found);
1378 }
1379
-
1380 {
-
1381 typename Traits::template Cont<> c(clock);
-
1382 checkInsertHintMove(c, l);
-
1383 }
-
1384}
-
1385
-
1386//------------------------------------------------------------------------------
-
1387//
-
1388// Chronological ordering
-
1389//
-
1390//------------------------------------------------------------------------------
-
1391
-
1392template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1393void
-
1394aged_associative_container_test_base::testChronological()
-
1395{
-
1396 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1397 using Value = typename Traits::Value;
-
1398 typename Traits::ManualClock clock;
-
1399 auto const v(Traits::values());
-
1400
-
1401 // testcase (Traits::name() + " chronological");
-
1402 testcase("chronological");
-
1403
-
1404 typename Traits::template Cont<> c(v.begin(), v.end(), clock);
+
1380 BEAST_EXPECT(std::equal(
+
1381 c.chronological.cbegin(),
+
1382 c.chronological.cend(),
+
1383 v.crbegin(),
+
1384 v.crend(),
+
1385 equal_value<Traits>()));
+
1386
+
1387 // Test touch() with a const_iterator
+
1388 for (auto iter(v.cbegin()); iter != v.cend(); ++iter)
+
1389 {
+
1390 using const_iterator = typename decltype(c)::const_iterator;
+
1391 const_iterator found(c.find(Traits::extract(*iter)));
+
1392
+
1393 BEAST_EXPECT(found != c.cend());
+
1394 if (found == c.cend())
+
1395 return;
+
1396 c.touch(found);
+
1397 }
+
1398
+
1399 BEAST_EXPECT(std::equal(
+
1400 c.chronological.cbegin(),
+
1401 c.chronological.cend(),
+
1402 v.cbegin(),
+
1403 v.cend(),
+
1404 equal_value<Traits>()));
1405
-
1406 BEAST_EXPECT(std::equal(
-
1407 c.chronological.cbegin(),
-
1408 c.chronological.cend(),
-
1409 v.begin(),
-
1410 v.end(),
-
1411 equal_value<Traits>()));
-
1412
-
1413 // Test touch() with a non-const iterator.
-
1414 for (auto iter(v.crbegin()); iter != v.crend(); ++iter)
-
1415 {
-
1416 using iterator = typename decltype(c)::iterator;
-
1417 iterator found(c.find(Traits::extract(*iter)));
-
1418
-
1419 BEAST_EXPECT(found != c.cend());
-
1420 if (found == c.cend())
-
1421 return;
-
1422 c.touch(found);
-
1423 }
-
1424
-
1425 BEAST_EXPECT(std::equal(
-
1426 c.chronological.cbegin(),
-
1427 c.chronological.cend(),
-
1428 v.crbegin(),
-
1429 v.crend(),
-
1430 equal_value<Traits>()));
+
1406 {
+
1407 // Because touch (reverse_iterator pos) is not allowed, the following
+
1408 // lines should not compile for any aged_container type.
+
1409 // c.touch (c.rbegin());
+
1410 // c.touch (c.crbegin());
+
1411 }
+
1412}
+
1413
+
1414//------------------------------------------------------------------------------
+
1415//
+
1416// Element creation via operator[]
+
1417//
+
1418//------------------------------------------------------------------------------
+
1419
+
1420// map, unordered_map
+
1421template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1422typename std::enable_if<IsMap && !IsMulti>::type
+
1423aged_associative_container_test_base::testArrayCreate()
+
1424{
+
1425 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1426 typename Traits::ManualClock clock;
+
1427 auto v(Traits::values());
+
1428
+
1429 // testcase (Traits::name() + " array create");
+
1430 testcase("array create");
1431
-
1432 // Test touch() with a const_iterator
-
1433 for (auto iter(v.cbegin()); iter != v.cend(); ++iter)
-
1434 {
-
1435 using const_iterator = typename decltype(c)::const_iterator;
-
1436 const_iterator found(c.find(Traits::extract(*iter)));
-
1437
-
1438 BEAST_EXPECT(found != c.cend());
-
1439 if (found == c.cend())
-
1440 return;
-
1441 c.touch(found);
-
1442 }
-
1443
-
1444 BEAST_EXPECT(std::equal(
-
1445 c.chronological.cbegin(),
-
1446 c.chronological.cend(),
-
1447 v.cbegin(),
-
1448 v.cend(),
-
1449 equal_value<Traits>()));
-
1450
-
1451 {
-
1452 // Because touch (reverse_iterator pos) is not allowed, the following
-
1453 // lines should not compile for any aged_container type.
-
1454 // c.touch (c.rbegin());
-
1455 // c.touch (c.crbegin());
-
1456 }
-
1457}
-
1458
-
1459//------------------------------------------------------------------------------
-
1460//
-
1461// Element creation via operator[]
-
1462//
-
1463//------------------------------------------------------------------------------
-
1464
-
1465// map, unordered_map
-
1466template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1467typename std::enable_if<IsMap && !IsMulti>::type
-
1468aged_associative_container_test_base::testArrayCreate()
-
1469{
-
1470 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1471 typename Traits::ManualClock clock;
-
1472 auto v(Traits::values());
-
1473
-
1474 // testcase (Traits::name() + " array create");
-
1475 testcase("array create");
-
1476
-
1477 {
-
1478 // Copy construct key
-
1479 typename Traits::template Cont<> c(clock);
-
1480 for (auto e : v)
-
1481 c[e.first] = e.second;
-
1482 checkContents(c, v);
-
1483 }
-
1484
-
1485 {
-
1486 // Move construct key
-
1487 typename Traits::template Cont<> c(clock);
-
1488 for (auto e : v)
-
1489 c[std::move(e.first)] = e.second;
-
1490 checkContents(c, v);
-
1491 }
-
1492}
-
1493
-
1494//------------------------------------------------------------------------------
-
1495//
-
1496// Helpers for erase tests
-
1497//
-
1498//------------------------------------------------------------------------------
-
1499
-
1500template <class Container, class Values>
-
1501void
-
1502aged_associative_container_test_base::reverseFillAgedContainer(
-
1503 Container& c,
-
1504 Values const& values)
-
1505{
-
1506 // Just in case the passed in container was not empty.
-
1507 c.clear();
-
1508
-
1509 // c.clock() returns an abstract_clock, so dynamic_cast to manual_clock.
-
1510 // VFALCO NOTE This is sketchy
-
1511 using ManualClock = TestTraitsBase::ManualClock;
-
1512 ManualClock& clk(dynamic_cast<ManualClock&>(c.clock()));
-
1513 clk.set(0);
-
1514
-
1515 Values rev(values);
-
1516 std::sort(rev.begin(), rev.end());
-
1517 std::reverse(rev.begin(), rev.end());
-
1518 for (auto& v : rev)
-
1519 {
-
1520 // Add values in reverse order so they are reversed chronologically.
-
1521 ++clk;
-
1522 c.insert(v);
-
1523 }
-
1524}
-
1525
-
1526// Get one iterator before endIter. We have to use operator++ because you
-
1527// cannot use operator-- with unordered container iterators.
-
1528template <class Iter>
-
1529Iter
-
1530aged_associative_container_test_base::nextToEndIter(
-
1531 Iter beginIter,
-
1532 Iter const endIter)
-
1533{
-
1534 if (beginIter == endIter)
-
1535 {
-
1536 fail("Internal test failure. Cannot advance beginIter");
-
1537 return beginIter;
-
1538 }
-
1539
-
1540 //
-
1541 Iter nextToEnd = beginIter;
-
1542 do
-
1543 {
-
1544 nextToEnd = beginIter++;
-
1545 } while (beginIter != endIter);
-
1546 return nextToEnd;
-
1547}
-
1548
-
1549// Implementation for the element erase tests
-
1550//
-
1551// This test accepts:
-
1552// o the container from which we will erase elements
-
1553// o iterators into that container defining the range of the erase
-
1554//
-
1555// This implementation does not declare a pass, since it wants to allow
-
1556// the caller to examine the size of the container and the returned iterator
-
1557//
-
1558// Note that this test works on the aged_associative containers because an
-
1559// erase only invalidates references and iterators to the erased element
-
1560// (see 23.2.4/13). Therefore the passed-in end iterator stays valid through
-
1561// the whole test.
-
1562template <class Container, class Iter>
-
1563bool
-
1564aged_associative_container_test_base::doElementErase(
-
1565 Container& c,
-
1566 Iter const beginItr,
-
1567 Iter const endItr)
-
1568{
-
1569 auto it(beginItr);
-
1570 size_t count = c.size();
-
1571 while (it != endItr)
-
1572 {
-
1573 auto expectIt = it;
-
1574 ++expectIt;
-
1575 it = c.erase(it);
+
1432 {
+
1433 // Copy construct key
+
1434 typename Traits::template Cont<> c(clock);
+
1435 for (auto e : v)
+
1436 c[e.first] = e.second;
+
1437 checkContents(c, v);
+
1438 }
+
1439
+
1440 {
+
1441 // Move construct key
+
1442 typename Traits::template Cont<> c(clock);
+
1443 for (auto e : v)
+
1444 c[std::move(e.first)] = e.second;
+
1445 checkContents(c, v);
+
1446 }
+
1447}
+
1448
+
1449//------------------------------------------------------------------------------
+
1450//
+
1451// Helpers for erase tests
+
1452//
+
1453//------------------------------------------------------------------------------
+
1454
+
1455template <class Container, class Values>
+
1456void
+
1457aged_associative_container_test_base::reverseFillAgedContainer(
+
1458 Container& c,
+
1459 Values const& values)
+
1460{
+
1461 // Just in case the passed in container was not empty.
+
1462 c.clear();
+
1463
+
1464 // c.clock() returns an abstract_clock, so dynamic_cast to manual_clock.
+
1465 // VFALCO NOTE This is sketchy
+
1466 using ManualClock = TestTraitsBase::ManualClock;
+
1467 ManualClock& clk(dynamic_cast<ManualClock&>(c.clock()));
+
1468 clk.set(0);
+
1469
+
1470 Values rev(values);
+
1471 std::sort(rev.begin(), rev.end());
+
1472 std::reverse(rev.begin(), rev.end());
+
1473 for (auto& v : rev)
+
1474 {
+
1475 // Add values in reverse order so they are reversed chronologically.
+
1476 ++clk;
+
1477 c.insert(v);
+
1478 }
+
1479}
+
1480
+
1481// Get one iterator before endIter. We have to use operator++ because you
+
1482// cannot use operator-- with unordered container iterators.
+
1483template <class Iter>
+
1484Iter
+
1485aged_associative_container_test_base::nextToEndIter(
+
1486 Iter beginIter,
+
1487 Iter const endIter)
+
1488{
+
1489 if (beginIter == endIter)
+
1490 {
+
1491 fail("Internal test failure. Cannot advance beginIter");
+
1492 return beginIter;
+
1493 }
+
1494
+
1495 //
+
1496 Iter nextToEnd = beginIter;
+
1497 do
+
1498 {
+
1499 nextToEnd = beginIter++;
+
1500 } while (beginIter != endIter);
+
1501 return nextToEnd;
+
1502}
+
1503
+
1504// Implementation for the element erase tests
+
1505//
+
1506// This test accepts:
+
1507// o the container from which we will erase elements
+
1508// o iterators into that container defining the range of the erase
+
1509//
+
1510// This implementation does not declare a pass, since it wants to allow
+
1511// the caller to examine the size of the container and the returned iterator
+
1512//
+
1513// Note that this test works on the aged_associative containers because an
+
1514// erase only invalidates references and iterators to the erased element
+
1515// (see 23.2.4/13). Therefore the passed-in end iterator stays valid through
+
1516// the whole test.
+
1517template <class Container, class Iter>
+
1518bool
+
1519aged_associative_container_test_base::doElementErase(
+
1520 Container& c,
+
1521 Iter const beginItr,
+
1522 Iter const endItr)
+
1523{
+
1524 auto it(beginItr);
+
1525 size_t count = c.size();
+
1526 while (it != endItr)
+
1527 {
+
1528 auto expectIt = it;
+
1529 ++expectIt;
+
1530 it = c.erase(it);
+
1531
+
1532 if (it != expectIt)
+
1533 {
+
1534 fail("Unexpected returned iterator from element erase");
+
1535 return false;
+
1536 }
+
1537
+
1538 --count;
+
1539 if (count != c.size())
+
1540 {
+
1541 fail("Failed to erase element");
+
1542 return false;
+
1543 }
+
1544
+
1545 if (c.empty())
+
1546 {
+
1547 if (it != endItr)
+
1548 {
+
1549 fail("Erase of last element didn't produce end");
+
1550 return false;
+
1551 }
+
1552 }
+
1553 }
+
1554 return true;
+
1555}
+
1556
+
1557//------------------------------------------------------------------------------
+
1558//
+
1559// Erase of individual elements
+
1560//
+
1561//------------------------------------------------------------------------------
+
1562
+
1563template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1564void
+
1565aged_associative_container_test_base::testElementErase()
+
1566{
+
1567 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1568
+
1569 // testcase (Traits::name() + " element erase"
+
1570 testcase("element erase");
+
1571
+
1572 // Make and fill the container
+
1573 typename Traits::ManualClock clock;
+
1574 typename Traits::template Cont<> c{clock};
+
1575 reverseFillAgedContainer(c, Traits::values());
1576
-
1577 if (it != expectIt)
-
1578 {
-
1579 fail("Unexpected returned iterator from element erase");
-
1580 return false;
-
1581 }
-
1582
-
1583 --count;
-
1584 if (count != c.size())
-
1585 {
-
1586 fail("Failed to erase element");
-
1587 return false;
-
1588 }
-
1589
-
1590 if (c.empty())
-
1591 {
-
1592 if (it != endItr)
-
1593 {
-
1594 fail("Erase of last element didn't produce end");
-
1595 return false;
-
1596 }
-
1597 }
-
1598 }
-
1599 return true;
-
1600}
-
1601
-
1602//------------------------------------------------------------------------------
-
1603//
-
1604// Erase of individual elements
-
1605//
-
1606//------------------------------------------------------------------------------
-
1607
-
1608template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1609void
-
1610aged_associative_container_test_base::testElementErase()
-
1611{
-
1612 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1613
-
1614 // testcase (Traits::name() + " element erase"
-
1615 testcase("element erase");
-
1616
-
1617 // Make and fill the container
-
1618 typename Traits::ManualClock clock;
-
1619 typename Traits::template Cont<> c{clock};
-
1620 reverseFillAgedContainer(c, Traits::values());
-
1621
-
1622 {
-
1623 // Test standard iterators
-
1624 auto tempContainer(c);
-
1625 if (!doElementErase(
-
1626 tempContainer, tempContainer.cbegin(), tempContainer.cend()))
-
1627 return; // Test failed
-
1628
-
1629 BEAST_EXPECT(tempContainer.empty());
-
1630 pass();
-
1631 }
-
1632 {
-
1633 // Test chronological iterators
-
1634 auto tempContainer(c);
-
1635 auto& chron(tempContainer.chronological);
-
1636 if (!doElementErase(tempContainer, chron.begin(), chron.end()))
-
1637 return; // Test failed
-
1638
-
1639 BEAST_EXPECT(tempContainer.empty());
-
1640 pass();
-
1641 }
-
1642 {
-
1643 // Test standard iterator partial erase
-
1644 auto tempContainer(c);
-
1645 BEAST_EXPECT(tempContainer.size() > 2);
-
1646 if (!doElementErase(
-
1647 tempContainer,
-
1648 ++tempContainer.begin(),
-
1649 nextToEndIter(tempContainer.begin(), tempContainer.end())))
-
1650 return; // Test failed
-
1651
-
1652 BEAST_EXPECT(tempContainer.size() == 2);
-
1653 pass();
-
1654 }
-
1655 {
-
1656 // Test chronological iterator partial erase
-
1657 auto tempContainer(c);
-
1658 BEAST_EXPECT(tempContainer.size() > 2);
-
1659 auto& chron(tempContainer.chronological);
-
1660 if (!doElementErase(
-
1661 tempContainer,
-
1662 ++chron.begin(),
-
1663 nextToEndIter(chron.begin(), chron.end())))
-
1664 return; // Test failed
+
1577 {
+
1578 // Test standard iterators
+
1579 auto tempContainer(c);
+
1580 if (!doElementErase(
+
1581 tempContainer, tempContainer.cbegin(), tempContainer.cend()))
+
1582 return; // Test failed
+
1583
+
1584 BEAST_EXPECT(tempContainer.empty());
+
1585 pass();
+
1586 }
+
1587 {
+
1588 // Test chronological iterators
+
1589 auto tempContainer(c);
+
1590 auto& chron(tempContainer.chronological);
+
1591 if (!doElementErase(tempContainer, chron.begin(), chron.end()))
+
1592 return; // Test failed
+
1593
+
1594 BEAST_EXPECT(tempContainer.empty());
+
1595 pass();
+
1596 }
+
1597 {
+
1598 // Test standard iterator partial erase
+
1599 auto tempContainer(c);
+
1600 BEAST_EXPECT(tempContainer.size() > 2);
+
1601 if (!doElementErase(
+
1602 tempContainer,
+
1603 ++tempContainer.begin(),
+
1604 nextToEndIter(tempContainer.begin(), tempContainer.end())))
+
1605 return; // Test failed
+
1606
+
1607 BEAST_EXPECT(tempContainer.size() == 2);
+
1608 pass();
+
1609 }
+
1610 {
+
1611 // Test chronological iterator partial erase
+
1612 auto tempContainer(c);
+
1613 BEAST_EXPECT(tempContainer.size() > 2);
+
1614 auto& chron(tempContainer.chronological);
+
1615 if (!doElementErase(
+
1616 tempContainer,
+
1617 ++chron.begin(),
+
1618 nextToEndIter(chron.begin(), chron.end())))
+
1619 return; // Test failed
+
1620
+
1621 BEAST_EXPECT(tempContainer.size() == 2);
+
1622 pass();
+
1623 }
+
1624 {
+
1625 auto tempContainer(c);
+
1626 BEAST_EXPECT(tempContainer.size() > 4);
+
1627 // erase(reverse_iterator) is not allowed. None of the following
+
1628 // should compile for any aged_container type.
+
1629 // c.erase (c.rbegin());
+
1630 // c.erase (c.crbegin());
+
1631 // c.erase(c.rbegin(), ++c.rbegin());
+
1632 // c.erase(c.crbegin(), ++c.crbegin());
+
1633 }
+
1634}
+
1635
+
1636// Implementation for the range erase tests
+
1637//
+
1638// This test accepts:
+
1639//
+
1640// o A container with more than 2 elements and
+
1641// o An object to ask for begin() and end() iterators in the passed container
+
1642//
+
1643// This peculiar interface allows either the container itself to be passed as
+
1644// the second argument or the container's "chronological" element. Both
+
1645// sources of iterators need to be tested on the container.
+
1646//
+
1647// The test locates iterators such that a range-based delete leaves the first
+
1648// and last elements in the container. It then validates that the container
+
1649// ended up with the expected contents.
+
1650//
+
1651template <class Container, class BeginEndSrc>
+
1652void
+
1653aged_associative_container_test_base::doRangeErase(
+
1654 Container& c,
+
1655 BeginEndSrc const& beginEndSrc)
+
1656{
+
1657 BEAST_EXPECT(c.size() > 2);
+
1658 auto itBeginPlusOne(beginEndSrc.begin());
+
1659 auto const valueFront = *itBeginPlusOne;
+
1660 ++itBeginPlusOne;
+
1661
+
1662 // Get one iterator before end()
+
1663 auto itBack(nextToEndIter(itBeginPlusOne, beginEndSrc.end()));
+
1664 auto const valueBack = *itBack;
1665
-
1666 BEAST_EXPECT(tempContainer.size() == 2);
-
1667 pass();
-
1668 }
-
1669 {
-
1670 auto tempContainer(c);
-
1671 BEAST_EXPECT(tempContainer.size() > 4);
-
1672 // erase(reverse_iterator) is not allowed. None of the following
-
1673 // should compile for any aged_container type.
-
1674 // c.erase (c.rbegin());
-
1675 // c.erase (c.crbegin());
-
1676 // c.erase(c.rbegin(), ++c.rbegin());
-
1677 // c.erase(c.crbegin(), ++c.crbegin());
-
1678 }
-
1679}
+
1666 // Erase all elements but first and last
+
1667 auto const retIter = c.erase(itBeginPlusOne, itBack);
+
1668
+
1669 BEAST_EXPECT(c.size() == 2);
+
1670 BEAST_EXPECT(valueFront == *(beginEndSrc.begin()));
+
1671 BEAST_EXPECT(valueBack == *(++beginEndSrc.begin()));
+
1672 BEAST_EXPECT(retIter == (++beginEndSrc.begin()));
+
1673}
+
1674
+
1675//------------------------------------------------------------------------------
+
1676//
+
1677// Erase range of elements
+
1678//
+
1679//------------------------------------------------------------------------------
1680
-
1681// Implementation for the range erase tests
-
1682//
-
1683// This test accepts:
-
1684//
-
1685// o A container with more than 2 elements and
-
1686// o An object to ask for begin() and end() iterators in the passed container
-
1687//
-
1688// This peculiar interface allows either the container itself to be passed as
-
1689// the second argument or the container's "chronological" element. Both
-
1690// sources of iterators need to be tested on the container.
-
1691//
-
1692// The test locates iterators such that a range-based delete leaves the first
-
1693// and last elements in the container. It then validates that the container
-
1694// ended up with the expected contents.
-
1695//
-
1696template <class Container, class BeginEndSrc>
-
1697void
-
1698aged_associative_container_test_base::doRangeErase(
-
1699 Container& c,
-
1700 BeginEndSrc const& beginEndSrc)
-
1701{
-
1702 BEAST_EXPECT(c.size() > 2);
-
1703 auto itBeginPlusOne(beginEndSrc.begin());
-
1704 auto const valueFront = *itBeginPlusOne;
-
1705 ++itBeginPlusOne;
-
1706
-
1707 // Get one iterator before end()
-
1708 auto itBack(nextToEndIter(itBeginPlusOne, beginEndSrc.end()));
-
1709 auto const valueBack = *itBack;
-
1710
-
1711 // Erase all elements but first and last
-
1712 auto const retIter = c.erase(itBeginPlusOne, itBack);
-
1713
-
1714 BEAST_EXPECT(c.size() == 2);
-
1715 BEAST_EXPECT(valueFront == *(beginEndSrc.begin()));
-
1716 BEAST_EXPECT(valueBack == *(++beginEndSrc.begin()));
-
1717 BEAST_EXPECT(retIter == (++beginEndSrc.begin()));
-
1718}
-
1719
-
1720//------------------------------------------------------------------------------
-
1721//
-
1722// Erase range of elements
-
1723//
-
1724//------------------------------------------------------------------------------
+
1681template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1682void
+
1683aged_associative_container_test_base::testRangeErase()
+
1684{
+
1685 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1686
+
1687 // testcase (Traits::name() + " element erase"
+
1688 testcase("range erase");
+
1689
+
1690 // Make and fill the container
+
1691 typename Traits::ManualClock clock;
+
1692 typename Traits::template Cont<> c{clock};
+
1693 reverseFillAgedContainer(c, Traits::values());
+
1694
+
1695 // Not bothering to test range erase with reverse iterators.
+
1696 {
+
1697 auto tempContainer(c);
+
1698 doRangeErase(tempContainer, tempContainer);
+
1699 }
+
1700 {
+
1701 auto tempContainer(c);
+
1702 doRangeErase(tempContainer, tempContainer.chronological);
+
1703 }
+
1704}
+
1705
+
1706//------------------------------------------------------------------------------
+
1707//
+
1708// Container-wide comparison
+
1709//
+
1710//------------------------------------------------------------------------------
+
1711
+
1712// ordered
+
1713template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1714typename std::enable_if<!IsUnordered>::type
+
1715aged_associative_container_test_base::testCompare()
+
1716{
+
1717 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1718 typename Traits::ManualClock clock;
+
1719 auto const v(Traits::values());
+
1720
+
1721 // testcase (Traits::name() + " array create");
+
1722 testcase("array create");
+
1723
+
1724 typename Traits::template Cont<> c1(v.begin(), v.end(), clock);
1725
-
1726template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1727void
-
1728aged_associative_container_test_base::testRangeErase()
-
1729{
-
1730 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1731
-
1732 // testcase (Traits::name() + " element erase"
-
1733 testcase("range erase");
-
1734
-
1735 // Make and fill the container
-
1736 typename Traits::ManualClock clock;
-
1737 typename Traits::template Cont<> c{clock};
-
1738 reverseFillAgedContainer(c, Traits::values());
-
1739
-
1740 // Not bothering to test range erase with reverse iterators.
-
1741 {
-
1742 auto tempContainer(c);
-
1743 doRangeErase(tempContainer, tempContainer);
-
1744 }
-
1745 {
-
1746 auto tempContainer(c);
-
1747 doRangeErase(tempContainer, tempContainer.chronological);
-
1748 }
-
1749}
+
1726 typename Traits::template Cont<> c2(v.begin(), v.end(), clock);
+
1727 c2.erase(c2.cbegin());
+
1728
+
1729 expect(c1 != c2);
+
1730 unexpected(c1 == c2);
+
1731 expect(c1 < c2);
+
1732 expect(c1 <= c2);
+
1733 unexpected(c1 > c2);
+
1734 unexpected(c1 >= c2);
+
1735}
+
1736
+
1737//------------------------------------------------------------------------------
+
1738//
+
1739// Observers
+
1740//
+
1741//------------------------------------------------------------------------------
+
1742
+
1743// ordered
+
1744template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1745typename std::enable_if<!IsUnordered>::type
+
1746aged_associative_container_test_base::testObservers()
+
1747{
+
1748 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1749 typename Traits::ManualClock clock;
1750
-
1751//------------------------------------------------------------------------------
-
1752//
-
1753// Container-wide comparison
-
1754//
-
1755//------------------------------------------------------------------------------
-
1756
-
1757// ordered
-
1758template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1759typename std::enable_if<!IsUnordered>::type
-
1760aged_associative_container_test_base::testCompare()
-
1761{
-
1762 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1763 using Value = typename Traits::Value;
-
1764 typename Traits::ManualClock clock;
-
1765 auto const v(Traits::values());
-
1766
-
1767 // testcase (Traits::name() + " array create");
-
1768 testcase("array create");
-
1769
-
1770 typename Traits::template Cont<> c1(v.begin(), v.end(), clock);
+
1751 // testcase (Traits::name() + " observers");
+
1752 testcase("observers");
+
1753
+
1754 typename Traits::template Cont<> c(clock);
+
1755 c.key_comp();
+
1756 c.value_comp();
+
1757
+
1758 pass();
+
1759}
+
1760
+
1761// unordered
+
1762template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1763typename std::enable_if<IsUnordered>::type
+
1764aged_associative_container_test_base::testObservers()
+
1765{
+
1766 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
+
1767 typename Traits::ManualClock clock;
+
1768
+
1769 // testcase (Traits::name() + " observers");
+
1770 testcase("observers");
1771
-
1772 typename Traits::template Cont<> c2(v.begin(), v.end(), clock);
-
1773 c2.erase(c2.cbegin());
-
1774
-
1775 expect(c1 != c2);
-
1776 unexpected(c1 == c2);
-
1777 expect(c1 < c2);
-
1778 expect(c1 <= c2);
-
1779 unexpected(c1 > c2);
-
1780 unexpected(c1 >= c2);
-
1781}
-
1782
+
1772 typename Traits::template Cont<> c(clock);
+
1773 c.hash_function();
+
1774 c.key_eq();
+
1775
+
1776 pass();
+
1777}
+
1778
+
1779//------------------------------------------------------------------------------
+
1780//
+
1781// Matrix
+
1782//
1783//------------------------------------------------------------------------------
-
1784//
-
1785// Observers
-
1786//
-
1787//------------------------------------------------------------------------------
-
1788
-
1789// ordered
-
1790template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1791typename std::enable_if<!IsUnordered>::type
-
1792aged_associative_container_test_base::testObservers()
-
1793{
-
1794 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1795 typename Traits::ManualClock clock;
-
1796
-
1797 // testcase (Traits::name() + " observers");
-
1798 testcase("observers");
-
1799
-
1800 typename Traits::template Cont<> c(clock);
-
1801 c.key_comp();
-
1802 c.value_comp();
+
1784
+
1785template <bool IsUnordered, bool IsMulti, bool IsMap>
+
1786void
+
1787aged_associative_container_test_base::testMaybeUnorderedMultiMap()
+
1788{
+
1789 testConstructEmpty<IsUnordered, IsMulti, IsMap>();
+
1790 testConstructRange<IsUnordered, IsMulti, IsMap>();
+
1791 testConstructInitList<IsUnordered, IsMulti, IsMap>();
+
1792 testCopyMove<IsUnordered, IsMulti, IsMap>();
+
1793 testIterator<IsUnordered, IsMulti, IsMap>();
+
1794 testReverseIterator<IsUnordered, IsMulti, IsMap>();
+
1795 testModifiers<IsUnordered, IsMulti, IsMap>();
+
1796 testChronological<IsUnordered, IsMulti, IsMap>();
+
1797 testArrayCreate<IsUnordered, IsMulti, IsMap>();
+
1798 testElementErase<IsUnordered, IsMulti, IsMap>();
+
1799 testRangeErase<IsUnordered, IsMulti, IsMap>();
+
1800 testCompare<IsUnordered, IsMulti, IsMap>();
+
1801 testObservers<IsUnordered, IsMulti, IsMap>();
+
1802}
1803
-
1804 pass();
-
1805}
-
1806
-
1807// unordered
-
1808template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1809typename std::enable_if<IsUnordered>::type
-
1810aged_associative_container_test_base::testObservers()
-
1811{
-
1812 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1813 typename Traits::ManualClock clock;
-
1814
-
1815 // testcase (Traits::name() + " observers");
-
1816 testcase("observers");
-
1817
-
1818 typename Traits::template Cont<> c(clock);
-
1819 c.hash_function();
-
1820 c.key_eq();
-
1821
-
1822 pass();
-
1823}
-
1824
-
1825//------------------------------------------------------------------------------
-
1826//
-
1827// Matrix
-
1828//
-
1829//------------------------------------------------------------------------------
-
1830
-
1831template <bool IsUnordered, bool IsMulti, bool IsMap>
-
1832void
-
1833aged_associative_container_test_base::testMaybeUnorderedMultiMap()
-
1834{
-
1835 using Traits = TestTraits<IsUnordered, IsMulti, IsMap>;
-
1836
-
1837 testConstructEmpty<IsUnordered, IsMulti, IsMap>();
-
1838 testConstructRange<IsUnordered, IsMulti, IsMap>();
-
1839 testConstructInitList<IsUnordered, IsMulti, IsMap>();
-
1840 testCopyMove<IsUnordered, IsMulti, IsMap>();
-
1841 testIterator<IsUnordered, IsMulti, IsMap>();
-
1842 testReverseIterator<IsUnordered, IsMulti, IsMap>();
-
1843 testModifiers<IsUnordered, IsMulti, IsMap>();
-
1844 testChronological<IsUnordered, IsMulti, IsMap>();
-
1845 testArrayCreate<IsUnordered, IsMulti, IsMap>();
-
1846 testElementErase<IsUnordered, IsMulti, IsMap>();
-
1847 testRangeErase<IsUnordered, IsMulti, IsMap>();
-
1848 testCompare<IsUnordered, IsMulti, IsMap>();
-
1849 testObservers<IsUnordered, IsMulti, IsMap>();
-
1850}
-
1851
-
1852//------------------------------------------------------------------------------
-
1853
-
1854class aged_set_test : public aged_associative_container_test_base
-
1855{
-
1856public:
-
1857 // Compile time checks
-
1858
-
1859 using Key = std::string;
-
1860 using T = int;
+
1804//------------------------------------------------------------------------------
+
1805
+
1806class aged_set_test : public aged_associative_container_test_base
+
1807{
+
1808public:
+
1809 // Compile time checks
+
1810
+
1811 using Key = std::string;
+
1812 using T = int;
+
1813
+
1814 static_assert(
+
1815 std::is_same<
+
1816 aged_set<Key>,
+
1817 detail::aged_ordered_container<false, false, Key, void>>::value,
+
1818 "bad alias: aged_set");
+
1819
+
1820 static_assert(
+
1821 std::is_same<
+
1822 aged_multiset<Key>,
+
1823 detail::aged_ordered_container<true, false, Key, void>>::value,
+
1824 "bad alias: aged_multiset");
+
1825
+
1826 static_assert(
+
1827 std::is_same<
+
1828 aged_map<Key, T>,
+
1829 detail::aged_ordered_container<false, true, Key, T>>::value,
+
1830 "bad alias: aged_map");
+
1831
+
1832 static_assert(
+
1833 std::is_same<
+
1834 aged_multimap<Key, T>,
+
1835 detail::aged_ordered_container<true, true, Key, T>>::value,
+
1836 "bad alias: aged_multimap");
+
1837
+
1838 static_assert(
+
1839 std::is_same<
+
1840 aged_unordered_set<Key>,
+
1841 detail::aged_unordered_container<false, false, Key, void>>::value,
+
1842 "bad alias: aged_unordered_set");
+
1843
+
1844 static_assert(
+
1845 std::is_same<
+
1846 aged_unordered_multiset<Key>,
+
1847 detail::aged_unordered_container<true, false, Key, void>>::value,
+
1848 "bad alias: aged_unordered_multiset");
+
1849
+
1850 static_assert(
+
1851 std::is_same<
+
1852 aged_unordered_map<Key, T>,
+
1853 detail::aged_unordered_container<false, true, Key, T>>::value,
+
1854 "bad alias: aged_unordered_map");
+
1855
+
1856 static_assert(
+
1857 std::is_same<
+
1858 aged_unordered_multimap<Key, T>,
+
1859 detail::aged_unordered_container<true, true, Key, T>>::value,
+
1860 "bad alias: aged_unordered_multimap");
1861
-
1862 static_assert(
-
1863 std::is_same<
-
1864 aged_set<Key>,
-
1865 detail::aged_ordered_container<false, false, Key, void>>::value,
-
1866 "bad alias: aged_set");
-
1867
-
1868 static_assert(
-
1869 std::is_same<
-
1870 aged_multiset<Key>,
-
1871 detail::aged_ordered_container<true, false, Key, void>>::value,
-
1872 "bad alias: aged_multiset");
-
1873
-
1874 static_assert(
-
1875 std::is_same<
-
1876 aged_map<Key, T>,
-
1877 detail::aged_ordered_container<false, true, Key, T>>::value,
-
1878 "bad alias: aged_map");
-
1879
-
1880 static_assert(
-
1881 std::is_same<
-
1882 aged_multimap<Key, T>,
-
1883 detail::aged_ordered_container<true, true, Key, T>>::value,
-
1884 "bad alias: aged_multimap");
-
1885
-
1886 static_assert(
-
1887 std::is_same<
-
1888 aged_unordered_set<Key>,
-
1889 detail::aged_unordered_container<false, false, Key, void>>::value,
-
1890 "bad alias: aged_unordered_set");
-
1891
-
1892 static_assert(
-
1893 std::is_same<
-
1894 aged_unordered_multiset<Key>,
-
1895 detail::aged_unordered_container<true, false, Key, void>>::value,
-
1896 "bad alias: aged_unordered_multiset");
-
1897
-
1898 static_assert(
-
1899 std::is_same<
-
1900 aged_unordered_map<Key, T>,
-
1901 detail::aged_unordered_container<false, true, Key, T>>::value,
-
1902 "bad alias: aged_unordered_map");
-
1903
-
1904 static_assert(
-
1905 std::is_same<
-
1906 aged_unordered_multimap<Key, T>,
-
1907 detail::aged_unordered_container<true, true, Key, T>>::value,
-
1908 "bad alias: aged_unordered_multimap");
-
1909
-
1910 void
-
1911 run() override
-
1912 {
-
1913 testMaybeUnorderedMultiMap<false, false, false>();
-
1914 }
-
1915};
-
1916
-
1917class aged_map_test : public aged_associative_container_test_base
-
1918{
-
1919public:
-
1920 void
-
1921 run() override
-
1922 {
-
1923 testMaybeUnorderedMultiMap<false, false, true>();
-
1924 }
-
1925};
-
1926
-
1927class aged_multiset_test : public aged_associative_container_test_base
-
1928{
-
1929public:
-
1930 void
-
1931 run() override
-
1932 {
-
1933 testMaybeUnorderedMultiMap<false, true, false>();
-
1934 }
-
1935};
-
1936
-
1937class aged_multimap_test : public aged_associative_container_test_base
-
1938{
-
1939public:
-
1940 void
-
1941 run() override
-
1942 {
-
1943 testMaybeUnorderedMultiMap<false, true, true>();
-
1944 }
-
1945};
-
1946
-
1947class aged_unordered_set_test : public aged_associative_container_test_base
-
1948{
-
1949public:
-
1950 void
-
1951 run() override
-
1952 {
-
1953 testMaybeUnorderedMultiMap<true, false, false>();
-
1954 }
-
1955};
-
1956
-
1957class aged_unordered_map_test : public aged_associative_container_test_base
-
1958{
-
1959public:
-
1960 void
-
1961 run() override
-
1962 {
-
1963 testMaybeUnorderedMultiMap<true, false, true>();
-
1964 }
-
1965};
-
1966
-
1967class aged_unordered_multiset_test : public aged_associative_container_test_base
-
1968{
-
1969public:
-
1970 void
-
1971 run() override
-
1972 {
-
1973 testMaybeUnorderedMultiMap<true, true, false>();
-
1974 }
-
1975};
-
1976
-
1977class aged_unordered_multimap_test : public aged_associative_container_test_base
-
1978{
-
1979public:
-
1980 void
-
1981 run() override
-
1982 {
-
1983 testMaybeUnorderedMultiMap<true, true, true>();
-
1984 }
-
1985};
-
1986
-
1987BEAST_DEFINE_TESTSUITE(aged_set, container, beast);
-
1988BEAST_DEFINE_TESTSUITE(aged_map, container, beast);
-
1989BEAST_DEFINE_TESTSUITE(aged_multiset, container, beast);
-
1990BEAST_DEFINE_TESTSUITE(aged_multimap, container, beast);
-
1991BEAST_DEFINE_TESTSUITE(aged_unordered_set, container, beast);
-
1992BEAST_DEFINE_TESTSUITE(aged_unordered_map, container, beast);
-
1993BEAST_DEFINE_TESTSUITE(aged_unordered_multiset, container, beast);
-
1994BEAST_DEFINE_TESTSUITE(aged_unordered_multimap, container, beast);
-
1995
-
1996} // namespace beast
+
1862 void
+
1863 run() override
+
1864 {
+
1865 testMaybeUnorderedMultiMap<false, false, false>();
+
1866 }
+
1867};
+
1868
+
1869class aged_map_test : public aged_associative_container_test_base
+
1870{
+
1871public:
+
1872 void
+
1873 run() override
+
1874 {
+
1875 testMaybeUnorderedMultiMap<false, false, true>();
+
1876 }
+
1877};
+
1878
+
1879class aged_multiset_test : public aged_associative_container_test_base
+
1880{
+
1881public:
+
1882 void
+
1883 run() override
+
1884 {
+
1885 testMaybeUnorderedMultiMap<false, true, false>();
+
1886 }
+
1887};
+
1888
+
1889class aged_multimap_test : public aged_associative_container_test_base
+
1890{
+
1891public:
+
1892 void
+
1893 run() override
+
1894 {
+
1895 testMaybeUnorderedMultiMap<false, true, true>();
+
1896 }
+
1897};
+
1898
+
1899class aged_unordered_set_test : public aged_associative_container_test_base
+
1900{
+
1901public:
+
1902 void
+
1903 run() override
+
1904 {
+
1905 testMaybeUnorderedMultiMap<true, false, false>();
+
1906 }
+
1907};
+
1908
+
1909class aged_unordered_map_test : public aged_associative_container_test_base
+
1910{
+
1911public:
+
1912 void
+
1913 run() override
+
1914 {
+
1915 testMaybeUnorderedMultiMap<true, false, true>();
+
1916 }
+
1917};
+
1918
+
1919class aged_unordered_multiset_test : public aged_associative_container_test_base
+
1920{
+
1921public:
+
1922 void
+
1923 run() override
+
1924 {
+
1925 testMaybeUnorderedMultiMap<true, true, false>();
+
1926 }
+
1927};
+
1928
+
1929class aged_unordered_multimap_test : public aged_associative_container_test_base
+
1930{
+
1931public:
+
1932 void
+
1933 run() override
+
1934 {
+
1935 testMaybeUnorderedMultiMap<true, true, true>();
+
1936 }
+
1937};
+
1938
+
1939BEAST_DEFINE_TESTSUITE(aged_set, container, beast);
+
1940BEAST_DEFINE_TESTSUITE(aged_map, container, beast);
+
1941BEAST_DEFINE_TESTSUITE(aged_multiset, container, beast);
+
1942BEAST_DEFINE_TESTSUITE(aged_multimap, container, beast);
+
1943BEAST_DEFINE_TESTSUITE(aged_unordered_set, container, beast);
+
1944BEAST_DEFINE_TESTSUITE(aged_unordered_map, container, beast);
+
1945BEAST_DEFINE_TESTSUITE(aged_unordered_multiset, container, beast);
+
1946BEAST_DEFINE_TESTSUITE(aged_unordered_multimap, container, beast);
+
1947
+
1948} // namespace beast
std::allocator
std::string
beast::aged_associative_container_test_base::HashT
Definition: aged_associative_container_test.cpp:79
@@ -2097,60 +2049,60 @@ $(function() {
beast::aged_associative_container_test_base::MaybeUnordered
Definition: aged_associative_container_test.cpp:180
beast::aged_associative_container_test_base::MaybeUnordered::name_ordered_part
static std::string name_ordered_part()
Definition: aged_associative_container_test.cpp:187
beast::aged_associative_container_test_base
Definition: aged_associative_container_test.cpp:53
-
beast::aged_associative_container_test_base::testArrayCreate
std::enable_if< IsMap &&!IsMulti >::type testArrayCreate()
Definition: aged_associative_container_test.cpp:1468
+
beast::aged_associative_container_test_base::testArrayCreate
std::enable_if< IsMap &&!IsMulti >::type testArrayCreate()
Definition: aged_associative_container_test.cpp:1423
beast::aged_associative_container_test_base::checkUnorderedContentsRefRef
std::enable_if<!std::remove_reference< C >::type::is_unordered::value >::type checkUnorderedContentsRefRef(C &&, Values const &)
Definition: aged_associative_container_test.cpp:440
-
beast::aged_associative_container_test_base::checkInsertHintMove
void checkInsertHintMove(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1301
-
beast::aged_associative_container_test_base::checkInsertCopy
void checkInsertCopy(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1267
-
beast::aged_associative_container_test_base::testReverseIterator
std::enable_if<!IsUnordered >::type testReverseIterator()
Definition: aged_associative_container_test.cpp:1179
+
beast::aged_associative_container_test_base::checkInsertHintMove
void checkInsertHintMove(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1257
+
beast::aged_associative_container_test_base::checkInsertCopy
void checkInsertCopy(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1223
+
beast::aged_associative_container_test_base::testReverseIterator
std::enable_if<!IsUnordered >::type testReverseIterator()
Definition: aged_associative_container_test.cpp:1138
beast::aged_associative_container_test_base::checkMapContents
std::enable_if<!(Container::is_map::value &&!Container::is_multi::value)>::type checkMapContents(Container, Values const &)
Definition: aged_associative_container_test.cpp:427
-
beast::aged_associative_container_test_base::checkInsertHintCopy
void checkInsertHintCopy(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1290
+
beast::aged_associative_container_test_base::checkInsertHintCopy
void checkInsertHintCopy(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1246
beast::aged_associative_container_test_base::checkContentsRefRef
void checkContentsRefRef(C &&c, Values const &v)
Definition: aged_associative_container_test.cpp:701
-
beast::aged_associative_container_test_base::checkEmplace
void checkEmplace(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1313
-
beast::aged_associative_container_test_base::testChronological
void testChronological()
Definition: aged_associative_container_test.cpp:1394
+
beast::aged_associative_container_test_base::checkEmplace
void checkEmplace(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1269
+
beast::aged_associative_container_test_base::testChronological
void testChronological()
Definition: aged_associative_container_test.cpp:1350
beast::aged_associative_container_test_base::make_list
static std::vector< typename Cont::value_type > make_list(Cont const &c)
Definition: aged_associative_container_test.cpp:412
beast::aged_associative_container_test_base::testReverseIterator
std::enable_if< IsUnordered >::type testReverseIterator()
Definition: aged_associative_container_test.cpp:507
-
beast::aged_associative_container_test_base::testCompare
std::enable_if<!IsUnordered >::type testCompare()
Definition: aged_associative_container_test.cpp:1760
+
beast::aged_associative_container_test_base::testCompare
std::enable_if<!IsUnordered >::type testCompare()
Definition: aged_associative_container_test.cpp:1715
beast::aged_associative_container_test_base::checkMapContents
std::enable_if< Container::is_map::value &&!Container::is_multi::value >::type checkMapContents(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:638
beast::aged_associative_container_test_base::name
static std::string name(Cont const &)
Definition: aged_associative_container_test.cpp:392
-
beast::aged_associative_container_test_base::testConstructRange
std::enable_if<!IsUnordered >::type testConstructRange()
Definition: aged_associative_container_test.cpp:870
-
beast::aged_associative_container_test_base::testElementErase
void testElementErase()
Definition: aged_associative_container_test.cpp:1610
+
beast::aged_associative_container_test_base::testConstructRange
std::enable_if<!IsUnordered >::type testConstructRange()
Definition: aged_associative_container_test.cpp:858
+
beast::aged_associative_container_test_base::testElementErase
void testElementErase()
Definition: aged_associative_container_test.cpp:1565
beast::aged_associative_container_test_base::testMaybeUnorderedMulti
void testMaybeUnorderedMulti()
-
beast::aged_associative_container_test_base::testRangeErase
void testRangeErase()
Definition: aged_associative_container_test.cpp:1728
-
beast::aged_associative_container_test_base::doElementErase
bool doElementErase(Container &c, Iter const beginItr, Iter const endItr)
Definition: aged_associative_container_test.cpp:1564
+
beast::aged_associative_container_test_base::testRangeErase
void testRangeErase()
Definition: aged_associative_container_test.cpp:1683
+
beast::aged_associative_container_test_base::doElementErase
bool doElementErase(Container &c, Iter const beginItr, Iter const endItr)
Definition: aged_associative_container_test.cpp:1519
beast::aged_associative_container_test_base::testCompare
std::enable_if< IsUnordered >::type testCompare()
Definition: aged_associative_container_test.cpp:600
-
beast::aged_associative_container_test_base::testObservers
std::enable_if<!IsUnordered >::type testObservers()
Definition: aged_associative_container_test.cpp:1792
-
beast::aged_associative_container_test_base::nextToEndIter
Iter nextToEndIter(Iter const beginIter, Iter const endItr)
Definition: aged_associative_container_test.cpp:1530
-
beast::aged_associative_container_test_base::testIterator
void testIterator()
Definition: aged_associative_container_test.cpp:1121
-
beast::aged_associative_container_test_base::testMaybeUnorderedMultiMap
void testMaybeUnorderedMultiMap()
Definition: aged_associative_container_test.cpp:1833
-
beast::aged_associative_container_test_base::testConstructEmpty
std::enable_if<!IsUnordered >::type testConstructEmpty()
Definition: aged_associative_container_test.cpp:761
-
beast::aged_associative_container_test_base::reverseFillAgedContainer
void reverseFillAgedContainer(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1502
+
beast::aged_associative_container_test_base::testObservers
std::enable_if<!IsUnordered >::type testObservers()
Definition: aged_associative_container_test.cpp:1746
+
beast::aged_associative_container_test_base::nextToEndIter
Iter nextToEndIter(Iter const beginIter, Iter const endItr)
Definition: aged_associative_container_test.cpp:1485
+
beast::aged_associative_container_test_base::testIterator
void testIterator()
Definition: aged_associative_container_test.cpp:1082
+
beast::aged_associative_container_test_base::testMaybeUnorderedMultiMap
void testMaybeUnorderedMultiMap()
Definition: aged_associative_container_test.cpp:1787
+
beast::aged_associative_container_test_base::testConstructEmpty
std::enable_if<!IsUnordered >::type testConstructEmpty()
Definition: aged_associative_container_test.cpp:757
+
beast::aged_associative_container_test_base::reverseFillAgedContainer
void reverseFillAgedContainer(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1457
beast::aged_associative_container_test_base::checkUnorderedContentsRefRef
std::enable_if< std::remove_reference< C >::type::is_unordered::value >::type checkUnorderedContentsRefRef(C &&c, Values const &v)
Definition: aged_associative_container_test.cpp:667
-
beast::aged_associative_container_test_base::testConstructInitList
std::enable_if<!IsUnordered >::type testConstructInitList()
Definition: aged_associative_container_test.cpp:996
+
beast::aged_associative_container_test_base::testConstructInitList
std::enable_if<!IsUnordered >::type testConstructInitList()
Definition: aged_associative_container_test.cpp:976
beast::aged_associative_container_test_base::testArrayCreate
std::enable_if<!(IsMap &&!IsMulti)>::type testArrayCreate()
Definition: aged_associative_container_test.cpp:556
-
beast::aged_associative_container_test_base::testModifiers
void testModifiers()
Definition: aged_associative_container_test.cpp:1335
+
beast::aged_associative_container_test_base::testModifiers
void testModifiers()
Definition: aged_associative_container_test.cpp:1291
beast::aged_associative_container_test_base::testMaybeUnordered
void testMaybeUnordered()
-
beast::aged_associative_container_test_base::checkContents
void checkContents(Cont &c, Values const &v)
Definition: aged_associative_container_test.cpp:733
-
beast::aged_associative_container_test_base::doRangeErase
void doRangeErase(Container &c, BeginEndSrc const &beginEndSrc)
Definition: aged_associative_container_test.cpp:1698
-
beast::aged_associative_container_test_base::testCopyMove
void testCopyMove()
Definition: aged_associative_container_test.cpp:1050
-
beast::aged_associative_container_test_base::checkEmplaceHint
void checkEmplaceHint(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1324
-
beast::aged_associative_container_test_base::checkInsertMove
void checkInsertMove(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1278
-
beast::aged_map_test
Definition: aged_associative_container_test.cpp:1918
-
beast::aged_map_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1921
-
beast::aged_multimap_test
Definition: aged_associative_container_test.cpp:1938
-
beast::aged_multimap_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1941
-
beast::aged_multiset_test
Definition: aged_associative_container_test.cpp:1928
-
beast::aged_multiset_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1931
-
beast::aged_set_test
Definition: aged_associative_container_test.cpp:1855
-
beast::aged_set_test::T
int T
Definition: aged_associative_container_test.cpp:1860
-
beast::aged_set_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1911
-
beast::aged_unordered_map_test
Definition: aged_associative_container_test.cpp:1958
-
beast::aged_unordered_map_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1961
-
beast::aged_unordered_multimap_test
Definition: aged_associative_container_test.cpp:1978
-
beast::aged_unordered_multimap_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1981
-
beast::aged_unordered_multiset_test
Definition: aged_associative_container_test.cpp:1968
-
beast::aged_unordered_multiset_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1971
-
beast::aged_unordered_set_test
Definition: aged_associative_container_test.cpp:1948
-
beast::aged_unordered_set_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1951
+
beast::aged_associative_container_test_base::checkContents
void checkContents(Cont &c, Values const &v)
Definition: aged_associative_container_test.cpp:729
+
beast::aged_associative_container_test_base::doRangeErase
void doRangeErase(Container &c, BeginEndSrc const &beginEndSrc)
Definition: aged_associative_container_test.cpp:1653
+
beast::aged_associative_container_test_base::testCopyMove
void testCopyMove()
Definition: aged_associative_container_test.cpp:1012
+
beast::aged_associative_container_test_base::checkEmplaceHint
void checkEmplaceHint(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1280
+
beast::aged_associative_container_test_base::checkInsertMove
void checkInsertMove(Container &c, Values const &v)
Definition: aged_associative_container_test.cpp:1234
+
beast::aged_map_test
Definition: aged_associative_container_test.cpp:1870
+
beast::aged_map_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1873
+
beast::aged_multimap_test
Definition: aged_associative_container_test.cpp:1890
+
beast::aged_multimap_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1893
+
beast::aged_multiset_test
Definition: aged_associative_container_test.cpp:1880
+
beast::aged_multiset_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1883
+
beast::aged_set_test
Definition: aged_associative_container_test.cpp:1807
+
beast::aged_set_test::T
int T
Definition: aged_associative_container_test.cpp:1812
+
beast::aged_set_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1863
+
beast::aged_unordered_map_test
Definition: aged_associative_container_test.cpp:1910
+
beast::aged_unordered_map_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1913
+
beast::aged_unordered_multimap_test
Definition: aged_associative_container_test.cpp:1930
+
beast::aged_unordered_multimap_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1933
+
beast::aged_unordered_multiset_test
Definition: aged_associative_container_test.cpp:1920
+
beast::aged_unordered_multiset_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1923
+
beast::aged_unordered_set_test
Definition: aged_associative_container_test.cpp:1900
+
beast::aged_unordered_set_test::run
void run() override
Runs the suite.
Definition: aged_associative_container_test.cpp:1903
beast::detail::aged_ordered_container
Associative container where each element is also indexed by time.
Definition: aged_ordered_container.h:84
beast::detail::aged_unordered_container
Associative container where each element is also indexed by time.
Definition: aged_unordered_container.h:88
beast::manual_clock
Manual clock implementation.
Definition: manual_clock.h:41
diff --git a/aged__unordered__container_8h_source.html b/aged__unordered__container_8h_source.html index ad55abfac1..293ee7296e 100644 --- a/aged__unordered__container_8h_source.html +++ b/aged__unordered__container_8h_source.html @@ -3318,197 +3318,196 @@ $(function() {
3257{
3258 if (size() != other.size())
3259 return false;
-
3260 using EqRng = std::pair<const_iterator, const_iterator>;
-
3261 for (auto iter(cbegin()), last(cend()); iter != last;)
-
3262 {
-
3263 auto const& k(extract(*iter));
-
3264 auto const eq(equal_range(k));
-
3265 auto const oeq(other.equal_range(k));
-
3266#if BEAST_NO_CXX14_IS_PERMUTATION
-
3267 if (std::distance(eq.first, eq.second) !=
-
3268 std::distance(oeq.first, oeq.second) ||
-
3269 !std::is_permutation(eq.first, eq.second, oeq.first))
-
3270 return false;
-
3271#else
-
3272 if (!std::is_permutation(eq.first, eq.second, oeq.first, oeq.second))
-
3273 return false;
-
3274#endif
-
3275 iter = eq.second;
-
3276 }
-
3277 return true;
-
3278}
-
3279
-
3280//------------------------------------------------------------------------------
-
3281
-
3282// map, set
-
3283template <
-
3284 bool IsMulti,
-
3285 bool IsMap,
-
3286 class Key,
-
3287 class T,
-
3288 class Clock,
-
3289 class Hash,
-
3290 class KeyEqual,
-
3291 class Allocator>
-
3292template <bool maybe_multi>
-
3293auto
-
3294aged_unordered_container<
-
3295 IsMulti,
-
3296 IsMap,
-
3297 Key,
-
3298 T,
-
3299 Clock,
-
3300 Hash,
-
3301 KeyEqual,
-
3302 Allocator>::insert_unchecked(value_type const& value) ->
-
3303 typename std::enable_if<!maybe_multi, std::pair<iterator, bool>>::type
-
3304{
-
3305 typename cont_type::insert_commit_data d;
-
3306 auto const result(m_cont.insert_check(
-
3307 extract(value),
-
3308 std::cref(m_config.hash_function()),
-
3309 std::cref(m_config.key_value_equal()),
-
3310 d));
-
3311 if (result.second)
-
3312 {
-
3313 element* const p(new_element(value));
-
3314 auto const iter(m_cont.insert_commit(*p, d));
-
3315 chronological.list.push_back(*p);
-
3316 return std::make_pair(iterator(iter), true);
-
3317 }
-
3318 return std::make_pair(iterator(result.first), false);
-
3319}
-
3320
-
3321// multimap, multiset
-
3322template <
-
3323 bool IsMulti,
-
3324 bool IsMap,
-
3325 class Key,
-
3326 class T,
-
3327 class Clock,
-
3328 class Hash,
-
3329 class KeyEqual,
-
3330 class Allocator>
-
3331template <bool maybe_multi>
-
3332auto
-
3333aged_unordered_container<
-
3334 IsMulti,
-
3335 IsMap,
-
3336 Key,
-
3337 T,
-
3338 Clock,
-
3339 Hash,
-
3340 KeyEqual,
-
3341 Allocator>::insert_unchecked(value_type const& value) ->
-
3342 typename std::enable_if<maybe_multi, iterator>::type
-
3343{
-
3344 element* const p(new_element(value));
-
3345 chronological.list.push_back(*p);
-
3346 auto const iter(m_cont.insert(*p));
-
3347 return iterator(iter);
-
3348}
-
3349
-
3350//------------------------------------------------------------------------------
-
3351
-
3352} // namespace detail
-
3353
-
3354//------------------------------------------------------------------------------
-
3355
-
3356template <
-
3357 bool IsMulti,
-
3358 bool IsMap,
-
3359 class Key,
-
3360 class T,
-
3361 class Clock,
-
3362 class Hash,
-
3363 class KeyEqual,
-
3364 class Allocator>
-
3365struct is_aged_container<beast::detail::aged_unordered_container<
-
3366 IsMulti,
-
3367 IsMap,
-
3368 Key,
-
3369 T,
-
3370 Clock,
-
3371 Hash,
-
3372 KeyEqual,
-
3373 Allocator>> : std::true_type
-
3374{
-
3375 explicit is_aged_container() = default;
-
3376};
-
3377
-
3378// Free functions
-
3379
-
3380template <
-
3381 bool IsMulti,
-
3382 bool IsMap,
-
3383 class Key,
-
3384 class T,
-
3385 class Clock,
-
3386 class Hash,
-
3387 class KeyEqual,
-
3388 class Allocator>
-
3389void
-
3390swap(
-
3391 beast::detail::aged_unordered_container<
-
3392 IsMulti,
-
3393 IsMap,
-
3394 Key,
-
3395 T,
-
3396 Clock,
-
3397 Hash,
-
3398 KeyEqual,
-
3399 Allocator>& lhs,
-
3400 beast::detail::aged_unordered_container<
-
3401 IsMulti,
-
3402 IsMap,
-
3403 Key,
-
3404 T,
-
3405 Clock,
-
3406 Hash,
-
3407 KeyEqual,
-
3408 Allocator>& rhs) noexcept
-
3409{
-
3410 lhs.swap(rhs);
-
3411}
-
3412
-
3414template <
-
3415 bool IsMulti,
-
3416 bool IsMap,
-
3417 class Key,
-
3418 class T,
-
3419 class Clock,
-
3420 class Hash,
-
3421 class KeyEqual,
-
3422 class Allocator,
-
3423 class Rep,
-
3424 class Period>
-
3425std::size_t
-
3426expire(
-
3427 beast::detail::aged_unordered_container<
-
3428 IsMulti,
-
3429 IsMap,
-
3430 Key,
-
3431 T,
-
3432 Clock,
-
3433 Hash,
-
3434 KeyEqual,
-
3435 Allocator>& c,
-
3436 std::chrono::duration<Rep, Period> const& age) noexcept
-
3437{
-
3438 std::size_t n(0);
-
3439 auto const expired(c.clock().now() - age);
-
3440 for (auto iter(c.chronological.cbegin());
-
3441 iter != c.chronological.cend() && iter.when() <= expired;)
-
3442 {
-
3443 iter = c.erase(iter);
-
3444 ++n;
-
3445 }
-
3446 return n;
-
3447}
-
3448
-
3449} // namespace beast
-
3450
-
3451#endif
+
3260 for (auto iter(cbegin()), last(cend()); iter != last;)
+
3261 {
+
3262 auto const& k(extract(*iter));
+
3263 auto const eq(equal_range(k));
+
3264 auto const oeq(other.equal_range(k));
+
3265#if BEAST_NO_CXX14_IS_PERMUTATION
+
3266 if (std::distance(eq.first, eq.second) !=
+
3267 std::distance(oeq.first, oeq.second) ||
+
3268 !std::is_permutation(eq.first, eq.second, oeq.first))
+
3269 return false;
+
3270#else
+
3271 if (!std::is_permutation(eq.first, eq.second, oeq.first, oeq.second))
+
3272 return false;
+
3273#endif
+
3274 iter = eq.second;
+
3275 }
+
3276 return true;
+
3277}
+
3278
+
3279//------------------------------------------------------------------------------
+
3280
+
3281// map, set
+
3282template <
+
3283 bool IsMulti,
+
3284 bool IsMap,
+
3285 class Key,
+
3286 class T,
+
3287 class Clock,
+
3288 class Hash,
+
3289 class KeyEqual,
+
3290 class Allocator>
+
3291template <bool maybe_multi>
+
3292auto
+
3293aged_unordered_container<
+
3294 IsMulti,
+
3295 IsMap,
+
3296 Key,
+
3297 T,
+
3298 Clock,
+
3299 Hash,
+
3300 KeyEqual,
+
3301 Allocator>::insert_unchecked(value_type const& value) ->
+
3302 typename std::enable_if<!maybe_multi, std::pair<iterator, bool>>::type
+
3303{
+
3304 typename cont_type::insert_commit_data d;
+
3305 auto const result(m_cont.insert_check(
+
3306 extract(value),
+
3307 std::cref(m_config.hash_function()),
+
3308 std::cref(m_config.key_value_equal()),
+
3309 d));
+
3310 if (result.second)
+
3311 {
+
3312 element* const p(new_element(value));
+
3313 auto const iter(m_cont.insert_commit(*p, d));
+
3314 chronological.list.push_back(*p);
+
3315 return std::make_pair(iterator(iter), true);
+
3316 }
+
3317 return std::make_pair(iterator(result.first), false);
+
3318}
+
3319
+
3320// multimap, multiset
+
3321template <
+
3322 bool IsMulti,
+
3323 bool IsMap,
+
3324 class Key,
+
3325 class T,
+
3326 class Clock,
+
3327 class Hash,
+
3328 class KeyEqual,
+
3329 class Allocator>
+
3330template <bool maybe_multi>
+
3331auto
+
3332aged_unordered_container<
+
3333 IsMulti,
+
3334 IsMap,
+
3335 Key,
+
3336 T,
+
3337 Clock,
+
3338 Hash,
+
3339 KeyEqual,
+
3340 Allocator>::insert_unchecked(value_type const& value) ->
+
3341 typename std::enable_if<maybe_multi, iterator>::type
+
3342{
+
3343 element* const p(new_element(value));
+
3344 chronological.list.push_back(*p);
+
3345 auto const iter(m_cont.insert(*p));
+
3346 return iterator(iter);
+
3347}
+
3348
+
3349//------------------------------------------------------------------------------
+
3350
+
3351} // namespace detail
+
3352
+
3353//------------------------------------------------------------------------------
+
3354
+
3355template <
+
3356 bool IsMulti,
+
3357 bool IsMap,
+
3358 class Key,
+
3359 class T,
+
3360 class Clock,
+
3361 class Hash,
+
3362 class KeyEqual,
+
3363 class Allocator>
+
3364struct is_aged_container<beast::detail::aged_unordered_container<
+
3365 IsMulti,
+
3366 IsMap,
+
3367 Key,
+
3368 T,
+
3369 Clock,
+
3370 Hash,
+
3371 KeyEqual,
+
3372 Allocator>> : std::true_type
+
3373{
+
3374 explicit is_aged_container() = default;
+
3375};
+
3376
+
3377// Free functions
+
3378
+
3379template <
+
3380 bool IsMulti,
+
3381 bool IsMap,
+
3382 class Key,
+
3383 class T,
+
3384 class Clock,
+
3385 class Hash,
+
3386 class KeyEqual,
+
3387 class Allocator>
+
3388void
+
3389swap(
+
3390 beast::detail::aged_unordered_container<
+
3391 IsMulti,
+
3392 IsMap,
+
3393 Key,
+
3394 T,
+
3395 Clock,
+
3396 Hash,
+
3397 KeyEqual,
+
3398 Allocator>& lhs,
+
3399 beast::detail::aged_unordered_container<
+
3400 IsMulti,
+
3401 IsMap,
+
3402 Key,
+
3403 T,
+
3404 Clock,
+
3405 Hash,
+
3406 KeyEqual,
+
3407 Allocator>& rhs) noexcept
+
3408{
+
3409 lhs.swap(rhs);
+
3410}
+
3411
+
3413template <
+
3414 bool IsMulti,
+
3415 bool IsMap,
+
3416 class Key,
+
3417 class T,
+
3418 class Clock,
+
3419 class Hash,
+
3420 class KeyEqual,
+
3421 class Allocator,
+
3422 class Rep,
+
3423 class Period>
+
3424std::size_t
+
3425expire(
+
3426 beast::detail::aged_unordered_container<
+
3427 IsMulti,
+
3428 IsMap,
+
3429 Key,
+
3430 T,
+
3431 Clock,
+
3432 Hash,
+
3433 KeyEqual,
+
3434 Allocator>& c,
+
3435 std::chrono::duration<Rep, Period> const& age) noexcept
+
3436{
+
3437 std::size_t n(0);
+
3438 auto const expired(c.clock().now() - age);
+
3439 for (auto iter(c.chronological.cbegin());
+
3440 iter != c.chronological.cend() && iter.when() <= expired;)
+
3441 {
+
3442 iter = c.erase(iter);
+
3443 ++n;
+
3444 }
+
3445 return n;
+
3446}
+
3447
+
3448} // namespace beast
+
3449
+
3450#endif
std::addressof
T addressof(T... args)
algorithm
std::allocator_traits::allocate
T allocate(T... args)
@@ -3682,7 +3681,7 @@ $(function() {
beast::detail::aged_unordered_container::cbegin
const_local_iterator cbegin(size_type n) const
Definition: aged_unordered_container.h:1291
beast::detail::aged_unordered_container::end
const_iterator end() const
Definition: aged_unordered_container.h:983
beast::detail::aged_unordered_container::cend
const_iterator cend() const
Definition: aged_unordered_container.h:989
-
beast::detail::aged_unordered_container::insert_unchecked
auto insert_unchecked(value_type const &value) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool > >::type
Definition: aged_unordered_container.h:3302
+
beast::detail::aged_unordered_container::insert_unchecked
auto insert_unchecked(value_type const &value) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool > >::type
Definition: aged_unordered_container.h:3301
beast::detail::aged_unordered_container::aged_unordered_container
aged_unordered_container(aged_unordered_container const &other, Allocator const &alloc)
Definition: aged_unordered_container.h:2109
beast::detail::aged_unordered_container::~aged_unordered_container
~aged_unordered_container()
Definition: aged_unordered_container.h:2452
beast::detail::aged_unordered_container::get_allocator
allocator_type get_allocator() const
Definition: aged_unordered_container.h:899
diff --git a/batch_8cpp_source.html b/batch_8cpp_source.html index a6bed2ee07..2ed82e564f 100644 --- a/batch_8cpp_source.html +++ b/batch_8cpp_source.html @@ -266,7 +266,7 @@ $(function() {
ripple::finishMultiSigningData
void finishMultiSigningData(AccountID const &signingID, Serializer &s)
Definition: Sign.h:84
ripple::serializeBatch
void serializeBatch(Serializer &msg, std::uint32_t const &flags, std::vector< uint256 > const &txids)
Definition: include/xrpl/protocol/Batch.h:25
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::HashPrefix::batch
@ batch
Batch.
diff --git a/classbeast_1_1aged__associative__container__test__base.html b/classbeast_1_1aged__associative__container__test__base.html index c1b3113218..26c9f0325c 100644 --- a/classbeast_1_1aged__associative__container__test__base.html +++ b/classbeast_1_1aged__associative__container__test__base.html @@ -641,7 +641,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -663,7 +663,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -681,7 +681,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -718,7 +718,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -755,7 +755,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -792,7 +792,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -810,7 +810,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -828,7 +828,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -881,7 +881,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -913,7 +913,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -945,7 +945,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -977,7 +977,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1009,7 +1009,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1041,7 +1041,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1059,7 +1059,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1077,7 +1077,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1095,7 +1095,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1148,7 +1148,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1180,7 +1180,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1218,7 +1218,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1236,7 +1236,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1268,7 +1268,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1286,7 +1286,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1304,7 +1304,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1343,7 +1343,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1380,7 +1380,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1aged__map__test.html b/classbeast_1_1aged__map__test.html index 2f7e5f77cb..80d5455fc7 100644 --- a/classbeast_1_1aged__map__test.html +++ b/classbeast_1_1aged__map__test.html @@ -346,7 +346,7 @@ Private Attributes

Detailed Description

-

Definition at line 1917 of file aged_associative_container_test.cpp.

+

Definition at line 1869 of file aged_associative_container_test.cpp.

Member Function Documentation

◆ run()

@@ -375,7 +375,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1921 of file aged_associative_container_test.cpp.

+

Definition at line 1873 of file aged_associative_container_test.cpp.

@@ -675,7 +675,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -705,7 +705,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -731,7 +731,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -784,7 +784,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -837,7 +837,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -890,7 +890,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -916,7 +916,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -942,7 +942,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -1011,7 +1011,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -1051,7 +1051,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -1091,7 +1091,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -1131,7 +1131,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1171,7 +1171,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1211,7 +1211,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1237,7 +1237,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1263,7 +1263,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1289,7 +1289,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1358,7 +1358,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1398,7 +1398,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1444,7 +1444,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1470,7 +1470,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1510,7 +1510,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1536,7 +1536,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1562,7 +1562,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1617,7 +1617,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1670,7 +1670,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1aged__multimap__test.html b/classbeast_1_1aged__multimap__test.html index 43eb845d01..5548d16a37 100644 --- a/classbeast_1_1aged__multimap__test.html +++ b/classbeast_1_1aged__multimap__test.html @@ -346,7 +346,7 @@ Private Attributes

Detailed Description

-

Definition at line 1937 of file aged_associative_container_test.cpp.

+

Definition at line 1889 of file aged_associative_container_test.cpp.

Member Function Documentation

◆ run()

@@ -375,7 +375,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1941 of file aged_associative_container_test.cpp.

+

Definition at line 1893 of file aged_associative_container_test.cpp.

@@ -675,7 +675,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -705,7 +705,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -731,7 +731,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -784,7 +784,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -837,7 +837,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -890,7 +890,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -916,7 +916,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -942,7 +942,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -1011,7 +1011,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -1051,7 +1051,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -1091,7 +1091,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -1131,7 +1131,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1171,7 +1171,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1211,7 +1211,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1237,7 +1237,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1263,7 +1263,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1289,7 +1289,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1358,7 +1358,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1398,7 +1398,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1444,7 +1444,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1470,7 +1470,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1510,7 +1510,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1536,7 +1536,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1562,7 +1562,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1617,7 +1617,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1670,7 +1670,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1aged__multiset__test.html b/classbeast_1_1aged__multiset__test.html index 4c284c122e..0d7eed2212 100644 --- a/classbeast_1_1aged__multiset__test.html +++ b/classbeast_1_1aged__multiset__test.html @@ -346,7 +346,7 @@ Private Attributes

Detailed Description

-

Definition at line 1927 of file aged_associative_container_test.cpp.

+

Definition at line 1879 of file aged_associative_container_test.cpp.

Member Function Documentation

◆ run()

@@ -375,7 +375,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1931 of file aged_associative_container_test.cpp.

+

Definition at line 1883 of file aged_associative_container_test.cpp.

@@ -675,7 +675,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -705,7 +705,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -731,7 +731,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -784,7 +784,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -837,7 +837,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -890,7 +890,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -916,7 +916,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -942,7 +942,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -1011,7 +1011,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -1051,7 +1051,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -1091,7 +1091,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -1131,7 +1131,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1171,7 +1171,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1211,7 +1211,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1237,7 +1237,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1263,7 +1263,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1289,7 +1289,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1358,7 +1358,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1398,7 +1398,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1444,7 +1444,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1470,7 +1470,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1510,7 +1510,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1536,7 +1536,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1562,7 +1562,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1617,7 +1617,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1670,7 +1670,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1aged__set__test.html b/classbeast_1_1aged__set__test.html index ddb09ba1b2..3cb9b8df60 100644 --- a/classbeast_1_1aged__set__test.html +++ b/classbeast_1_1aged__set__test.html @@ -354,7 +354,7 @@ Private Attributes

Detailed Description

-

Definition at line 1854 of file aged_associative_container_test.cpp.

+

Definition at line 1806 of file aged_associative_container_test.cpp.

Member Typedef Documentation

◆ Key

@@ -368,7 +368,7 @@ Private Attributes
-

Definition at line 1859 of file aged_associative_container_test.cpp.

+

Definition at line 1811 of file aged_associative_container_test.cpp.

@@ -384,7 +384,7 @@ Private Attributes
-

Definition at line 1860 of file aged_associative_container_test.cpp.

+

Definition at line 1812 of file aged_associative_container_test.cpp.

@@ -416,7 +416,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1911 of file aged_associative_container_test.cpp.

+

Definition at line 1863 of file aged_associative_container_test.cpp.

@@ -716,7 +716,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -746,7 +746,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -772,7 +772,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -825,7 +825,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -878,7 +878,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -931,7 +931,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -957,7 +957,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -983,7 +983,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -1052,7 +1052,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -1092,7 +1092,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -1132,7 +1132,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -1172,7 +1172,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1212,7 +1212,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1252,7 +1252,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1278,7 +1278,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1304,7 +1304,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1330,7 +1330,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1399,7 +1399,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1439,7 +1439,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1485,7 +1485,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1511,7 +1511,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1551,7 +1551,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1577,7 +1577,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1603,7 +1603,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1658,7 +1658,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1711,7 +1711,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1aged__unordered__map__test.html b/classbeast_1_1aged__unordered__map__test.html index dd4afd0341..0a1945750d 100644 --- a/classbeast_1_1aged__unordered__map__test.html +++ b/classbeast_1_1aged__unordered__map__test.html @@ -346,7 +346,7 @@ Private Attributes

Detailed Description

-

Definition at line 1957 of file aged_associative_container_test.cpp.

+

Definition at line 1909 of file aged_associative_container_test.cpp.

Member Function Documentation

◆ run()

@@ -375,7 +375,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1961 of file aged_associative_container_test.cpp.

+

Definition at line 1913 of file aged_associative_container_test.cpp.

@@ -675,7 +675,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -705,7 +705,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -731,7 +731,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -784,7 +784,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -837,7 +837,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -890,7 +890,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -916,7 +916,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -942,7 +942,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -1011,7 +1011,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -1051,7 +1051,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -1091,7 +1091,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -1131,7 +1131,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1171,7 +1171,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1211,7 +1211,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1237,7 +1237,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1263,7 +1263,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1289,7 +1289,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1358,7 +1358,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1398,7 +1398,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1444,7 +1444,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1470,7 +1470,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1510,7 +1510,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1536,7 +1536,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1562,7 +1562,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1617,7 +1617,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1670,7 +1670,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1aged__unordered__multimap__test.html b/classbeast_1_1aged__unordered__multimap__test.html index ad2f80d8b0..68a1d55f2f 100644 --- a/classbeast_1_1aged__unordered__multimap__test.html +++ b/classbeast_1_1aged__unordered__multimap__test.html @@ -346,7 +346,7 @@ Private Attributes

Detailed Description

-

Definition at line 1977 of file aged_associative_container_test.cpp.

+

Definition at line 1929 of file aged_associative_container_test.cpp.

Member Function Documentation

◆ run()

@@ -375,7 +375,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1981 of file aged_associative_container_test.cpp.

+

Definition at line 1933 of file aged_associative_container_test.cpp.

@@ -675,7 +675,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -705,7 +705,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -731,7 +731,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -784,7 +784,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -837,7 +837,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -890,7 +890,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -916,7 +916,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -942,7 +942,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -1011,7 +1011,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -1051,7 +1051,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -1091,7 +1091,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -1131,7 +1131,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1171,7 +1171,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1211,7 +1211,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1237,7 +1237,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1263,7 +1263,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1289,7 +1289,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1358,7 +1358,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1398,7 +1398,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1444,7 +1444,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1470,7 +1470,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1510,7 +1510,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1536,7 +1536,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1562,7 +1562,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1617,7 +1617,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1670,7 +1670,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1aged__unordered__multiset__test.html b/classbeast_1_1aged__unordered__multiset__test.html index c4e0207ea6..3cb5c03bd5 100644 --- a/classbeast_1_1aged__unordered__multiset__test.html +++ b/classbeast_1_1aged__unordered__multiset__test.html @@ -346,7 +346,7 @@ Private Attributes

Detailed Description

-

Definition at line 1967 of file aged_associative_container_test.cpp.

+

Definition at line 1919 of file aged_associative_container_test.cpp.

Member Function Documentation

◆ run()

@@ -375,7 +375,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1971 of file aged_associative_container_test.cpp.

+

Definition at line 1923 of file aged_associative_container_test.cpp.

@@ -675,7 +675,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -705,7 +705,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -731,7 +731,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -784,7 +784,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -837,7 +837,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -890,7 +890,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -916,7 +916,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -942,7 +942,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -1011,7 +1011,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -1051,7 +1051,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -1091,7 +1091,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -1131,7 +1131,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1171,7 +1171,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1211,7 +1211,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1237,7 +1237,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1263,7 +1263,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1289,7 +1289,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1358,7 +1358,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1398,7 +1398,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1444,7 +1444,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1470,7 +1470,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1510,7 +1510,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1536,7 +1536,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1562,7 +1562,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1617,7 +1617,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1670,7 +1670,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1aged__unordered__set__test.html b/classbeast_1_1aged__unordered__set__test.html index c90455c06d..3371c7e28a 100644 --- a/classbeast_1_1aged__unordered__set__test.html +++ b/classbeast_1_1aged__unordered__set__test.html @@ -346,7 +346,7 @@ Private Attributes

Detailed Description

-

Definition at line 1947 of file aged_associative_container_test.cpp.

+

Definition at line 1899 of file aged_associative_container_test.cpp.

Member Function Documentation

◆ run()

@@ -375,7 +375,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1951 of file aged_associative_container_test.cpp.

+

Definition at line 1903 of file aged_associative_container_test.cpp.

@@ -675,7 +675,7 @@ template<class Cont , class Values >
-

Definition at line 733 of file aged_associative_container_test.cpp.

+

Definition at line 729 of file aged_associative_container_test.cpp.

@@ -705,7 +705,7 @@ template<class Cont >
-

Definition at line 742 of file aged_associative_container_test.cpp.

+

Definition at line 738 of file aged_associative_container_test.cpp.

@@ -731,7 +731,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 761 of file aged_associative_container_test.cpp.

+

Definition at line 757 of file aged_associative_container_test.cpp.

@@ -784,7 +784,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 870 of file aged_associative_container_test.cpp.

+

Definition at line 858 of file aged_associative_container_test.cpp.

@@ -837,7 +837,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 996 of file aged_associative_container_test.cpp.

+

Definition at line 976 of file aged_associative_container_test.cpp.

@@ -890,7 +890,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1050 of file aged_associative_container_test.cpp.

+

Definition at line 1012 of file aged_associative_container_test.cpp.

@@ -916,7 +916,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1121 of file aged_associative_container_test.cpp.

+

Definition at line 1082 of file aged_associative_container_test.cpp.

@@ -942,7 +942,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1179 of file aged_associative_container_test.cpp.

+

Definition at line 1138 of file aged_associative_container_test.cpp.

@@ -1011,7 +1011,7 @@ template<class Container , class Values >
-

Definition at line 1267 of file aged_associative_container_test.cpp.

+

Definition at line 1223 of file aged_associative_container_test.cpp.

@@ -1051,7 +1051,7 @@ template<class Container , class Values >
-

Definition at line 1278 of file aged_associative_container_test.cpp.

+

Definition at line 1234 of file aged_associative_container_test.cpp.

@@ -1091,7 +1091,7 @@ template<class Container , class Values >
-

Definition at line 1290 of file aged_associative_container_test.cpp.

+

Definition at line 1246 of file aged_associative_container_test.cpp.

@@ -1131,7 +1131,7 @@ template<class Container , class Values >
-

Definition at line 1301 of file aged_associative_container_test.cpp.

+

Definition at line 1257 of file aged_associative_container_test.cpp.

@@ -1171,7 +1171,7 @@ template<class Container , class Values >
-

Definition at line 1313 of file aged_associative_container_test.cpp.

+

Definition at line 1269 of file aged_associative_container_test.cpp.

@@ -1211,7 +1211,7 @@ template<class Container , class Values >
-

Definition at line 1324 of file aged_associative_container_test.cpp.

+

Definition at line 1280 of file aged_associative_container_test.cpp.

@@ -1237,7 +1237,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1335 of file aged_associative_container_test.cpp.

+

Definition at line 1291 of file aged_associative_container_test.cpp.

@@ -1263,7 +1263,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1394 of file aged_associative_container_test.cpp.

+

Definition at line 1350 of file aged_associative_container_test.cpp.

@@ -1289,7 +1289,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1468 of file aged_associative_container_test.cpp.

+

Definition at line 1423 of file aged_associative_container_test.cpp.

@@ -1358,7 +1358,7 @@ template<class Container , class Values >
-

Definition at line 1502 of file aged_associative_container_test.cpp.

+

Definition at line 1457 of file aged_associative_container_test.cpp.

@@ -1398,7 +1398,7 @@ template<class Iter >
-

Definition at line 1530 of file aged_associative_container_test.cpp.

+

Definition at line 1485 of file aged_associative_container_test.cpp.

@@ -1444,7 +1444,7 @@ template<class Container , class Iter >
-

Definition at line 1564 of file aged_associative_container_test.cpp.

+

Definition at line 1519 of file aged_associative_container_test.cpp.

@@ -1470,7 +1470,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1610 of file aged_associative_container_test.cpp.

+

Definition at line 1565 of file aged_associative_container_test.cpp.

@@ -1510,7 +1510,7 @@ template<class Container , class BeginEndSrc >
-

Definition at line 1698 of file aged_associative_container_test.cpp.

+

Definition at line 1653 of file aged_associative_container_test.cpp.

@@ -1536,7 +1536,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1728 of file aged_associative_container_test.cpp.

+

Definition at line 1683 of file aged_associative_container_test.cpp.

@@ -1562,7 +1562,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1760 of file aged_associative_container_test.cpp.

+

Definition at line 1715 of file aged_associative_container_test.cpp.

@@ -1617,7 +1617,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1792 of file aged_associative_container_test.cpp.

+

Definition at line 1746 of file aged_associative_container_test.cpp.

@@ -1670,7 +1670,7 @@ template<bool IsUnordered, bool IsMulti, bool IsMap>
-

Definition at line 1833 of file aged_associative_container_test.cpp.

+

Definition at line 1787 of file aged_associative_container_test.cpp.

diff --git a/classbeast_1_1detail_1_1aged__unordered__container.html b/classbeast_1_1detail_1_1aged__unordered__container.html index c23a3b6165..ce224d2dd6 100644 --- a/classbeast_1_1detail_1_1aged__unordered__container.html +++ b/classbeast_1_1detail_1_1aged__unordered__container.html @@ -4154,7 +4154,7 @@ template<bool maybe_multi>
-

Definition at line 3302 of file aged_unordered_container.h.

+

Definition at line 3301 of file aged_unordered_container.h.

diff --git a/classripple_1_1PublicKey.html b/classripple_1_1PublicKey.html index 01a990372c..5816e51eb7 100644 --- a/classripple_1_1PublicKey.html +++ b/classripple_1_1PublicKey.html @@ -210,7 +210,7 @@ ed25519
-

Definition at line 204 of file PublicKey.cpp.

+

Definition at line 205 of file PublicKey.cpp.

@@ -241,7 +241,7 @@ ed25519

Create a public key.

Preconditions: publicKeyType(slice) != std::nullopt

-

Definition at line 192 of file PublicKey.cpp.

+

Definition at line 193 of file PublicKey.cpp.

@@ -262,7 +262,7 @@ ed25519
-

Definition at line 210 of file PublicKey.cpp.

+

Definition at line 211 of file PublicKey.cpp.

diff --git a/classripple_1_1test_1_1LedgerTrie__test.html b/classripple_1_1test_1_1LedgerTrie__test.html index 39624167a7..10443089ae 100644 --- a/classripple_1_1test_1_1LedgerTrie__test.html +++ b/classripple_1_1test_1_1LedgerTrie__test.html @@ -369,7 +369,7 @@ Private Attributes

C advancing to H does advance the seq 3 preferred ledger A / \ B(1) C / | | H(1)D F(1) | E(1) | G(1)

F advancing to E also moves the preferred ledger forward A / \ B(1) C / | | H(1)D F | E(2) | G(1)

-

Definition at line 361 of file LedgerTrie_test.cpp.

+

Definition at line 360 of file LedgerTrie_test.cpp.

@@ -396,7 +396,7 @@ Private Attributes
-

Definition at line 596 of file LedgerTrie_test.cpp.

+

Definition at line 595 of file LedgerTrie_test.cpp.

@@ -423,7 +423,7 @@ Private Attributes
-

Definition at line 626 of file LedgerTrie_test.cpp.

+

Definition at line 624 of file LedgerTrie_test.cpp.

@@ -454,7 +454,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 671 of file LedgerTrie_test.cpp.

+

Definition at line 669 of file LedgerTrie_test.cpp.

diff --git a/classripple_1_1test_1_1RCLValidations__test.html b/classripple_1_1test_1_1RCLValidations__test.html index 27ee342097..29ee06b9f7 100644 --- a/classripple_1_1test_1_1RCLValidations__test.html +++ b/classripple_1_1test_1_1RCLValidations__test.html @@ -334,7 +334,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 323 of file RCLValidations_test.cpp.

+

Definition at line 322 of file RCLValidations_test.cpp.

diff --git a/classripple_1_1test_1_1csf_1_1Validations__test.html b/classripple_1_1test_1_1csf_1_1Validations__test.html index cdfc1a91da..7da25e5dd3 100644 --- a/classripple_1_1test_1_1csf_1_1Validations__test.html +++ b/classripple_1_1test_1_1csf_1_1Validations__test.html @@ -625,7 +625,7 @@ Private Attributes
-

Definition at line 863 of file Validations_test.cpp.

+

Definition at line 862 of file Validations_test.cpp.

@@ -652,7 +652,7 @@ Private Attributes
-

Definition at line 923 of file Validations_test.cpp.

+

Definition at line 922 of file Validations_test.cpp.

@@ -679,7 +679,7 @@ Private Attributes
-

Definition at line 992 of file Validations_test.cpp.

+

Definition at line 991 of file Validations_test.cpp.

@@ -706,7 +706,7 @@ Private Attributes
-

Definition at line 1009 of file Validations_test.cpp.

+

Definition at line 1008 of file Validations_test.cpp.

@@ -733,7 +733,7 @@ Private Attributes
-

Definition at line 1031 of file Validations_test.cpp.

+

Definition at line 1030 of file Validations_test.cpp.

@@ -764,7 +764,7 @@ Private Attributes

Implements beast::unit_test::suite.

-

Definition at line 1129 of file Validations_test.cpp.

+

Definition at line 1128 of file Validations_test.cpp.

diff --git a/multisign_8cpp_source.html b/multisign_8cpp_source.html index 8895ce2a15..41b070343e 100644 --- a/multisign_8cpp_source.html +++ b/multisign_8cpp_source.html @@ -196,7 +196,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::buildMultiSigningData
Serializer buildMultiSigningData(STObject const &obj, AccountID const &signingID)
Return a Serializer suitable for computing a multisigning TxnSignature.
Definition: Sign.cpp:96
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
-
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:223
+
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:224
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::Rethrow
void Rethrow()
Rethrow the exception currently being handled.
Definition: contract.h:48
diff --git a/namespacebeast.html b/namespacebeast.html index 98ec4e2293..adeff543c6 100644 --- a/namespacebeast.html +++ b/namespacebeast.html @@ -918,7 +918,7 @@ template<bool IsMulti, bool IsMap, class Key , class T , class Clock , class
-

Definition at line 3390 of file aged_unordered_container.h.

+

Definition at line 3389 of file aged_unordered_container.h.

@@ -960,7 +960,7 @@ template<bool IsMulti, bool IsMap, class Key , class T , class Clock , class

Expire aged container items past the specified age.

-

Definition at line 3426 of file aged_unordered_container.h.

+

Definition at line 3425 of file aged_unordered_container.h.

diff --git a/namespaceripple.html b/namespaceripple.html index c1f92bbfe8..4b7e9c1e01 100644 --- a/namespaceripple.html +++ b/namespaceripple.html @@ -17465,7 +17465,7 @@ template<>
Note
For more details please see: https://xrpl.org/transaction-malleability.html https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623 https://github.com/sipa/bitcoin/commit/58bc86e37fda1aec270bccb3df6c20fbd2a6591c
-

Definition at line 129 of file PublicKey.cpp.

+

Definition at line 130 of file PublicKey.cpp.

@@ -17488,7 +17488,7 @@ template<>

Returns the type of public key.

Returns
std::nullopt If the public key does not represent a known type.
-

Definition at line 223 of file PublicKey.cpp.

+

Definition at line 224 of file PublicKey.cpp.

@@ -17560,7 +17560,7 @@ template<>

Verify a secp256k1 signature on the digest of a message.

-

Definition at line 238 of file PublicKey.cpp.

+

Definition at line 239 of file PublicKey.cpp.

@@ -17613,7 +17613,7 @@ template<>

Verify a signature on a message.

With secp256k1 signatures, the data is first hashed with SHA512-Half, and the resulting digest is signed.

-

Definition at line 288 of file PublicKey.cpp.

+

Definition at line 289 of file PublicKey.cpp.

@@ -17635,7 +17635,7 @@ template<>

Calculate the 160-bit node ID from a node public key.

-

Definition at line 319 of file PublicKey.cpp.

+

Definition at line 320 of file PublicKey.cpp.

@@ -22604,7 +22604,7 @@ template<>
-

Definition at line 171 of file PublicKey.cpp.

+

Definition at line 172 of file PublicKey.cpp.

diff --git a/structbeast_1_1is__aged__container_3_01beast_1_1detail_1_1aged__unordered__container_3_01IsMultia80d60acae45fc077226391e490a323d.html b/structbeast_1_1is__aged__container_3_01beast_1_1detail_1_1aged__unordered__container_3_01IsMultia80d60acae45fc077226391e490a323d.html index 83c9d6d37d..525119a9c8 100644 --- a/structbeast_1_1is__aged__container_3_01beast_1_1detail_1_1aged__unordered__container_3_01IsMultia80d60acae45fc077226391e490a323d.html +++ b/structbeast_1_1is__aged__container_3_01beast_1_1detail_1_1aged__unordered__container_3_01IsMultia80d60acae45fc077226391e490a323d.html @@ -108,7 +108,7 @@ Public Member Functions

Detailed Description

template<bool IsMulti, bool IsMap, class Key, class T, class Clock, class Hash, class KeyEqual, class Allocator>
struct beast::is_aged_container< beast::detail::aged_unordered_container< IsMulti, IsMap, Key, T, Clock, Hash, KeyEqual, Allocator > >
-

Definition at line 3365 of file aged_unordered_container.h.

+

Definition at line 3364 of file aged_unordered_container.h.

Constructor & Destructor Documentation

◆ is_aged_container()

diff --git a/tokens_8cpp_source.html b/tokens_8cpp_source.html index 7f059c344f..d47a47abd4 100644 --- a/tokens_8cpp_source.html +++ b/tokens_8cpp_source.html @@ -613,7 +613,7 @@ $(function() {
544 XRPL_ASSERT(
545 num_b_58_10_coeffs <= b_58_10_coeff.size(),
546 "ripple::b58_fast::detail::b58_to_b256_be : maximum coeff");
-
547 for (auto c : input.substr(0, partial_coeff_len))
+
547 for (unsigned char c : input.substr(0, partial_coeff_len))
548 {
549 auto cur_val = ::ripple::alphabetReverse[c];
550 if (cur_val < 0)
@@ -627,7 +627,7 @@ $(function() {
558 {
559 for (int j = 0; j < num_full_coeffs; ++j)
560 {
-
561 auto c = input[partial_coeff_len + j * 10 + i];
+
561 unsigned char c = input[partial_coeff_len + j * 10 + i];
562 auto cur_val = ::ripple::alphabetReverse[c];
563 if (cur_val < 0)
564 {