mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 17:30:17 +00:00
add initial bls support
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
use crate::config::EntryDeclaration;
|
||||
use crate::context::SproutContext;
|
||||
use crate::generators::bls::BlsConfiguration;
|
||||
use crate::generators::matrix::MatrixConfiguration;
|
||||
use anyhow::Result;
|
||||
use anyhow::bail;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::rc::Rc;
|
||||
|
||||
pub mod bls;
|
||||
pub mod matrix;
|
||||
|
||||
#[derive(Serialize, Deserialize, Default, Clone)]
|
||||
pub struct GeneratorDeclaration {
|
||||
#[serde(default)]
|
||||
pub matrix: Option<MatrixConfiguration>,
|
||||
#[serde(default)]
|
||||
pub bls: Option<BlsConfiguration>,
|
||||
}
|
||||
|
||||
pub fn generate(
|
||||
@@ -20,6 +24,8 @@ pub fn generate(
|
||||
) -> Result<Vec<(Rc<SproutContext>, EntryDeclaration)>> {
|
||||
if let Some(matrix) = &generator.matrix {
|
||||
matrix::generate(context, matrix)
|
||||
} else if let Some(bls) = &generator.bls {
|
||||
bls::generate(context, bls)
|
||||
} else {
|
||||
bail!("unknown generator configuration");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user