core: Replace assert with anyhow::ensure
@@ -76,7 +76,10 @@ where
// The data sources are ordered by the creation block.
// See also 8f1bca33-d3b7-4035-affc-fd6161a12448.
- assert!(data_sources.last().and_then(|d| d.creation_block) <= ds.creation_block);
+ anyhow::ensure!(
+ data_sources.last().and_then(|d| d.creation_block) <= ds.creation_block,
+ "Assertion failure: new data source has lower creation block than existing ones"
+ );
data_sources.push(ds);
}
