For my code I need to define structure of vectors and here is how I define,
struct RedactDemo<'a, S: PrimeField>{
document: &'a [S],
redactor: &'a [S],
redacted: &'a [S],
}
Further
let document = (0..LEN).map(|_| None).collect::<Vec<_>>();
let redactor = (0..LEN).map(|_| None).collect::<Vec<_>>();
let redacted = (0..LEN).map(|_| None).collect::<Vec<_>>();
let mut params = {
let c = RedactDemo{
document: &document,
redactor: &redactor,
redacted: &redacted,
};
generate_random_parameters::<Bls12,_,_>(c,&mut OsRng).unwrap()
};
I am referring to the code in https://github.com/zkcrypto/bellman/blob/main/tests/common/mod.rs and https://github.com/zkcrypto/bellman/blob/main/tests/mimc.rs to build my code but it keeps giving error that Option does not have trait PrimeField
. I am sorry this might be really silly but I don't understand what other trait they are expecting us to use and why is it a problem to use PrimeField
, as I am directly taking the structure from the code.
Thanks!!