Skip to content

Commit bde6353

Browse files
authored
Merge of #7507
2 parents e29b607 + 1eebe98 commit bde6353

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

beacon_node/beacon_chain/src/test_utils.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,10 +2671,7 @@ where
26712671
mut latest_block_hash: Option<SignedBeaconBlockHash>,
26722672
sync_committee_strategy: SyncCommitteeStrategy,
26732673
) -> AddBlocksResult<E> {
2674-
assert!(
2675-
slots.windows(2).all(|w| w[0] <= w[1]),
2676-
"Slots have to be sorted"
2677-
); // slice.is_sorted() isn't stabilized at the moment of writing this
2674+
assert!(slots.is_sorted(), "Slots have to be in ascending order");
26782675
let mut block_hash_from_slot: HashMap<Slot, SignedBeaconBlockHash> = HashMap::new();
26792676
let mut state_hash_from_slot: HashMap<Slot, BeaconStateHash> = HashMap::new();
26802677
for slot in slots {
@@ -2714,10 +2711,7 @@ where
27142711
mut latest_block_hash: Option<SignedBeaconBlockHash>,
27152712
sync_committee_strategy: SyncCommitteeStrategy,
27162713
) -> AddBlocksResult<E> {
2717-
assert!(
2718-
slots.windows(2).all(|w| w[0] <= w[1]),
2719-
"Slots have to be sorted"
2720-
); // slice.is_sorted() isn't stabilized at the moment of writing this
2714+
assert!(slots.is_sorted(), "Slots have to be in ascending order");
27212715
let mut block_hash_from_slot: HashMap<Slot, SignedBeaconBlockHash> = HashMap::new();
27222716
let mut state_hash_from_slot: HashMap<Slot, BeaconStateHash> = HashMap::new();
27232717
for slot in slots {

0 commit comments

Comments
 (0)