zebra_state/service/finalized_state/disk_format/
tests.rs1#![allow(clippy::unwrap_in_result)]
4
5use serde::{Deserialize, Serialize};
6
7#[cfg(test)]
8mod prop;
9#[cfg(test)]
10mod snapshot;
11
12#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
14pub struct KV {
15 k: String,
17
18 v: String,
20}
21
22impl KV {
23 pub fn new<K, V>(key: K, value: V) -> KV
25 where
26 K: AsRef<[u8]>,
27 V: AsRef<[u8]>,
28 {
29 KV::new_hex(hex::encode(key), hex::encode(value))
30 }
31
32 pub fn new_hex(key: String, value: String) -> KV {
34 KV { k: key, v: value }
35 }
36}