mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-26 08:57:26 +02:00
cleanup compile and tests
Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
parent
040e130666
commit
cdade06361
2 changed files with 7 additions and 4 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue