2017-11-22 20:57:00 -08:00
|
|
|
#[cfg(test)]
|
|
|
|
pub mod test;
|
|
|
|
|
|
|
|
pub mod boolean;
|
2018-03-15 11:31:10 -07:00
|
|
|
pub mod multieq;
|
2017-11-22 20:57:00 -08:00
|
|
|
pub mod uint32;
|
|
|
|
pub mod blake2s;
|
2017-12-14 14:41:37 -08:00
|
|
|
pub mod num;
|
2018-02-02 08:50:59 -08:00
|
|
|
pub mod lookup;
|
2018-02-20 17:18:29 -08:00
|
|
|
pub mod ecc;
|
2017-12-28 10:06:05 -08:00
|
|
|
pub mod pedersen_hash;
|
2018-03-15 11:36:05 -07:00
|
|
|
pub mod multipack;
|
2018-03-15 12:08:12 -07:00
|
|
|
pub mod sha256;
|
2017-11-22 20:57:00 -08:00
|
|
|
|
2018-03-15 11:44:19 -07:00
|
|
|
pub mod sapling;
|
2018-03-15 12:10:29 -07:00
|
|
|
pub mod sprout;
|
2018-02-22 10:36:44 -08:00
|
|
|
|
|
|
|
use bellman::{
|
2018-03-15 11:44:19 -07:00
|
|
|
SynthesisError
|
2018-03-08 00:16:21 -08:00
|
|
|
};
|
|
|
|
|
2018-03-07 23:41:47 -08:00
|
|
|
// TODO: This should probably be removed and we
|
|
|
|
// should use existing helper methods on `Option`
|
|
|
|
// for mapping with an error.
|
|
|
|
/// This basically is just an extension to `Option`
|
|
|
|
/// which allows for a convenient mapping to an
|
|
|
|
/// error on `None`.
|
2017-11-22 20:57:00 -08:00
|
|
|
trait Assignment<T> {
|
|
|
|
fn get(&self) -> Result<&T, SynthesisError>;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Assignment<T> for Option<T> {
|
|
|
|
fn get(&self) -> Result<&T, SynthesisError> {
|
|
|
|
match *self {
|
|
|
|
Some(ref v) => Ok(v),
|
|
|
|
None => Err(SynthesisError::AssignmentMissing)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|