Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve build warnings #260

Merged
merged 2 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.72.0
1.77.0
3 changes: 2 additions & 1 deletion taiga_halo2/src/circuit/vp_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::{
proof::Proof,
resource::{RandomSeed, Resource, ResourceCommitment},
resource_encryption::{ResourceCiphertext, SecretKey},
utils::{mod_r_p, read_base_field},
utils::mod_r_p,
vp_vk::ValidityPredicateVerifyingKey,
};
use dyn_clone::{clone_trait_object, DynClone};
Expand Down Expand Up @@ -206,6 +206,7 @@ impl BorshDeserialize for VPVerifyingInfo {
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
// Read vk
use crate::circuit::vp_examples::TrivialValidityPredicateCircuit;
use crate::utils::read_base_field;
let params = SETUP_PARAMS_MAP.get(&VP_CIRCUIT_PARAMS_SIZE).unwrap();
let vk = VerifyingKey::read::<_, TrivialValidityPredicateCircuit>(reader, params)?;
// Read proof
Expand Down
3 changes: 1 addition & 2 deletions taiga_halo2/src/circuit/vp_examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::{
error::TransactionError,
proof::Proof,
resource::{RandomSeed, Resource},
utils::read_base_field,
vp_commitment::ValidityPredicateCommitment,
vp_vk::ValidityPredicateVerifyingKey,
};
Expand Down Expand Up @@ -134,7 +133,7 @@ impl BorshSerialize for TrivialValidityPredicateCircuit {
#[cfg(feature = "borsh")]
impl BorshDeserialize for TrivialValidityPredicateCircuit {
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
let owned_resource_id = read_base_field(reader)?;
let owned_resource_id = crate::utils::read_base_field(reader)?;
let input_resources: Vec<_> = (0..NUM_RESOURCE)
.map(|_| Resource::deserialize_reader(reader))
.collect::<Result<_, _>>()?;
Expand Down
6 changes: 3 additions & 3 deletions taiga_halo2/src/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::hash::{Hash, Hasher};

use crate::merkle_tree::LR::{L, R};
use crate::resource::ResourceCommitment;
use crate::utils::{poseidon_hash, read_base_field};
use crate::utils::poseidon_hash;
use crate::{constant::TAIGA_COMMITMENT_TREE_DEPTH, resource::Resource};
use ff::PrimeField;
use halo2_proofs::arithmetic::Field;
Expand Down Expand Up @@ -68,7 +68,7 @@ impl BorshSerialize for Anchor {
#[cfg(feature = "borsh")]
impl BorshDeserialize for Anchor {
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
let value = read_base_field(reader)?;
let value = crate::utils::read_base_field(reader)?;
Ok(Self(value))
}
}
Expand Down Expand Up @@ -204,7 +204,7 @@ impl BorshSerialize for Node {
#[cfg(feature = "borsh")]
impl BorshDeserialize for Node {
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
let value = read_base_field(reader)?;
let value = crate::utils::read_base_field(reader)?;
Ok(Self(value))
}
}
Expand Down
4 changes: 2 additions & 2 deletions taiga_halo2/src/nullifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::hash::Hash;

use crate::{
resource::ResourceCommitment,
utils::{poseidon_hash_n, prf_nf, read_base_field},
utils::{poseidon_hash_n, prf_nf},
};
use halo2_proofs::arithmetic::Field;
use pasta_curves::group::ff::PrimeField;
Expand Down Expand Up @@ -91,7 +91,7 @@ impl BorshSerialize for Nullifier {
#[cfg(feature = "borsh")]
impl BorshDeserialize for Nullifier {
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
let value = read_base_field(reader)?;
let value = crate::utils::read_base_field(reader)?;
Ok(Self(value))
}
}
Expand Down
5 changes: 3 additions & 2 deletions taiga_halo2/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
merkle_tree::{Anchor, MerklePath, Node},
nullifier::{Nullifier, NullifierKeyContainer},
shielded_ptx::ResourceVPVerifyingInfoSet,
utils::{poseidon_hash_n, poseidon_to_curve, read_base_field},
utils::{poseidon_hash_n, poseidon_to_curve},
};
use blake2b_simd::Params as Blake2bParams;
use ff::{FromUniformBytes, PrimeField};
Expand Down Expand Up @@ -67,7 +67,7 @@ impl BorshSerialize for ResourceCommitment {
#[cfg(feature = "borsh")]
impl BorshDeserialize for ResourceCommitment {
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
let value = read_base_field(reader)?;
let value = crate::utils::read_base_field(reader)?;
Ok(Self(value))
}
}
Expand Down Expand Up @@ -329,6 +329,7 @@ impl BorshSerialize for Resource {
#[cfg(feature = "borsh")]
impl BorshDeserialize for Resource {
fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
use crate::utils::read_base_field;
use byteorder::{LittleEndian, ReadBytesExt};
use std::io;
// Read logic
Expand Down
3 changes: 1 addition & 2 deletions taiga_halo2/src/shielded_ptx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::merkle_tree::Anchor;
use crate::nullifier::Nullifier;
use crate::proof::Proof;
use crate::resource::{ResourceCommitment, ResourceValidityPredicates};
use crate::utils::read_scalar_field;
use halo2_proofs::plonk::Error;
use pasta_curves::pallas;
use rand::RngCore;
Expand Down Expand Up @@ -354,7 +353,7 @@ impl BorshDeserialize for ShieldedPartialTransaction {
let binding_sig_r = if binding_sig_r_type == 0 {
None
} else {
let r = read_scalar_field(reader)?;
let r = crate::utils::read_scalar_field(reader)?;
Some(r)
};

Expand Down
Loading