Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…drops into notary
  • Loading branch information
Josiah Evans committed Apr 13, 2018
2 parents 0435f49 + d380e1d commit 606e1a7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ license = "Unlicense"
repository = "https://github.com/Drops-of-Diamond/diamond_drops"
build = "build.rs"

[lib]
name = "diamond_drops"
path = "src/lib.rs"

[dependencies]
ethereum-types = "0.3.0"
ethcore-bytes = "0.1.0"
Expand Down
14 changes: 7 additions & 7 deletions diagrams/ml.dot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
digraph ml {
ndConfigType[label="{<<<Enumeration>>>\nConfigType|Mode\nNil}"][shape="record"];
ndMode[label="{<<<Enumeration>>>\nMode|Proposer\nNotary\nBoth|+ value(&self) -> String}"][shape="record"];
ndConfig[label="{<<<Structure>>>\nConfig|+ mode: Mode|+ new(mode: Mode) -> Config}"][shape="record"];
ndCollation[label="{<<<Structure>>>\nCollation|- header: header::Header\n- body: body::Body|+ new(header: header::Header, body: body::Body) -> Collation}"][shape="record"];
ndHeader[label="{<<<Structure>>>\nHeader|- shard_id: ethereum_types::U256\n- proposer_address: ethereum_types::Address\n- chunk_root: ethereum_types::H256\n- period: ethereum_types::U256|+ new(shard_id: ethereum_types::U256, chunk_root: ethereum_types::H256, period: ethereum_types::U256, proposer_address: ethereum_types::Address) -> Header\n+ hash(&self) -> ethereum_types::H256}"][shape="record"];
ndCollation[label="{<<<Structure>>>\nCollation|- header: header::Header\n- body: body::Body|+ new(header: header::Header, body: body::Body) -> Collation}"][shape="record"];
ndMessage[label="{<<<Enumeration>>>\nMessage|Selected\nShardId\nCollation\nProposal}"][shape="record"];
ndNotary[label="{<<<Structure>>>\nNotary|- selected: bool\n- shard_id: ethereum_types::U256\n- collation_vectors: HashMap<ethereum_types::U256, Vec<collation::Collation>>\n- listener: mpsc::Receiver<message::Message>|+ new(listener: mpsc::Receiver<message::Message>) -> Notary\n+ run(&mut self)\n- store_collation(&mut self, collation: collation::Collation)\n- store_proposal(&mut self, collation: collation::Collation)\n- get_availability(&mut self)\n- submit_vote(&self)}"][shape="record"];
ndSMCListener[label="{<<<Structure>>>\nSMCListener|- period: usize\n- notary_sender: mpsc::Sender<message::Message>|+ new(notary_sender: mpsc::Sender<message::Message>) -> SMCListener\n- register(&self, addr: Address) -> Result<bool, &\'static str>\n- get_selected_notaries(&self, shard_id: usize) -> Vec<Address>}"][shape="record"];
ndMode -> ndConfig[label=""][style="dashed"][arrowhead="diamond"];
ndCollation -> ndNotary[label=""][style="dashed"][arrowhead="vee"];
ndNotary[label="{<<<Structure>>>\nNotary|- selected: bool\n- shard_id: ethereum_types::U256\n- collation_vectors: HashMap<ethereum_types::U256, Vec<collation::Collation>>\n- listener: mpsc::Receiver<message::Message>|+ new(listener: mpsc::Receiver<message::Message>) -> Notary\n+ run(&mut self)\n- store_collation(&mut self, collation: collation::Collation)\n- store_proposal(&mut self, collation: collation::Collation)\n- get_availability(&mut self)\n- submit_vote(&self)}"][shape="record"];
ndMode[label="{<<<Enumeration>>>\nMode|Proposer\nNotary\nBoth|+ value(&self) -> String}"][shape="record"];
ndConfig[label="{<<<Structure>>>\nConfig|+ mode: Mode|+ new(mode: Mode) -> Config}"][shape="record"];
ndConfigType[label="{<<<Enumeration>>>\nConfigType|Mode\nNil}"][shape="record"];
ndHeader -> ndCollation[label=""][style="dashed"][arrowhead="vee"];
ndCollation -> ndNotary[label=""][style="dashed"][arrowhead="vee"];
ndMode -> ndConfig[label=""][style="dashed"][arrowhead="diamond"];
}
6 changes: 4 additions & 2 deletions src/main.rs → src/bin/bin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
extern crate diamond_drops;

use diamond_drops::cli;
use diamond_drops::run;

use std::env;
use std::process;
Expand All @@ -12,5 +14,5 @@ fn main() {
process::exit(1);
});

diamond_drops::run(config);
}
run(config);
}
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,4 @@ pub fn run(config: cli::config::Config) -> () {
Err(e) => { panic!("Failed notary thread join {:?}", e); }
}
}
}


}
3 changes: 3 additions & 0 deletions src/notary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,19 @@ mod tests {
}

#[test]
#[ignore]
fn it_stores_proposals() {
assert!(false);
}

#[test]
#[ignore]
fn it_selects_vote() {
assert!(false);
}

#[test]
#[ignore]
fn it_submits_vote() {
assert!(false);
}
Expand Down
3 changes: 3 additions & 0 deletions src/smc_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mod tests {
use super::*;

#[test]
#[ignore]
fn it_registers() {
let (tx, rx) = mpsc::channel();
let smc = SMCListener::new(tx);
Expand All @@ -39,6 +40,7 @@ mod tests {
}

#[test]
#[ignore]
fn it_gets_selected_notaries() {
let (tx, rx) = mpsc::channel();
let smc = SMCListener::new(tx);
Expand All @@ -53,6 +55,7 @@ mod tests {
}

#[test]
#[ignore]
fn it_listens_for_smc_events() {
assert!(false);
}
Expand Down

0 comments on commit 606e1a7

Please sign in to comment.