aggstam 2 gadi atpakaļ
vecāks
revīzija
61d262880d

+ 3 - 3
bin/faucetd/src/main.rs

@@ -184,7 +184,7 @@ pub struct Faucetd {
     validator_state: ValidatorStatePtr,
     keypair: Keypair,
     _wallet: WalletPtr,
-    merkle_tree: MerkleTree,
+    _merkle_tree: MerkleTree,
     airdrop_timeout: i64,
     airdrop_limit: u64,
     airdrop_map: AirdropMap,
@@ -217,7 +217,7 @@ impl Faucetd {
         limit: u64,
     ) -> Result<Self> {
         // Here we initialize the wallet for the money contract.
-        let merkle_tree = Self::initialize_wallet(wallet.clone()).await?;
+        let _merkle_tree = Self::initialize_wallet(wallet.clone()).await?;
 
         // This is kinda bad, but whatever. The hashmaps hold proving keys for
         // the money contract. We keep it under RwLock in case we want to add
@@ -276,7 +276,7 @@ impl Faucetd {
             validator_state,
             keypair,
             _wallet: wallet,
-            merkle_tree,
+            _merkle_tree,
             airdrop_timeout: timeout,
             airdrop_limit: limit,
             airdrop_map: Arc::new(Mutex::new(HashMap::new())),

+ 1 - 4
bin/tau/taud/src/main.rs

@@ -131,10 +131,7 @@ fn try_decrypt_task(encrypt_task: &EncryptedTask, chacha_box: &ChaChaBox) -> Tau
     }
 
     // Try extracting the nonce
-    let nonce = match bytes[0..24].try_into() {
-        Ok(v) => v,
-        Err(_) => return Err(TaudError::DecryptionError("Invalid nonce".to_string())),
-    };
+    let nonce = bytes[0..24].into();
 
     // Take the remaining ciphertext
     let message = &bytes[24..];

+ 2 - 2
src/consensus/types.rs

@@ -105,7 +105,7 @@ impl TryFrom<u64> for Float10 {
     type Error = crate::Error;
 
     fn try_from(value: u64) -> Result<Self, Self::Error> {
-        Ok(Self(FBig::try_from(value)?))
+        Ok(Self(FBig::from(value)))
     }
 }
 
@@ -113,6 +113,6 @@ impl TryFrom<i64> for Float10 {
     type Error = crate::Error;
 
     fn try_from(value: i64) -> Result<Self, Self::Error> {
-        Ok(Self(FBig::try_from(value)?))
+        Ok(Self(FBig::from(value)))
     }
 }

+ 1 - 1
src/consensus/utils.rs

@@ -23,7 +23,7 @@ use log::debug;
 use super::Float10;
 
 pub fn fbig2ibig(f: Float10) -> IBig {
-    let rad = IBig::try_from(10).unwrap();
+    let rad = IBig::from(10);
     let sig = f.repr().significand();
     let exp = f.repr().exponent();
 

+ 1 - 0
src/contract/money/src/client/transfer_v1/mod.rs

@@ -77,6 +77,7 @@ pub fn select_coins(coins: Vec<OwnCoin>, min_value: u64) -> Result<(Vec<OwnCoin>
 /// * The actual call data
 /// * Secret values such as blinds
 /// * A list of the spent coins
+#[allow(clippy::too_many_arguments)]
 pub fn make_transfer_call(
     keypair: Keypair,
     recipient: PublicKey,

+ 2 - 2
src/serial/src/types/bridgetree.rs

@@ -45,7 +45,7 @@ impl AsyncEncodable for bridgetree::Position {
 impl Decodable for bridgetree::Position {
     fn decode<D: Read>(mut d: D) -> Result<Self> {
         let dec: u64 = Decodable::decode(&mut d)?;
-        Ok(Self::try_from(dec).unwrap())
+        Ok(Self::from(dec))
     }
 }
 
@@ -54,7 +54,7 @@ impl Decodable for bridgetree::Position {
 impl AsyncDecodable for bridgetree::Position {
     async fn decode_async<D: AsyncRead + Unpin + Send>(d: &mut D) -> Result<Self> {
         let dec: u64 = AsyncDecodable::decode_async(d).await?;
-        Ok(Self::try_from(dec).unwrap())
+        Ok(Self::from(dec))
     }
 }
 

+ 3 - 3
src/validator/float_10.rs

@@ -112,7 +112,7 @@ impl TryFrom<u64> for Float10 {
     type Error = crate::Error;
 
     fn try_from(value: u64) -> Result<Self, Self::Error> {
-        Ok(Self(FBig::try_from(value)?))
+        Ok(Self(FBig::from(value)))
     }
 }
 
@@ -120,7 +120,7 @@ impl TryFrom<i64> for Float10 {
     type Error = crate::Error;
 
     fn try_from(value: i64) -> Result<Self, Self::Error> {
-        Ok(Self(FBig::try_from(value)?))
+        Ok(Self(FBig::from(value)))
     }
 }
 
@@ -148,7 +148,7 @@ lazy_static! {
 // Utility functions
 /// Convert a Float10 to [`dashu::integer::IBig`].
 pub fn fbig2ibig(f: Float10) -> IBig {
-    let rad = IBig::try_from(10).unwrap();
+    let rad = IBig::from(10);
     let sig = f.repr().significand();
     let exp = f.repr().exponent();