Skip to content

Commit aab7784

Browse files
committed
Order the chunks before sending them
Signed-off-by: Jacinta Ferrant <jacinta.ferrant@gmail.com>
1 parent 9186ffe commit aab7784

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

libsigner/src/tests/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ fn test_simple_signer() {
142142
chunks.push(chunk_event);
143143
}
144144

145+
chunks.sort_by(|ev1, ev2| {
146+
ev1.modified_slots[0]
147+
.slot_id
148+
.partial_cmp(&ev2.modified_slots[0].slot_id)
149+
.unwrap()
150+
});
151+
145152
let thread_chunks = chunks.clone();
146153

147154
// simulate a node that's trying to push data
@@ -177,13 +184,6 @@ fn test_simple_signer() {
177184
sleep_ms(5000);
178185
let accepted_events = running_signer.stop().unwrap();
179186

180-
chunks.sort_by(|ev1, ev2| {
181-
ev1.modified_slots[0]
182-
.slot_id
183-
.partial_cmp(&ev2.modified_slots[0].slot_id)
184-
.unwrap()
185-
});
186-
187187
let sent_events: Vec<SignerEvent<SignerMessage>> = chunks
188188
.iter()
189189
.map(|chunk| {

0 commit comments

Comments
 (0)