This commit is contained in:
DieMyst 2021-01-20 16:14:20 +03:00
parent 0e2590d894
commit 3249aa376c
8 changed files with 13 additions and 12 deletions

View File

@ -17,7 +17,7 @@
use crate::signature::Signature;
use core::fmt::Debug;
use ed25519_dalek::SignatureError;
use serde::{Serialize, Deserialize};
use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct PublicKey(pub(crate) ed25519_dalek::PublicKey);

View File

@ -15,7 +15,7 @@
*/
use ed25519_dalek::SignatureError;
use serde::{Serialize, Deserialize};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct SecretKey(ed25519_dalek::SecretKey);

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
use serde::{Deserialize, Serialize};
use signature::Signature as SigSignature;
use serde::{Serialize, Deserialize};
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Signature(pub ed25519_dalek::Signature);

View File

@ -39,8 +39,8 @@ mod trust_node;
pub use crate::certificate::Certificate;
pub use crate::misc::current_time;
pub use crate::public_key_hashable::PublicKeyHashable;
pub use crate::trust::Trust;
pub use crate::revoke::Revoke;
pub use crate::trust_node::{TrustNode, Auth};
pub use crate::trust::Trust;
pub use crate::trust_graph::{TrustGraph, Weight};
pub use crate::trust_graph_storage::Storage;
pub use crate::trust_node::{Auth, TrustNode};

View File

@ -18,11 +18,11 @@ use fluence_identity::public_key::PublicKey;
use core::fmt;
use ref_cast::RefCast;
use serde::ser::Serializer;
use std::{
fmt::{Display, Formatter},
hash::{Hash, Hasher},
};
use serde::ser::{Serializer};
/// Wrapper to use PublicKey in HashMap
#[derive(PartialEq, Eq, Debug, Clone, RefCast)]
@ -82,8 +82,9 @@ impl Display for PublicKeyHashable {
impl serde::Serialize for PublicKeyHashable {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer {
where
S: Serializer,
{
serializer.serialize_bytes(&self.0.to_bytes())
}
}

View File

@ -18,8 +18,8 @@ use crate::trust::{EXPIRATION_LEN, PK_LEN};
use fluence_identity::key_pair::KeyPair;
use fluence_identity::public_key::PublicKey;
use fluence_identity::signature::Signature;
use serde::{Deserialize, Serialize};
use std::time::Duration;
use serde::{Serialize, Deserialize};
/// "A document" that cancels trust created before.
/// TODO delete pk from Revoke (it is already in a trust node)

View File

@ -18,9 +18,9 @@ use derivative::Derivative;
use fluence_identity::key_pair::KeyPair;
use fluence_identity::public_key::PublicKey;
use fluence_identity::signature::Signature;
use serde::{Deserialize, Serialize};
use std::convert::TryInto;
use std::time::Duration;
use serde::{Serialize, Deserialize};
pub const SIG_LEN: usize = 64;
pub const PK_LEN: usize = 32;

View File

@ -19,9 +19,9 @@ use crate::revoke::Revoke;
use crate::trust::Trust;
use failure::_core::time::Duration;
use fluence_identity::public_key::PublicKey;
use std::collections::HashMap;
use serde::{Serialize, Deserialize};
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
use std::collections::HashMap;
#[derive(Debug, Clone, Serialize, Deserialize)]
enum TrustRelation {