Calling Logging fixing
This commit is contained in:
parent
3c0344ef64
commit
3cb2f0ec5e
12 changed files with 118 additions and 112 deletions
|
|
@ -6,6 +6,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
|
|||
use uuid::Uuid;
|
||||
|
||||
#[derive(Eq, Hash, PartialEq, Clone, Debug)]
|
||||
#[allow(non_camel_case_types, dead_code)]
|
||||
pub enum DataTypes {
|
||||
error_type,
|
||||
accepted_ids,
|
||||
|
|
@ -153,10 +154,14 @@ impl DataTypes {
|
|||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[allow(non_camel_case_types, dead_code)]
|
||||
pub enum CommunicationType {
|
||||
error,
|
||||
error_invalid_user_id,
|
||||
error_not_found,
|
||||
error_no_iota,
|
||||
error_invalid_challenge,
|
||||
error_invalid_secret,
|
||||
error_invalid_private_key,
|
||||
success,
|
||||
message,
|
||||
|
|
@ -267,6 +272,7 @@ pub struct CommunicationValue {
|
|||
pub data: HashMap<DataTypes, JsonValue>,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl CommunicationValue {
|
||||
pub fn new(comm_type: CommunicationType) -> Self {
|
||||
Self {
|
||||
|
|
@ -366,14 +372,6 @@ impl CommunicationValue {
|
|||
data,
|
||||
}
|
||||
}
|
||||
pub fn ack_message(message_id: Uuid, sender: Uuid) -> CommunicationValue {
|
||||
let mut cv = CommunicationValue::new(CommunicationType::message).with_id(message_id);
|
||||
|
||||
let s = sender;
|
||||
cv = cv.add_data(DataTypes::send_time, JsonValue::String(s.to_string()));
|
||||
|
||||
cv
|
||||
}
|
||||
pub fn forward_to_other_iota(original: &mut CommunicationValue) -> CommunicationValue {
|
||||
let receiver = Uuid::from_str(
|
||||
&*original
|
||||
|
|
|
|||
Loading…
Reference in a new issue