Skip to content

Commit 34c853f

Browse files
committed
Serialize as byte array
1 parent b6a20d5 commit 34c853f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libwasmvm/src/cache.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ impl From<cosmwasm_vm::PerModuleMetrics> for PerModuleMetrics {
433433

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

439440
impl From<cosmwasm_vm::PinnedMetrics> for PinnedMetrics {
@@ -442,7 +443,7 @@ impl From<cosmwasm_vm::PinnedMetrics> for PinnedMetrics {
442443
per_module: value
443444
.per_module
444445
.into_iter()
445-
.map(|(checksum, metrics)| (checksum, metrics.into()))
446+
.map(|(checksum, metrics)| (*checksum.as_ref(), metrics.into()))
446447
.collect(),
447448
}
448449
}

0 commit comments

Comments
 (0)