Selaa lähdekoodia

oram: add error type

Lennart Braun 2 vuotta sitten
vanhempi
commit
f47d95acc5
2 muutettua tiedostoa jossa 13 lisäystä ja 0 poistoa
  1. 1 0
      oram/Cargo.toml
  2. 12 0
      oram/src/common.rs

+ 1 - 0
oram/Cargo.toml

@@ -6,6 +6,7 @@ edition = "2021"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
+communicator = { path = "../communicator" }
 utils = { path = "../utils" }
 bitvec = "1.0.1"
 ff = "0.13.0"

+ 12 - 0
oram/src/common.rs

@@ -1,3 +1,4 @@
+use communicator::Error as CommunicationError;
 use ff::PrimeField;
 
 pub enum Operation {
@@ -28,3 +29,14 @@ pub struct InstructionShare<F: PrimeField> {
     address_share: F,
     value: F,
 }
+
+#[derive(Debug)]
+pub enum Error {
+    CommunicationError(CommunicationError),
+}
+
+impl From<CommunicationError> for Error {
+    fn from(e: CommunicationError) -> Self {
+        Error::CommunicationError(e)
+    }
+}