Skip to content

Commit

Permalink
Serialize as byte array
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Jun 26, 2024
1 parent b6a20d5 commit 34c853f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libwasmvm/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ impl From<cosmwasm_vm::PerModuleMetrics> for PerModuleMetrics {

#[derive(Serialize)]
struct PinnedMetrics {
per_module: Vec<(Checksum, PerModuleMetrics)>,
// TODO: Remove the array usage as soon as the metrics have a stable wire format
per_module: Vec<([u8; 32], PerModuleMetrics)>,
}

impl From<cosmwasm_vm::PinnedMetrics> for PinnedMetrics {
Expand All @@ -442,7 +443,7 @@ impl From<cosmwasm_vm::PinnedMetrics> for PinnedMetrics {
per_module: value
.per_module
.into_iter()
.map(|(checksum, metrics)| (checksum, metrics.into()))
.map(|(checksum, metrics)| (*checksum.as_ref(), metrics.into()))
.collect(),
}
}
Expand Down

0 comments on commit 34c853f

Please sign in to comment.