Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Merge b0decec into c03b70a
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-da committed Jan 21, 2021
2 parents c03b70a + b0decec commit 1c49bf7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/brb_tree.rs
@@ -1,3 +1,12 @@
// Copyright 2021 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.

use crdt_tree::{Clock, OpMove, State, TreeId, TreeMeta};

use brb::BRBDataType;
Expand All @@ -6,11 +15,7 @@ use serde::Serialize;
use std::{fmt::Debug, hash::Hash};
use thiserror::Error;

/// BRBTRee is a BRBDataType wrapper around a Tree CRDT. (crdt_tree)
///
/// This enables Tree operations to be transmitted in a BFT manner
/// using Byzantine Reliable Broadcast.

/// A BRBDataType wrapper around crdt_tree::State
#[derive(Debug, Serialize, PartialEq, Eq, Clone)]
pub struct BRBTree<A: Clone + Hash + Ord, ID: TreeId, M: TreeMeta> {
actor: A,
Expand All @@ -34,6 +39,7 @@ impl<A: Clone + Hash + Ord, ID: TreeId, M: TreeMeta> BRBTree<A, ID, M> {
}
}

/// An enumeration of possible Validation Errors
#[derive(Error, Debug, PartialEq, Eq)]
pub enum ValidationError {
#[error("The source actor does not match the actor associated with the operation")]
Expand Down
17 changes: 16 additions & 1 deletion src/lib.rs
@@ -1,3 +1,18 @@
/// BFT CRDT Tree algorithm
// Copyright 2021 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.

//! BRBTree is a BRBDataType wrapper around a Tree CRDT. (crdt_tree)
//!
//! This wrapper enables Tree operations to be transmitted in a BFT manner
//! using Byzantine Reliable Broadcast.

#![deny(missing_docs)]

mod brb_tree;
pub use brb_tree::BRBTree;

0 comments on commit 1c49bf7

Please sign in to comment.