Skip to content

Commit 22ad80a

Browse files
committed
Fix EpochSettingStore sorting
1 parent 074ac76 commit 22ad80a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mithril-aggregator/src/database/provider/epoch_setting.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'client> Provider<'client> for EpochSettingProvider<'client> {
126126
fn get_definition(&self, condition: &str) -> String {
127127
let aliases = SourceAlias::new(&[("{:epoch_setting:}", "es")]);
128128
let projection = Self::Entity::get_projection().expand(aliases);
129-
format!("select {projection} from epoch_setting as es where {condition} order by epoch_setting_id asc")
129+
format!("select {projection} from epoch_setting as es where {condition} order by epoch_setting_id desc")
130130
}
131131
}
132132

@@ -596,6 +596,9 @@ mod tests {
596596
.get_last_n_records(epoch_settings.len())
597597
.await
598598
.unwrap()
599+
.into_iter()
600+
.rev()
601+
.collect::<Vec<(Epoch, ProtocolParameters)>>()
599602
)
600603
}
601604
}

0 commit comments

Comments
 (0)