Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Jan 19, 2025
1 parent 3929798 commit e44fb1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/ledger/pparams/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,21 @@ mod tests {

println!("Comparing to {:?}", filename);

let epoch = filename
.file_stem()
.and_then(|s| s.to_str())
.and_then(|s| s.parse::<u64>().ok())
.unwrap();

let updates: Vec<_> = chained_updates
.iter()
.filter(|u| u.epoch() <= epoch)
.cloned()
.collect();

// TODO: implement serialize/deserialize, and get full protocol param json files
let expected = load_json::<usize, _>(filename);
let summary = fold(&genesis, &chained_updates);
let summary = fold(&genesis, updates.as_slice());

assert_eq!(expected, summary.edge().pparams.protocol_version())

Expand Down
2 changes: 1 addition & 1 deletion src/ledger/pparams/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl ChainSummary {
self.advance(apply_epoch, pparams);
}

pub fn advance(&mut self, at_epoch: u64, pparams: MultiEraProtocolParameters) {
fn advance(&mut self, at_epoch: u64, pparams: MultiEraProtocolParameters) {
let mut edge = self.edge.take().unwrap();
let epoch_delta = at_epoch - edge.start.epoch;

Expand Down
2 changes: 1 addition & 1 deletion src/serve/grpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub async fn serve(
.register_encoded_file_descriptor_set(u5c::submit::FILE_DESCRIPTOR_SET)
.register_encoded_file_descriptor_set(u5c::watch::FILE_DESCRIPTOR_SET)
.register_encoded_file_descriptor_set(protoc_wkt::google::protobuf::FILE_DESCRIPTOR_SET)
.build_v1alpha()
.build_v1()
.unwrap();

let cors_layer = if config.permissive_cors.unwrap_or_default() {
Expand Down

0 comments on commit e44fb1d

Please sign in to comment.