From fbe5d807e6683e3cc2fee67075bbf05a4a3c749b Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 10 Nov 2022 22:11:57 -0500 Subject: [PATCH] unit tests pass --- veilid-core/src/attachment_manager.rs | 1 + veilid-core/src/crypto/key.rs | 1 + veilid-core/src/intf/native/protected_store.rs | 3 ++- veilid-core/src/intf/table_db.rs | 3 ++- veilid-core/src/routing_table/bucket.rs | 1 + veilid-core/src/routing_table/bucket_entry.rs | 4 +++- veilid-core/src/routing_table/route_spec_store.rs | 4 +++- veilid-core/src/veilid_api/mod.rs | 1 + veilid-core/src/veilid_api/serialize_helpers.rs | 6 +++--- 9 files changed, 17 insertions(+), 7 deletions(-) diff --git a/veilid-core/src/attachment_manager.rs b/veilid-core/src/attachment_manager.rs index 8afafcdd..48447e3f 100644 --- a/veilid-core/src/attachment_manager.rs +++ b/veilid-core/src/attachment_manager.rs @@ -6,6 +6,7 @@ use crate::xx::*; use crate::*; use core::convert::TryFrom; use core::fmt; +use rkyv::{Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize}; use serde::*; state_machine! { diff --git a/veilid-core/src/crypto/key.rs b/veilid-core/src/crypto/key.rs index ad484a65..7da8c9ad 100644 --- a/veilid-core/src/crypto/key.rs +++ b/veilid-core/src/crypto/key.rs @@ -12,6 +12,7 @@ use digest::generic_array::typenum::U64; use digest::{Digest, Output}; use ed25519_dalek::{Keypair, PublicKey, Signature}; use generic_array::GenericArray; +use rkyv::{Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize}; ////////////////////////////////////////////////////////////////////// diff --git a/veilid-core/src/intf/native/protected_store.rs b/veilid-core/src/intf/native/protected_store.rs index a784189e..a3c35f68 100644 --- a/veilid-core/src/intf/native/protected_store.rs +++ b/veilid-core/src/intf/native/protected_store.rs @@ -2,6 +2,7 @@ use crate::xx::*; use crate::*; use data_encoding::BASE64URL_NOPAD; use keyring_manager::*; +use rkyv::{Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize}; use std::path::Path; pub struct ProtectedStoreInner { @@ -167,7 +168,7 @@ impl ProtectedStore { ::Archived: for<'t> bytecheck::CheckBytes>, ::Archived: - rkyv::Deserialize, + RkyvDeserialize, { let out = self.load_user_secret(key).await?; let b = match out { diff --git a/veilid-core/src/intf/table_db.rs b/veilid-core/src/intf/table_db.rs index 6064d051..6e080247 100644 --- a/veilid-core/src/intf/table_db.rs +++ b/veilid-core/src/intf/table_db.rs @@ -1,5 +1,6 @@ use crate::xx::*; use crate::*; +use rkyv::{Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize}; cfg_if! { if #[cfg(target_arch = "wasm32")] { @@ -123,7 +124,7 @@ impl TableDB { ::Archived: for<'t> bytecheck::CheckBytes>, ::Archived: - rkyv::Deserialize, + RkyvDeserialize, { let db = &self.inner.lock().database; let out = db.get(col, key).wrap_err("failed to get key")?; diff --git a/veilid-core/src/routing_table/bucket.rs b/veilid-core/src/routing_table/bucket.rs index 3b17c585..b1e3199c 100644 --- a/veilid-core/src/routing_table/bucket.rs +++ b/veilid-core/src/routing_table/bucket.rs @@ -1,5 +1,6 @@ use super::*; use core::sync::atomic::Ordering; +use rkyv::{Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize}; pub struct Bucket { routing_table: RoutingTable, diff --git a/veilid-core/src/routing_table/bucket_entry.rs b/veilid-core/src/routing_table/bucket_entry.rs index 11032215..2ee36d1c 100644 --- a/veilid-core/src/routing_table/bucket_entry.rs +++ b/veilid-core/src/routing_table/bucket_entry.rs @@ -1,6 +1,8 @@ use super::*; use core::sync::atomic::{AtomicU32, Ordering}; -use rkyv::with::Skip; +use rkyv::{ + with::Skip, Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize, +}; /// Reliable pings are done with increased spacing between pings diff --git a/veilid-core/src/routing_table/route_spec_store.rs b/veilid-core/src/routing_table/route_spec_store.rs index e1230214..0d1f271d 100644 --- a/veilid-core/src/routing_table/route_spec_store.rs +++ b/veilid-core/src/routing_table/route_spec_store.rs @@ -1,6 +1,8 @@ use super::*; use crate::veilid_api::*; -use rkyv::with::Skip; +use rkyv::{ + with::Skip, Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize, +}; /// Compiled route (safety route + private route) #[derive(Clone, Debug)] diff --git a/veilid-core/src/veilid_api/mod.rs b/veilid-core/src/veilid_api/mod.rs index 93fb47ce..4df910ec 100644 --- a/veilid-core/src/veilid_api/mod.rs +++ b/veilid-core/src/veilid_api/mod.rs @@ -30,6 +30,7 @@ pub use routing_table::{NodeRef, NodeRefBase, RoutingTable}; use core::fmt; use core_context::{api_shutdown, VeilidCoreContext}; use enumset::*; +use rkyv::{Archive as RkyvArchive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize}; use rpc_processor::*; use serde::*; use xx::*; diff --git a/veilid-core/src/veilid_api/serialize_helpers.rs b/veilid-core/src/veilid_api/serialize_helpers.rs index 74e990f9..680e3a48 100644 --- a/veilid-core/src/veilid_api/serialize_helpers.rs +++ b/veilid-core/src/veilid_api/serialize_helpers.rs @@ -1,9 +1,9 @@ use super::*; pub use bytecheck::CheckBytes; use core::fmt::Debug; -pub use rkyv::Archive as RkyvArchive; -pub use rkyv::Deserialize as RkyvDeserialize; -pub use rkyv::Serialize as RkyvSerialize; +use rkyv::Archive as RkyvArchive; +use rkyv::Deserialize as RkyvDeserialize; +use rkyv::Serialize as RkyvSerialize; // XXX: Don't trace these functions as they are used in the transfer of API logs, which will recurse!