diff --git a/crates/bft-json-crdt/src/json_crdt.rs b/crates/bft-json-crdt/src/json_crdt.rs index d01a1f3..2488c50 100644 --- a/crates/bft-json-crdt/src/json_crdt.rs +++ b/crates/bft-json-crdt/src/json_crdt.rs @@ -33,7 +33,7 @@ pub trait CrdtNode: CrdtNodeFromValue + Hashable + Clone { pub enum OpState { /// Operation applied successfully Ok, - /// Tried to apply an operation to a non-CRDT primative (i.e. f64, bool, etc.) + /// Tried to apply an operation to a non-CRDT primitive (i.e. f64, bool, etc.) /// If you would like a mutable primitive, wrap it in a [`LWWRegisterCRDT`] ErrApplyOnPrimitive, /// Tried to apply an operation to a static struct CRDT @@ -45,7 +45,7 @@ pub enum OpState { /// The signed digest of the message did not match the claimed author of the message. /// This can happen if the message was tampered with during delivery ErrDigestMismatch, - /// The hash of the message did not match the contents of the mesage. + /// The hash of the message did not match the contents of the message. /// This can happen if the author tried to perform an equivocation attack by creating an /// operation and modifying it has already been created ErrHashMismatch, @@ -98,8 +98,8 @@ pub struct BaseCrdt { /// Internal base CRDT pub doc: T, - /// In a real world scenario, this would be a proper hashgraph that allows for - /// efficient reconciliation of missing dependencies. We naively keep a hashset + /// In a real world scenario, this would be a proper hash graph that allows for + /// efficient reconciliation of missing dependencies. We naively keep a hash set /// of messages we've seen (represented by their [`SignedDigest`]). received: HashSet, message_q: HashMap>, @@ -190,10 +190,10 @@ impl SignedOp { } impl BaseCrdt { - /// Crease a new BaseCRDT of the given type. Multiple BaseCRDTs + /// Create a new BaseCRDT of the given type. Multiple BaseCRDTs /// can be created from a single keypair but you are responsible for /// routing messages to the right BaseCRDT. Usually you should just make a single - /// struct that contains all the state you need + /// struct that contains all the state you need. pub fn new(keypair: &Ed25519KeyPair) -> Self { let id = keypair.public().0.to_bytes(); Self {