426 env.
app().getNodeFamily());
434 ledger->rawInsert(
sle(x));
439 BEAST_EXPECT(
sles(*ledger) ==
list(1, 2, 3));
440 auto 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 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 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);
537 setup({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 25, 30,
538 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 66, 100});
581 auto b = ledger->stateMap().begin();
582 auto e = ledger->stateMap().end();
583 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(0)) == e);
584 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(1)) == b);
585 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(5))->key() ==
uint256(4));
586 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(15))->key() ==
uint256(14));
587 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(16))->key() ==
uint256(15));
588 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(19))->key() ==
uint256(16));
589 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(20))->key() ==
uint256(16));
590 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(24))->key() ==
uint256(20));
591 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(31))->key() ==
uint256(30));
592 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(32))->key() ==
uint256(30));
593 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(40))->key() ==
uint256(39));
594 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(47))->key() ==
uint256(46));
595 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(48))->key() ==
uint256(47));
596 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(64))->key() ==
uint256(48));
598 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(90))->key() ==
uint256(66));
599 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(96))->key() ==
uint256(66));
600 BEAST_EXPECT(ledger->stateMap().lowerBound(
uint256(100))->key() ==
uint256(66));
602 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(0))->key() ==
uint256(1));
603 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(5))->key() ==
uint256(6));
604 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(15))->key() ==
uint256(16));
605 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(16))->key() ==
uint256(20));
606 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(18))->key() ==
uint256(20));
607 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(20))->key() ==
uint256(25));
608 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(31))->key() ==
uint256(32));
609 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(32))->key() ==
uint256(33));
610 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(47))->key() ==
uint256(48));
611 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(48))->key() ==
uint256(66));
612 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(53))->key() ==
uint256(66));
613 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(66))->key() ==
uint256(100));
614 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(70))->key() ==
uint256(100));
615 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(85))->key() ==
uint256(100));
616 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(98))->key() ==
uint256(100));
617 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(100)) == e);
618 BEAST_EXPECT(ledger->stateMap().upperBound(
uint256(155)) == e);
957 auto const alice =
Account(
"alice");
958 auto const bob =
Account(
"bob");
965 auto const rdViewA3 = eA.
closed();
969 auto const rdViewA4 = eA.
closed();
979 auto const rdViewB3 = eB.
closed();
983 auto const rdViewB4 = eB.
closed();
987 BEAST_EXPECT(
areCompatible(*rdViewA3, *rdViewA4, jStream,
""));
988 BEAST_EXPECT(
areCompatible(*rdViewA4, *rdViewA3, jStream,
""));
989 BEAST_EXPECT(
areCompatible(*rdViewA4, *rdViewA4, jStream,
""));
990 BEAST_EXPECT(!
areCompatible(*rdViewA3, *rdViewB4, jStream,
""));
991 BEAST_EXPECT(!
areCompatible(*rdViewA4, *rdViewB3, jStream,
""));
992 BEAST_EXPECT(!
areCompatible(*rdViewA4, *rdViewB4, jStream,
""));
996 auto const& iA3 = rdViewA3->header();
997 auto const& iA4 = rdViewA4->header();
999 BEAST_EXPECT(
areCompatible(iA3.hash, iA3.seq, *rdViewA4, jStream,
""));
1000 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewA3, jStream,
""));
1001 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewA4, jStream,
""));
1002 BEAST_EXPECT(!
areCompatible(iA3.hash, iA3.seq, *rdViewB4, jStream,
""));
1003 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewB3, jStream,
""));
1004 BEAST_EXPECT(!
areCompatible(iA4.hash, iA4.seq, *rdViewB4, jStream,
""));