Kaynağa Gözat

Revert "sdk: Copy float10 ops from the main lib."

This reverts commit f48a8f29da942d63ffaa7b87b09e115cdba5eaff.
aggstam 3 yıl önce
ebeveyn
işleme
23f998c94e
4 değiştirilmiş dosya ile 0 ekleme ve 98 silme
  1. 0 1
      Cargo.lock
  2. 0 3
      src/sdk/Cargo.toml
  3. 0 92
      src/sdk/src/float10.rs
  4. 0 2
      src/sdk/src/lib.rs

+ 0 - 1
Cargo.lock

@@ -1318,7 +1318,6 @@ dependencies = [
  "bs58",
  "chacha20poly1305",
  "darkfi-serial",
- "dashu",
  "halo2_gadgets",
  "halo2_proofs",
  "incrementalmerkletree",

+ 0 - 3
src/sdk/Cargo.toml

@@ -21,9 +21,6 @@ darkfi-serial = {version = "0.4.1", path = "../serial", features = ["derive", "c
 # Encoding
 bs58 = "0.4.0"
 
-# Big float high precision arithmetics
-dashu = {version = "0.3.1", optional = true}
-
 # Cryptography
 blake2b_simd = "1.0.1"
 blake3 = "1.3.3"

+ 0 - 92
src/sdk/src/float10.rs

@@ -1,92 +0,0 @@
-/* This file is part of DarkFi (https://dark.fi)
- *
- * Copyright (C) 2020-2023 Dyne.org foundation
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- */
-
-//! Type aliases used in the consensus codebase.
-use core::ops::{Add, AddAssign, Div, Mul, Sub};
-
-use dashu::{
-    base::Abs,
-    float::{round::mode::Zero, FBig, Repr},
-};
-
-const B: u64 = 10;
-
-#[derive(Clone, PartialEq, PartialOrd, Debug)]
-pub struct Float10(FBig<Zero, B>);
-
-impl Float10 {
-    pub fn repr(&self) -> &Repr<B> {
-        self.0.repr()
-    }
-
-    pub fn abs(&self) -> Self {
-        Self(self.0.clone().abs())
-    }
-
-    pub fn powf(&self, exp: Self) -> Self {
-        Self(self.0.powf(&exp.0))
-    }
-
-    pub fn ln(&self) -> Self {
-        Self(self.0.ln())
-    }
-}
-
-impl Add for Float10 {
-    type Output = Self;
-
-    fn add(self, other: Self) -> Self {
-        Self(self.0 + other.0)
-    }
-}
-
-impl AddAssign for Float10 {
-    fn add_assign(&mut self, other: Self) {
-        *self = Self(self.0.clone() + other.0);
-    }
-}
-
-impl Sub for Float10 {
-    type Output = Self;
-
-    fn sub(self, other: Self) -> Self {
-        Self(self.0 - other.0)
-    }
-}
-
-impl Mul for Float10 {
-    type Output = Self;
-
-    fn mul(self, other: Self) -> Self {
-        Self(self.0 * other.0)
-    }
-}
-
-impl Div for Float10 {
-    type Output = Self;
-
-    fn div(self, other: Self) -> Self {
-        Self(self.0 / other.0)
-    }
-}
-
-impl std::fmt::Display for Float10 {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
-        write!(f, "{}", self.0)
-    }
-}

+ 0 - 2
src/sdk/src/lib.rs

@@ -46,5 +46,3 @@ pub use tx::ContractCall;
 
 /// Utility functions
 pub mod util;
-
-pub mod float10;