Fix tests compilation

This commit is contained in:
Luther Blissett
2022-10-15 20:08:04 +02:00
parent d718574bba
commit 2ca5866c43
15 changed files with 22 additions and 21 deletions

3
Cargo.lock generated
View File

@@ -1242,8 +1242,10 @@ dependencies = [
"bs58",
"darkfi-serial",
"halo2_gadgets",
"halo2_proofs",
"incrementalmerkletree",
"pasta_curves",
"rand",
"thiserror",
]
@@ -1482,6 +1484,7 @@ dependencies = [
"async-std",
"async-trait",
"darkfi",
"darkfi-serial",
"easy-parallel",
"log",
"num_cpus",

View File

@@ -470,10 +470,8 @@ impl Decodable for OpMethods {
#[cfg(test)]
mod tests {
use super::*;
use darkfi::{
serial::{deserialize, serialize},
util::gen_id,
};
use darkfi::util::gen_id;
use darkfi_serial::{deserialize, serialize};
#[test]
fn test_to_string() {

View File

@@ -6,6 +6,7 @@ description = "Demo chat to document darkfi net code"
[dependencies]
darkfi = {path = "../../", features = ["net", "rpc"]}
darkfi-serial = {path = "../../src/serial"}
# Async
async-std = "1.12.0"

View File

@@ -1,9 +1,7 @@
use async_std::sync::{Arc, Mutex};
use darkfi::{
net,
serial::{SerialDecodable, SerialEncodable},
};
use darkfi::net;
use darkfi_serial::{SerialDecodable, SerialEncodable};
pub type DchatMsgsBuffer = Arc<Mutex<Vec<DchatMsg>>>;

View File

@@ -101,10 +101,10 @@ mod tests {
DrkCoinBlind, DrkSerial, DrkSpendHook, DrkTokenId, DrkUserData, DrkValueBlind,
},
},
serial::{Decodable, Encodable},
zk::circuit::MintContract,
Result,
};
use darkfi_serial::{Decodable, Encodable};
use group::ff::Field;
use rand::rngs::OsRng;

View File

@@ -54,7 +54,7 @@ impl SchnorrPublic for PublicKey {
#[cfg(test)]
mod tests {
use super::*;
use crate::serial::{deserialize, serialize};
use darkfi_serial::{deserialize, serialize};
#[test]
fn test_schnorr() {

View File

@@ -239,7 +239,7 @@ impl Default for MessageSubsystem {
#[cfg(test)]
mod tests {
use super::*;
use crate::serial::{Decodable, Encodable};
use darkfi_serial::{Decodable, Encodable};
use std::io;
#[async_std::test]

View File

@@ -26,3 +26,7 @@ bs58 = "0.4.0"
pasta_curves = "0.4.0"
incrementalmerkletree = "0.3.0"
halo2_gadgets = "0.2.0"
[dev-dependencies]
halo2_proofs = "0.2.0"
rand = "0.8.5"

View File

@@ -2931,12 +2931,11 @@ mod tests {
super::{COMMIT_IVK_PERSONALIZATION, NUM_WINDOWS},
*,
};
use group::Curve;
use halo2_gadgets::{
ecc::chip::constants::{test_lagrange_coeffs, test_zs_and_us},
sinsemilla::primitives::CommitDomain,
};
use pasta_curves::{arithmetic::CurveAffine, pallas};
use pasta_curves::{arithmetic::CurveAffine, group::Curve, pallas};
#[test]
fn generator() {

View File

@@ -2936,8 +2936,7 @@ mod tests {
sinsemilla::primitives::CommitDomain,
};
use group::Curve;
use pasta_curves::{arithmetic::CurveAffine, pallas};
use pasta_curves::{arithmetic::CurveAffine, group::Curve, pallas};
#[test]
fn generator() {

View File

@@ -2930,9 +2930,8 @@ mod tests {
super::{NUM_WINDOWS, ORCHARD_PERSONALIZATION},
*,
};
use group::Curve;
use halo2_gadgets::ecc::chip::constants::{test_lagrange_coeffs, test_zs_and_us};
use pasta_curves::{arithmetic::CurveExt, pallas};
use pasta_curves::{arithmetic::CurveExt, group::Curve, pallas};
#[test]
fn generator() {

View File

@@ -2932,10 +2932,10 @@ mod tests {
super::{NUM_WINDOWS, ORCHARD_PERSONALIZATION},
*,
};
use group::Curve;
use halo2_gadgets::ecc::chip::constants::{test_lagrange_coeffs, test_zs_and_us};
use pasta_curves::{
arithmetic::{CurveAffine, CurveExt},
group::Curve,
pallas,
};

View File

@@ -2932,10 +2932,10 @@ mod tests {
super::{NUM_WINDOWS, VALUE_COMMITMENT_PERSONALIZATION},
*,
};
use group::Curve;
use halo2_gadgets::ecc::chip::constants::{test_lagrange_coeffs, test_zs_and_us};
use pasta_curves::{
arithmetic::{CurveAffine, CurveExt},
group::Curve,
pallas,
};

View File

@@ -785,10 +785,10 @@ mod tests {
super::{NUM_WINDOWS_SHORT, VALUE_COMMITMENT_PERSONALIZATION},
*,
};
use group::Curve;
use halo2_gadgets::ecc::chip::constants::{test_lagrange_coeffs, test_zs_and_us};
use pasta_curves::{
arithmetic::{CurveAffine, CurveExt},
group::Curve,
pallas,
};

View File

@@ -131,9 +131,9 @@ mod tests {
fixed_bases::{COMMIT_IVK_PERSONALIZATION, NOTE_COMMITMENT_PERSONALIZATION},
sinsemilla::MERKLE_CRH_PERSONALIZATION,
};
use group::{ff::PrimeField, Curve};
use halo2_gadgets::sinsemilla::primitives::{CommitDomain, HashDomain};
use halo2_proofs::{arithmetic::CurveAffine, pasta::pallas};
use pasta_curves::group::{ff::PrimeField, Curve};
use rand::{self, rngs::OsRng, Rng};
#[test]