Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
- Update `phoenix-core` `0.20.0-rc.0` -> `0.21`
- Update `dusk-pki` `0.12` -> `0.13`
- Update `dusk-schnorr` `0.13` -> `0.14`
- Update `dusk-poseidon` `0.30` -> `0.31`
- Update `dusk-plonk` `0.14` -> `0.16`
- Update `dusk-bls12_381-sign` `0.4` -> `0.5`
- Update `dusk-jubjub` `0.12` -> `0.13`
- Update `poseidon-merkle` `0.2.1-rc.0` -> `0.3`
- Update `rusk-abi` `0.10.0-piecrust.0.6` -> `0.11`
- Add `ff` dependency at `0.13`
  • Loading branch information
moCello committed Oct 14, 2023
1 parent 3c02311 commit a5f444b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 19 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `asyncify`ing FFI imports
- Add `unstake` function to allow unstaking a previously staked amount [#58]
- Add `fetch_existing_nullifiers` to the `StateClient` [#41]
- Add `ff` dependency at `0.13`

### Changed

Expand Down Expand Up @@ -49,6 +50,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update `dusk-poseidon` `0.29.1-rc.0` -> `0.30`
- Update `dusk-plonk` `0.13` -> `0.14`
- Change `dusk-merkle` dependency to `poseidon-merkle` after merkle crate separation
- Update `phoenix-core` `0.20.0-rc.0` -> `0.21`
- Update `dusk-pki` `0.12` -> `0.13`
- Update `dusk-schnorr` `0.13` -> `0.14`
- Update `dusk-poseidon` `0.30` -> `0.31`
- Update `dusk-plonk` `0.14` -> `0.16`
- Update `dusk-bls12_381-sign` `0.4` -> `0.5`
- Update `dusk-jubjub` `0.12` -> `0.13`
- Update `poseidon-merkle` `0.2.1-rc.0` -> `0.3`
- Update `rusk-abi` `0.10.0-piecrust.0.6` -> `0.11`

### Fixed

Expand Down
19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ license = "MPL-2.0"
rand_core = "^0.6"
rand_chacha = { version = "^0.3", default-features = false }
sha2 = { version = "^0.10", default-features = false }
phoenix-core = { version = "0.20.0-rc.0", default-features = false, features = ["alloc", "rkyv-impl"] }
dusk-pki = { version = "0.12", default-features = false }
phoenix-core = { version = "0.21", default-features = false, features = ["alloc", "rkyv-impl"] }
dusk-pki = { version = "0.13", default-features = false }
dusk-bytes = "^0.1"
dusk-schnorr = { version = "0.13", default-features = false }
dusk-jubjub = { version = "0.12", default-features = false }
dusk-poseidon = { version = "0.30", default-features = false }
poseidon-merkle = { version = "0.2.1-rc.0", features = ["rkyv-impl"] }
dusk-plonk = { version = "0.14", default-features = false }
rusk-abi = { version = "0.10.0-piecrust.0.6", default-features = false }
dusk-bls12_381-sign = { version = "0.4", default-features = false }
dusk-schnorr = { version = "0.14", default-features = false }
dusk-jubjub = { version = "0.13", default-features = false }
dusk-poseidon = { version = "0.31", default-features = false }
poseidon-merkle = { version = "0.3", features = ["rkyv-impl"] }
dusk-plonk = { version = "0.16", default-features = false }
rusk-abi = { version = "0.11", default-features = false }
dusk-bls12_381-sign = { version = "0.5", default-features = false }
rkyv = { version = "0.7", default-features = false }
ff = { version = "0.13", default-features = false }

[dev-dependencies]
rand = "^0.8"
Expand Down
19 changes: 14 additions & 5 deletions src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,20 @@ impl StateClient for FfiStateClient {
return Err(r);
}
}
let scalar = BlsScalar::from_bytes(&scalar_buf).map_err(
Error::<FfiStore, FfiStateClient, FfiProverClient>::from,
)?;

Ok(scalar)
// let scalar = match BlsScalar::from_bytes(&scalar_buf).into() {
// Some(s) => s,
// None => {
// return Err(
// Error::<FfiStore, FfiStateClient,
// FfiProverClient>::into(), )
// }
// };
//
// Ok(scalar)

let scalar: Option<BlsScalar> =
BlsScalar::from_bytes(&scalar_buf).into();
scalar.ok_or(Error::<FfiStore, FfiStateClient, FfiProverClient>::from)

Check failure on line 421 in src/ffi.rs

View workflow job for this annotation

GitHub Actions / Build WASM (nightly, wasm32-unknown-unknown)

mismatched types
}

fn fetch_existing_nullifiers(
Expand Down
5 changes: 3 additions & 2 deletions src/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use dusk_pki::{
StealthAddress,
};
use dusk_schnorr::Signature as SchnorrSignature;
use ff::Field;
use phoenix_core::transaction::*;
use phoenix_core::{Error as PhoenixError, Fee, Note, NoteType};
use rand_core::{CryptoRng, Error as RngError, RngCore};
Expand Down Expand Up @@ -301,7 +302,7 @@ where

let mut outputs = vec![];
if change > 0 {
let nonce = BlsScalar::random(rng);
let nonce = BlsScalar::random(&mut *rng);
let (change_note, change_blinder) =
generate_obfuscated_note(rng, refund, change, nonce);

Expand Down Expand Up @@ -649,7 +650,7 @@ where

let withdraw_r = JubJubScalar::random(rng);
let address = sender_psk.gen_stealth_address(&withdraw_r);
let nonce = BlsScalar::random(rng);
let nonce = BlsScalar::random(&mut *rng);

let signature = withdraw_sign(&sk, &pk, stake.counter, address, nonce);

Expand Down
7 changes: 4 additions & 3 deletions tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use dusk_wallet_core::{
EnrichedNote, ProverClient, StakeInfo, StateClient, Store, Transaction,
UnprovenTransaction, Wallet, POSEIDON_TREE_DEPTH,
};
use ff::Field;
use phoenix_core::{Crossover, Fee, Note, NoteType};
use poseidon_merkle::{Item, Opening as PoseidonOpening, Tree};
use rand_core::{CryptoRng, RngCore};
Expand Down Expand Up @@ -45,7 +46,7 @@ pub fn mock_wallet<Rng: RngCore + CryptoRng>(
let psk = store.retrieve_ssk(0).unwrap().public_spend_key();

let notes = new_notes(rng, &psk, note_values);
let anchor = BlsScalar::random(rng);
let anchor = BlsScalar::random(&mut *rng);
let opening = default_opening();

let state = TestStateClient::new(notes, anchor, opening);
Expand All @@ -64,7 +65,7 @@ pub fn mock_canon_wallet<Rng: RngCore + CryptoRng>(
let psk = store.retrieve_ssk(0).unwrap().public_spend_key();

let notes = new_notes(rng, &psk, note_values);
let anchor = BlsScalar::random(rng);
let anchor = BlsScalar::random(&mut *rng);
let opening = default_opening();

let state = TestStateClient::new(notes, anchor, opening);
Expand All @@ -85,7 +86,7 @@ pub fn mock_serde_wallet<Rng: RngCore + CryptoRng>(
let psk = store.retrieve_ssk(0).unwrap().public_spend_key();

let notes = new_notes(rng, &psk, note_values);
let anchor = BlsScalar::random(rng);
let anchor = BlsScalar::random(&mut *rng);
let opening = default_opening();

let state = TestStateClient::new(notes, anchor, opening);
Expand Down
1 change: 1 addition & 0 deletions tests/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod mock;
use dusk_bytes::Serializable;
use dusk_plonk::prelude::BlsScalar;
use dusk_wallet_core::StakeInfo;
use ff::Field;
use mock::{mock_canon_wallet, mock_serde_wallet, mock_wallet};

#[test]
Expand Down

0 comments on commit a5f444b

Please sign in to comment.