Skip to content
Snippets Groups Projects
Commit 1bf37153 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

wip mini clean

parent 8a8504bb
No related branches found
No related tags found
1 merge request!162WIP: Resolve "WS2Pv2: sync"
...@@ -1214,6 +1214,7 @@ dependencies = [ ...@@ -1214,6 +1214,7 @@ dependencies = [
"serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
"structopt 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ws 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "ws 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
...@@ -1222,7 +1223,6 @@ name = "durs-ws2p-messages" ...@@ -1222,7 +1223,6 @@ name = "durs-ws2p-messages"
version = "0.3.0-dev" version = "0.3.0-dev"
dependencies = [ dependencies = [
"bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"dubp-block-doc 0.1.0", "dubp-block-doc 0.1.0",
"dubp-common-doc 0.1.0", "dubp-common-doc 0.1.0",
"dubp-currency-params 0.2.0", "dubp-currency-params 0.2.0",
...@@ -1235,7 +1235,6 @@ dependencies = [ ...@@ -1235,7 +1235,6 @@ dependencies = [
"pkstl 0.1.0", "pkstl 0.1.0",
"pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
...@@ -1261,6 +1260,7 @@ dependencies = [ ...@@ -1261,6 +1260,7 @@ dependencies = [
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pkstl 0.1.0", "pkstl 0.1.0",
"pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
"unwrap 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "unwrap 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
...@@ -2245,7 +2245,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -2245,7 +2245,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
......
...@@ -106,6 +106,7 @@ pub enum WsError { ...@@ -106,6 +106,7 @@ pub enum WsError {
/// the websocket trait is an abstraction allowing to move the logic of websocket handling /// the websocket trait is an abstraction allowing to move the logic of websocket handling
/// in the protocol crate /// in the protocol crate
/// it has a listen and exec function (not sure if it should have a connect function)
pub trait WebsocketTrait: Debug + Clone + Send { pub trait WebsocketTrait: Debug + Clone + Send {
/// constructor /// constructor
fn new( fn new(
...@@ -129,16 +130,3 @@ pub trait WebsocketTrait: Debug + Clone + Send { ...@@ -129,16 +130,3 @@ pub trait WebsocketTrait: Debug + Clone + Send {
/// Execute websocket action without precising success or failure states /// Execute websocket action without precising success or failure states
fn exec(&self, action: WebsocketAction) -> Result<(), WsError>; fn exec(&self, action: WebsocketAction) -> Result<(), WsError>;
} }
// je n'ai pas bien compris la différence entre WebsocketAction et WebsocketActionOrder
// donc j'ai fait deux fonctions exec de manière temporaire pour transformer l'un en l'autre
// fn exec_action(&self, action: WebsocketAction) -> Result<(), WsError> {
// /// transform Action into ActionOrder
// let action_order = WebsocketActionOrder {
// ws_action: action,
// new_state_if_success: None,
// new_state_if_fail: WS2PConnectionState::Close,
// };
// self.exec(action_order)
// }
...@@ -33,6 +33,9 @@ use std::net::ToSocketAddrs; ...@@ -33,6 +33,9 @@ use std::net::ToSocketAddrs;
use std::sync::mpsc; use std::sync::mpsc;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
/// the WebsocketConnector is just a small structure containing minimal information
/// that will implement the WebsocketTrait
/// it will allow the ws2p-protocol crate to manage websocket-specific actions like opening connection...
pub struct WebsocketConnector { pub struct WebsocketConnector {
my_self_ws2p_node: MySelfWs2pNode, my_self_ws2p_node: MySelfWs2pNode,
orchestrator_sender: mpsc::Sender<OrchestratorMsg<DursMsg>>, orchestrator_sender: mpsc::Sender<OrchestratorMsg<DursMsg>>,
......
...@@ -78,7 +78,7 @@ fn keypair2() -> ed25519::Ed25519KeyPair { ...@@ -78,7 +78,7 @@ fn keypair2() -> ed25519::Ed25519KeyPair {
} }
// generate the blockchain data in the temporary directory // generate the blockchain data in the temporary directory
// FIXME now it's juste copying existing data // FIXME (now it's just copying existing data)
fn generate_blockchain_data(tmp_profile_path: &PathBuf, source_path: &str) { fn generate_blockchain_data(tmp_profile_path: &PathBuf, source_path: &str) {
let source_path = PathBuf::from(source_path.clone()); let source_path = PathBuf::from(source_path.clone());
let data_dir: PathBuf = [tmp_profile_path.clone(), PathBuf::from("datas")] let data_dir: PathBuf = [tmp_profile_path.clone(), PathBuf::from("datas")]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment