diff --git a/assets/dusk_wallet_core.wasm b/assets/dusk_wallet_core.wasm index 77bdc24..187253c 100755 Binary files a/assets/dusk_wallet_core.wasm and b/assets/dusk_wallet_core.wasm differ diff --git a/build.rs b/build.rs index 6651056..aa51b68 100644 --- a/build.rs +++ b/build.rs @@ -10,7 +10,7 @@ use std::{env, fs}; fn main() { if env::var("GITHUB_ACTIONS").is_ok() { // CI doesn't build with schemafy deterministically - return (); + return; } println!("cargo:rerun-if-changed=assets/schema.json"); diff --git a/src/ffi.rs b/src/ffi.rs index 6fb57b6..2f8821a 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -17,7 +17,7 @@ use crate::{key, tx, types, utils, MAX_KEY, MAX_LEN}; /// Allocates a buffer of `len` bytes on the WASM memory. #[no_mangle] -pub fn malloc(len: i32) -> i32 { +pub fn allocate(len: i32) -> i32 { let bytes = vec![0u8; len as usize]; let ptr = bytes.as_ptr(); mem::forget(bytes); @@ -68,6 +68,7 @@ pub fn seed(args: i32, len: i32) -> i64 { /// Will return a triplet (status, ptr, len) pointing to JSON string /// representing [types::BalanceResult]. #[no_mangle] +#[allow(clippy::needless_range_loop)] pub fn balance(args: i32, len: i32) -> i64 { let types::BalanceArgs { notes, seed } = match utils::take_args(args, len) { Some(a) => a, diff --git a/src/tx.rs b/src/tx.rs index 8c89930..008982f 100644 --- a/src/tx.rs +++ b/src/tx.rs @@ -138,6 +138,7 @@ impl UnprovenTransaction { /// /// The transaction can be sent to a prover service and it contains all the /// data required to generate a ZK proof of validity. + #[allow(clippy::too_many_arguments)] pub fn new<'a, Rng, I, O>( rng: &mut Rng, inputs: I, diff --git a/src/utils.rs b/src/utils.rs index fd08656..8614b81 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -146,6 +146,7 @@ pub fn bs58_to_psk(psk: &str) -> Option { /// /// Returns a tuple containing (unspent, inputs). `unspent` contains the notes /// that are not used. +#[allow(clippy::type_complexity)] pub fn knapsack( mut nodes: Vec<(Note, tx::Opening, u64, usize)>, target_sum: u64, @@ -227,13 +228,10 @@ fn knapsack_works() { let key = SecretSpendKey::random(rng); let blinder = JubJubScalar::random(rng); let note3 = Note::obfuscated(rng, &key.public_spend_key(), 300, blinder); - let available = vec![ - (note1.clone(), o, 100, 0), - (note2.clone(), o, 500, 1), - (note3.clone(), o, 300, 2), - ]; + let available = + vec![(note1, o, 100, 0), (note2, o, 500, 1), (note3, o, 300, 2)]; let unspent = vec![note1]; - let inputs = vec![(note2.clone(), o, 500, 1), (note3.clone(), o, 300, 2)]; + let inputs = vec![(note2, o, 500, 1), (note3, o, 300, 2)]; assert_eq!(knapsack(available, 600), Some((unspent, inputs))); // multiple inputs, out of balance check @@ -246,10 +244,7 @@ fn knapsack_works() { let key = SecretSpendKey::random(rng); let blinder = JubJubScalar::random(rng); let note3 = Note::obfuscated(rng, &key.public_spend_key(), 300, blinder); - let available = vec![ - (note1.clone(), o, 100, 0), - (note2.clone(), o, 500, 1), - (note3.clone(), o, 300, 2), - ]; + let available = + vec![(note1, o, 100, 0), (note2, o, 500, 1), (note3, o, 300, 2)]; assert_eq!(knapsack(available, 901), None); } diff --git a/tests/wallet.rs b/tests/wallet.rs index cdce6b9..fa1611a 100644 --- a/tests/wallet.rs +++ b/tests/wallet.rs @@ -400,7 +400,7 @@ impl Wallet { let ptr = self .instance .exports - .get_function("malloc") + .get_function("allocate") .unwrap() .call(&mut self.store, &[len.clone()]) .unwrap()[0]