-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a ton of documentation, minor cleanup.
- Loading branch information
Showing
9 changed files
with
120 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
members = [ | ||
"dag", | ||
"db", | ||
"verification" | ||
"validation" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
extern crate libjiyunet_dag as dag; | ||
extern crate libjiyunet_db as db; | ||
|
||
#[derive(Copy, Clone, Eq, PartialEq)] | ||
pub enum ValidationError { | ||
DecodeError(dag::Address), // Problem decoding data. | ||
NodeNotFound(dag::Address), // Node not found in db, try again later? | ||
ComponentTooLarge(dag::sig::Hash), // If something is too big to be allowed. | ||
InsufficientCredits, // Identitiy doesn't have credits for some action. | ||
} | ||
|
||
type SignedBlock = dag::comp::Signed<dag::comp::Block>; | ||
type SignedArtifactContainer = dag::comp::Signed<dag::comp::ArtifactContainer>; | ||
|
||
enum Addable { | ||
Block(SignedBlock), | ||
ArtifactContainer(SignedArtifactContainer) | ||
} | ||
|
||
trait Validate { | ||
|
||
fn new(genesis: dag::comp::Signed<dag::comp::Block>) -> Result<Box<Self>, ValidationError>; | ||
fn include(self, added: Addable) -> Result<Box<Self>, (Box<Self>, ValidationError)>; | ||
|
||
} |
Oops, something went wrong.