426 env.
app().getNodeFamily());
432 for (
auto const x : vec)
434 ledger->rawInsert(
sle(x));
439 BEAST_EXPECT(
sles(*ledger) ==
list(1, 2, 3));
440 auto const e = ledger->stateMap().end();
441 auto b1 = ledger->stateMap().begin();
442 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(1)) == e);
443 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(2)) == b1);
445 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(3)) == b1);
447 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(4)) == b1);
448 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(5)) == b1);
449 b1 = ledger->stateMap().begin();
450 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(0)) == b1);
452 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(1)) == b1);
454 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(2)) == b1);
455 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(3)) == e);
460 BEAST_EXPECT(
sles(*ledger) ==
list(2, 4, 6));
461 auto const e = ledger->stateMap().end();
462 auto b1 = ledger->stateMap().begin();
463 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(1)) == e);
464 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(2)) == e);
465 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(3)) == b1);
466 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(4)) == b1);
468 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(5)) == b1);
469 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(6)) == b1);
471 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(7)) == b1);
472 b1 = ledger->stateMap().begin();
473 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(1)) == b1);
475 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(2)) == b1);
476 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(3)) == b1);
479 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(4)) == b1);
480 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(5)) == b1);
481 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(6)) == e);
482 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(7)) == e);
485 setup({2, 3, 5, 6, 10, 15});
486 BEAST_EXPECT(
sles(*ledger) ==
list(2, 3, 5, 6, 10, 15));
487 auto const e = ledger->stateMap().end();
488 auto b = ledger->stateMap().begin();
489 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(1)) == e);
490 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(2)) == e);
491 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(3)) == b);
493 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(4)) == b);
494 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(5)) == b);
496 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(6)) == b);
498 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(7)) == b);
499 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(8)) == b);
500 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(9)) == b);
501 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(10)) == b);
503 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(11)) == b);
504 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(12)) == b);
505 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(13)) == b);
506 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(14)) == b);
507 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(15)) == b);
509 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(16)) == b);
510 b = ledger->stateMap().begin();
511 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(0)) == b);
512 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(1)) == b);
514 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(2)) == b);
516 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(3)) == b);
517 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(4)) == b);
519 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(5)) == b);
521 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(6)) == b);
522 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(7)) == b);
523 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(8)) == b);
524 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(9)) == b);
526 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(10)) == b);
527 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(11)) == b);
528 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(12)) == b);
529 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(13)) == b);
530 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(14)) == b);
532 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(15)) == e);
533 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(16)) == e);
538 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 25, 30,
539 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 66, 100,
583 auto const b = ledger->stateMap().begin();
584 auto const e = ledger->stateMap().end();
585 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(0)) == e);
586 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(1)) == b);
587 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(5))->key() ==
UInt256(4));
588 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(15))->key() ==
UInt256(14));
589 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(16))->key() ==
UInt256(15));
590 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(19))->key() ==
UInt256(16));
591 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(20))->key() ==
UInt256(16));
592 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(24))->key() ==
UInt256(20));
593 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(31))->key() ==
UInt256(30));
594 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(32))->key() ==
UInt256(30));
595 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(40))->key() ==
UInt256(39));
596 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(47))->key() ==
UInt256(46));
597 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(48))->key() ==
UInt256(47));
598 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(64))->key() ==
UInt256(48));
600 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(90))->key() ==
UInt256(66));
601 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(96))->key() ==
UInt256(66));
602 BEAST_EXPECT(ledger->stateMap().lowerBound(
UInt256(100))->key() ==
UInt256(66));
604 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(0))->key() ==
UInt256(1));
605 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(5))->key() ==
UInt256(6));
606 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(15))->key() ==
UInt256(16));
607 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(16))->key() ==
UInt256(20));
608 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(18))->key() ==
UInt256(20));
609 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(20))->key() ==
UInt256(25));
610 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(31))->key() ==
UInt256(32));
611 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(32))->key() ==
UInt256(33));
612 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(47))->key() ==
UInt256(48));
613 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(48))->key() ==
UInt256(66));
614 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(53))->key() ==
UInt256(66));
615 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(66))->key() ==
UInt256(100));
616 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(70))->key() ==
UInt256(100));
617 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(85))->key() ==
UInt256(100));
618 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(98))->key() ==
UInt256(100));
619 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(100)) == e);
620 BEAST_EXPECT(ledger->stateMap().upperBound(
UInt256(155)) == e);
959 auto const alice =
Account(
"alice");
960 auto const bob =
Account(
"bob");
967 auto const rdViewA3 = eA.
closed();
971 auto const rdViewA4 = eA.
closed();
981 auto const rdViewB3 = eB.
closed();
985 auto const rdViewB4 = eB.
closed();
989 BEAST_EXPECT(
areCompatible(*rdViewA3, *rdViewA4, jStream,
""));
990 BEAST_EXPECT(
areCompatible(*rdViewA4, *rdViewA3, jStream,
""));
991 BEAST_EXPECT(
areCompatible(*rdViewA4, *rdViewA4, jStream,
""));
992 BEAST_EXPECT(!
areCompatible(*rdViewA3, *rdViewB4, jStream,
""));
993 BEAST_EXPECT(!
areCompatible(*rdViewA4, *rdViewB3, jStream,
""));
994 BEAST_EXPECT(!
areCompatible(*rdViewA4, *rdViewB4, jStream,
""));
998 auto const& iA3 = rdViewA3->header();
999 auto const& iA4 = rdViewA4->header();
1001 BEAST_EXPECT(
areCompatible(iA3.hash, iA3.seq, *rdViewA4, jStream,
""));
1002 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewA3, jStream,
""));
1003 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewA4, jStream,
""));
1004 BEAST_EXPECT(!
areCompatible(iA3.hash, iA3.seq, *rdViewB4, jStream,
""));
1005 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewB3, jStream,
""));
1006 BEAST_EXPECT(!
areCompatible(iA4.hash, iA4.seq, *rdViewB4, jStream,
""));