Add init function for BP statics

Considering they take 7 seconds to generate, thanks to #68, the ability 
to generate them at the start instead of on first BP is greatly 
appreciated.

Also performs minor cleanups regarding BPs.
This commit is contained in:
Luke Parker
2022-08-02 15:52:27 -04:00
parent 9221dbf048
commit a30568ff57
9 changed files with 68 additions and 24 deletions

View File

@@ -57,7 +57,12 @@ fn bulletproofs_vector() {
}
macro_rules! bulletproofs_tests {
($name: ident, $max: ident, $plus: literal) => {
($init: ident, $name: ident, $max: ident, $plus: literal) => {
#[test]
fn $init() {
Bulletproofs::init($plus);
}
#[test]
fn $name() {
// Create Bulletproofs for all possible output quantities
@@ -86,5 +91,5 @@ macro_rules! bulletproofs_tests {
};
}
bulletproofs_tests!(bulletproofs, bulletproofs_max, false);
bulletproofs_tests!(bulletproofs_plus, bulletproofs_plus_max, true);
bulletproofs_tests!(bulletproofs_init, bulletproofs, bulletproofs_max, false);
bulletproofs_tests!(bulletproofs_plus_init, bulletproofs_plus, bulletproofs_plus_max, true);