feat: serialize as cbor

This commit is contained in:
rvcas 2024-03-07 19:29:57 -05:00 committed by Lucas
parent 836e853827
commit 2b5ed95df5
3 changed files with 52 additions and 1 deletions

46
Cargo.lock generated vendored
View File

@ -128,6 +128,7 @@ dependencies = [
"askama",
"blst",
"built",
"ciborium",
"cryptoxide",
"dirs",
"fslock",
@ -556,6 +557,33 @@ dependencies = [
"stacker",
]
[[package]]
name = "ciborium"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"
dependencies = [
"ciborium-io",
"ciborium-ll",
"serde",
]
[[package]]
name = "ciborium-io"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"
[[package]]
name = "ciborium-ll"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
dependencies = [
"ciborium-io",
"half 2.4.0",
]
[[package]]
name = "cipher"
version = "0.4.4"
@ -756,6 +784,12 @@ dependencies = [
"winapi",
]
[[package]]
name = "crunchy"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "crypto-bigint"
version = "0.5.5"
@ -1195,6 +1229,16 @@ version = "1.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403"
[[package]]
name = "half"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e"
dependencies = [
"cfg-if",
"crunchy",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
@ -1730,7 +1774,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d15f4203d71fdf90903c2696e55426ac97a363c67b218488a73b534ce7aca10"
dependencies = [
"half",
"half 1.8.3",
"minicbor-derive",
]

View File

@ -47,6 +47,7 @@ num-bigint = "0.4.4"
cryptoxide = "0.4.4"
vec1 = "1.10.1"
patricia_tree = "0.8.0"
ciborium = "0.2.2"
[dev-dependencies]
blst = "0.3.11"

View File

@ -728,6 +728,12 @@ where
input_path: path,
};
let mut module_bytes = vec![];
ciborium::into_writer(&checked_module, &mut module_bytes).unwrap();
println!("{name}\n{}", hex::encode(&module_bytes));
self.checked_modules.insert(name, checked_module);
}
}