Skip to content

Commit

Permalink
working on issue #17
Browse files Browse the repository at this point in the history
  • Loading branch information
dsietziapp committed Jan 6, 2020
1 parent ef8470b commit e21868d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/dtc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ pub struct MarkerIdentifier {
}

impl MarkerIdentifier {
/// Serializes the MarkerIdenifier.
///
/// #Example
///
/// ```
/// extern crate pbd;
///
/// use pbd::dtc::Marker;
///
/// fn main() {
/// let marker = Marker::new(1, 1578071239, "notifier~billing~receipt~email".to_string(), "order~clothing~iStore~15150".to_string(), "hash-12345".to_string());
///
/// println!("{}", marker.identifier.serialize());
/// }
/// ```
pub fn serialize(&self) -> String {
serde_json::to_string(&self).unwrap()
}
Expand Down Expand Up @@ -128,6 +143,25 @@ impl Marker {
nonce: DIFFICULTY,
}
}

/// Serializes the Marker.
///
/// #Example
///
/// ```
/// extern crate pbd;
///
/// use pbd::dtc::Marker;
///
/// fn main() {
/// let marker = Marker::new(1, 1578071239, "notifier~billing~receipt~email".to_string(), "order~clothing~iStore~15150".to_string(), "hash-12345".to_string());
///
/// println!("{}", marker.serialize());
/// }
/// ```
pub fn serialize(&self) -> String {
serde_json::to_string(&self).unwrap()
}
}

/// Represents a Tacker (a.k.a. MarkerChain)
Expand Down

0 comments on commit e21868d

Please sign in to comment.