Added some checks for "Yggdrasil only" zones.

This commit is contained in:
Revertron
2021-04-10 20:02:51 +02:00
parent 04189f319a
commit f671de3746
5 changed files with 68 additions and 4 deletions
+10
View File
@@ -53,6 +53,16 @@ impl Transaction {
let confirmation = hash_identity(&domain, Some(&self.pub_key));
self.identity.eq(&hash) && self.confirmation.eq(&confirmation)
}
/// Returns [DomainData] from this transaction if it has it
pub fn get_domain_data(&self) -> Option<DomainData> {
if self.class == "domain" {
if let Ok(data) = serde_json::from_str::<DomainData>(&self.data) {
return Some(data)
}
}
None
}
}
impl fmt::Debug for Transaction {