Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Commit

Permalink
MAINT: Removed manual Serialize/Deserialize implementaion from `enigm…
Browse files Browse the repository at this point in the history
…a-tools-m`
  • Loading branch information
elichai committed May 22, 2019
1 parent a5e609e commit 55fa44a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 231 deletions.
4 changes: 2 additions & 2 deletions enigma-tools-m/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rustc-hex = { version = "2.0.1", default-features = false }
ethabi_std = { package = "ethabi", version = "6.0.1", optional = true }
ethereum_types_std = { package = "ethereum-types", version = "0.4", optional = true }
rmp_serde_std = { package = "rmp-serde", git = "https://github.com/3Hren/msgpack-rust.git", optional = true }
serde_std = { package = "serde", version = "1.0", default-features = false, optional = true }
serde_std = { package = "serde", version = "1.0", default-features = false, features = ["derive"], optional = true }
serde_json_std = { package = "serde_json", version = "1.0", optional = true }


Expand All @@ -28,7 +28,7 @@ ethabi_sgx = { package = "ethabi", git = "https://github.com/enigmampc/ethabi.gi
ethereum_types_sgx = { package = "ethereum-types", git = "https://github.com/enigmampc/primitives.git", rev = "sgx-v0.4.0", default-features = false, optional = true }
rmp_serde_sgx = { package = "rmp-serde", git = "https://github.com/enigmampc/msgpack-rust.git", rev = "0.14.0-sgx-1.0.8", optional = true }
sgx_tstd = { git = "https://github.com/baidu/rust-sgx-sdk.git", rev = "v1.0.8", optional = true }
serde_sgx = { package = "serde", git = "https://github.com/mesalock-linux/serde-sgx.git", rev = "407aaaa2558dda5c2367d57ba40324c52cf9acc2", default-features = false, optional = true }
serde_sgx = { package = "serde", git = "https://github.com/mesalock-linux/serde-sgx.git", rev = "407aaaa2558dda5c2367d57ba40324c52cf9acc2", default-features = false, features = ["derive"], optional = true }
serde_json_sgx = { package = "serde_json", git = "https://github.com/enigmampc/serde-json-sgx.git", rev = "1.0.39-sgx-1.0.8", optional = true }

[features]
Expand Down
9 changes: 6 additions & 3 deletions enigma-tools-m/src/primitives/km_primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ use enigma_types::{ContractAddress, DhKey, PubKey, StateKey};

pub type MsgID = [u8; 12];

#[derive(Debug, PartialEq, Clone)]
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[serde(crate = "crate::serde")]
pub enum PrincipalMessageType {
Response(Vec<(ContractAddress, StateKey)>),
Request(Option<Vec<ContractAddress>>),
EncryptedResponse(Vec<u8>),
}

#[derive(Debug, PartialEq, Clone)]
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[serde(crate = "crate::serde")]
pub struct PrincipalMessage {
pub data: PrincipalMessageType,
pub(crate) pubkey: Vec<u8>,
Expand Down Expand Up @@ -131,7 +133,8 @@ impl<'a> Encryption<&'a DhKey, CryptoError, Self, [u8; 12]> for PrincipalMessage
}
}

#[derive(Debug, PartialEq, Clone)]
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[serde(crate = "crate::serde")]
pub struct UserMessage {
pub(crate) pubkey: Vec<u8>,
}
Expand Down
3 changes: 1 addition & 2 deletions enigma-tools-m/src/primitives/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pub mod km_primitives;
pub mod serde_impls;
pub mod km_primitives;
224 changes: 0 additions & 224 deletions enigma-tools-m/src/primitives/serde_impls.rs

This file was deleted.

0 comments on commit 55fa44a

Please sign in to comment.