411 env.
app().getNodeFamily());
419 ledger->rawInsert(
sle(x));
424 BEAST_EXPECT(
sles(*ledger) ==
list(1, 2, 3));
425 auto e = ledger->stateMap().end();
426 auto b1 = ledger->stateMap().begin();
427 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(1)) == e);
428 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(2)) == b1);
430 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(3)) == b1);
432 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(4)) == b1);
433 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(5)) == b1);
434 b1 = ledger->stateMap().begin();
435 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(0)) == b1);
437 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(1)) == b1);
439 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(2)) == b1);
440 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(3)) == e);
445 BEAST_EXPECT(
sles(*ledger) ==
list(2, 4, 6));
446 auto e = ledger->stateMap().end();
447 auto b1 = ledger->stateMap().begin();
448 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(1)) == e);
449 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(2)) == e);
450 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(3)) == b1);
451 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(4)) == b1);
453 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(5)) == b1);
454 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(6)) == b1);
456 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(7)) == b1);
457 b1 = ledger->stateMap().begin();
458 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(1)) == b1);
460 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(2)) == b1);
461 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(3)) == b1);
464 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(4)) == b1);
465 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(5)) == b1);
466 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(6)) == e);
467 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(7)) == e);
470 setup({2, 3, 5, 6, 10, 15});
471 BEAST_EXPECT(
sles(*ledger) ==
list(2, 3, 5, 6, 10, 15));
472 auto e = ledger->stateMap().end();
473 auto b = ledger->stateMap().begin();
474 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(1)) == e);
475 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(2)) == e);
476 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(3)) == b);
478 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(4)) == b);
479 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(5)) == b);
481 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(6)) == b);
483 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(7)) == b);
484 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(8)) == b);
485 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(9)) == b);
486 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(10)) == b);
488 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(11)) == b);
489 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(12)) == b);
490 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(13)) == b);
491 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(14)) == b);
492 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(15)) == b);
494 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(16)) == b);
495 b = ledger->stateMap().begin();
496 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(0)) == b);
497 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(1)) == b);
499 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(2)) == b);
501 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(3)) == b);
502 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(4)) == b);
504 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(5)) == b);
506 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(6)) == b);
507 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(7)) == b);
508 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(8)) == b);
509 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(9)) == b);
511 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(10)) == b);
512 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(11)) == b);
513 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(12)) == b);
514 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(13)) == b);
515 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(14)) == b);
517 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(15)) == e);
518 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(16)) == e);
522 setup({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
523 13, 14, 15, 16, 20, 25, 30, 32, 33, 34, 35, 36, 37,
524 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 66, 100});
567 auto b = ledger->stateMap().begin();
568 auto e = ledger->stateMap().end();
569 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(0)) == e);
570 BEAST_EXPECT(ledger->stateMap().lower_bound(
uint256(1)) == b);
572 ledger->stateMap().lower_bound(
uint256(5))->key() ==
575 ledger->stateMap().lower_bound(
uint256(15))->key() ==
578 ledger->stateMap().lower_bound(
uint256(16))->key() ==
581 ledger->stateMap().lower_bound(
uint256(19))->key() ==
584 ledger->stateMap().lower_bound(
uint256(20))->key() ==
587 ledger->stateMap().lower_bound(
uint256(24))->key() ==
590 ledger->stateMap().lower_bound(
uint256(31))->key() ==
593 ledger->stateMap().lower_bound(
uint256(32))->key() ==
596 ledger->stateMap().lower_bound(
uint256(40))->key() ==
599 ledger->stateMap().lower_bound(
uint256(47))->key() ==
602 ledger->stateMap().lower_bound(
uint256(48))->key() ==
605 ledger->stateMap().lower_bound(
uint256(64))->key() ==
609 ledger->stateMap().lower_bound(
uint256(90))->key() ==
612 ledger->stateMap().lower_bound(
uint256(96))->key() ==
615 ledger->stateMap().lower_bound(
uint256(100))->key() ==
619 ledger->stateMap().upper_bound(
uint256(0))->key() ==
622 ledger->stateMap().upper_bound(
uint256(5))->key() ==
625 ledger->stateMap().upper_bound(
uint256(15))->key() ==
628 ledger->stateMap().upper_bound(
uint256(16))->key() ==
631 ledger->stateMap().upper_bound(
uint256(18))->key() ==
634 ledger->stateMap().upper_bound(
uint256(20))->key() ==
637 ledger->stateMap().upper_bound(
uint256(31))->key() ==
640 ledger->stateMap().upper_bound(
uint256(32))->key() ==
643 ledger->stateMap().upper_bound(
uint256(47))->key() ==
646 ledger->stateMap().upper_bound(
uint256(48))->key() ==
649 ledger->stateMap().upper_bound(
uint256(53))->key() ==
652 ledger->stateMap().upper_bound(
uint256(66))->key() ==
655 ledger->stateMap().upper_bound(
uint256(70))->key() ==
658 ledger->stateMap().upper_bound(
uint256(85))->key() ==
661 ledger->stateMap().upper_bound(
uint256(98))->key() ==
663 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(100)) == e);
664 BEAST_EXPECT(ledger->stateMap().upper_bound(
uint256(155)) == e);
1001 using namespace jtx;
1002 auto const alice =
Account(
"alice");
1003 auto const bob =
Account(
"bob");
1010 auto const rdViewA3 = eA.
closed();
1014 auto const rdViewA4 = eA.
closed();
1024 auto const rdViewB3 = eB.closed();
1026 eB.fund(
XRP(10000), alice);
1028 auto const rdViewB4 = eB.closed();
1032 BEAST_EXPECT(
areCompatible(*rdViewA3, *rdViewA4, jStream,
""));
1033 BEAST_EXPECT(
areCompatible(*rdViewA4, *rdViewA3, jStream,
""));
1034 BEAST_EXPECT(
areCompatible(*rdViewA4, *rdViewA4, jStream,
""));
1035 BEAST_EXPECT(!
areCompatible(*rdViewA3, *rdViewB4, jStream,
""));
1036 BEAST_EXPECT(!
areCompatible(*rdViewA4, *rdViewB3, jStream,
""));
1037 BEAST_EXPECT(!
areCompatible(*rdViewA4, *rdViewB4, jStream,
""));
1041 auto const& iA3 = rdViewA3->info();
1042 auto const& iA4 = rdViewA4->info();
1044 BEAST_EXPECT(
areCompatible(iA3.hash, iA3.seq, *rdViewA4, jStream,
""));
1045 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewA3, jStream,
""));
1046 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewA4, jStream,
""));
1047 BEAST_EXPECT(!
areCompatible(iA3.hash, iA3.seq, *rdViewB4, jStream,
""));
1048 BEAST_EXPECT(
areCompatible(iA4.hash, iA4.seq, *rdViewB3, jStream,
""));
1049 BEAST_EXPECT(!
areCompatible(iA4.hash, iA4.seq, *rdViewB4, jStream,
""));