Skip to content
Snippets Groups Projects
Commit 71d397cf authored by Éloïs's avatar Éloïs
Browse files

[feat] documents: DUBPDocumentStr: impl block variant

parent 8f481dc6
No related branches found
No related tags found
1 merge request!183Resolve "Documents: add versioning"
...@@ -431,7 +431,7 @@ impl IntoSpecializedDocument<DUBPDocument> for BlockDocument { ...@@ -431,7 +431,7 @@ impl IntoSpecializedDocument<DUBPDocument> for BlockDocument {
} }
} }
#[derive(Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct BlockDocumentStringified { pub struct BlockDocumentStringified {
/// Version /// Version
pub version: u64, pub version: u64,
......
...@@ -61,7 +61,7 @@ pub enum DUBPDocument { ...@@ -61,7 +61,7 @@ pub enum DUBPDocument {
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub enum DUBPDocumentStr { pub enum DUBPDocumentStr {
/// Block document (not yet implemented) /// Block document (not yet implemented)
Block(), Block(Box<BlockDocumentStringified>),
/// Transaction document. /// Transaction document.
Transaction(Box<TransactionDocumentStringified>), Transaction(Box<TransactionDocumentStringified>),
...@@ -84,7 +84,9 @@ impl ToStringObject for DUBPDocument { ...@@ -84,7 +84,9 @@ impl ToStringObject for DUBPDocument {
/// Transforms an object into a json object /// Transforms an object into a json object
fn to_string_object(&self) -> Self::StringObject { fn to_string_object(&self) -> Self::StringObject {
match *self { match *self {
DUBPDocument::Block(_) => unimplemented!(), DUBPDocument::Block(ref doc) => {
DUBPDocumentStr::Block(Box::new(doc.to_string_object()))
}
DUBPDocument::Identity(ref doc) => DUBPDocumentStr::Identity(doc.to_string_object()), DUBPDocument::Identity(ref doc) => DUBPDocumentStr::Identity(doc.to_string_object()),
DUBPDocument::Membership(ref doc) => { DUBPDocument::Membership(ref doc) => {
DUBPDocumentStr::Membership(doc.to_string_object()) DUBPDocumentStr::Membership(doc.to_string_object())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment