cleanup compile and tests

Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
Erik Hollensbe 2022-06-25 19:45:36 -07:00
parent 040e130666
commit cdade06361
No known key found for this signature in database
GPG key ID: 4BB0E241A863B389
2 changed files with 7 additions and 4 deletions

View file

@ -61,10 +61,12 @@ impl CareOf {
}
}
#[allow(unused)]
pub fn verify(&self, signer: &Identity) -> bool {
signer.verify(self.to_bytes_internal(false).as_slice(), self.signature.as_slice())
}
#[allow(unused)]
pub fn contains(&self, id: &Identity) -> bool {
self.fingerprints.binary_search(&id.fingerprint).is_ok()
}

View file

@ -428,10 +428,11 @@ impl<'de> Deserialize<'de> for Endpoint {
#[cfg(test)]
mod tests {
use zerotier_core_crypto::hash::SHA512_HASH_SIZE;
use super::{Endpoint, MAX_MARSHAL_SIZE};
use crate::{util::marshalable::Marshalable, vl1::Address};
use crate::{
util::marshalable::Marshalable,
vl1::{protocol::IDENTITY_FINGERPRINT_SIZE, Address},
};
#[test]
fn endpoint_default() {
@ -449,7 +450,7 @@ mod tests {
fn endpoint_marshal() {
use crate::util::buffer::Buffer;
let mut hash = [0u8; SHA512_HASH_SIZE];
let mut hash = [0u8; IDENTITY_FINGERPRINT_SIZE];
hash.fill_with(|| rand::random());
let zte = Endpoint::ZeroTier(Address::from_u64(rand::random::<u64>() + 1).unwrap(), hash);