mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 22:28:12 -05:00
22 lines
481 B
Rust
22 lines
481 B
Rust
use std::any::Any;
|
|
|
|
use pasta_curves::pallas;
|
|
|
|
pub struct State {
|
|
pub public_values: Vec<pallas::Base>,
|
|
}
|
|
|
|
impl State {
|
|
pub fn new() -> Box<dyn Any> {
|
|
Box::new(Self { public_values: Vec::new() })
|
|
}
|
|
|
|
pub fn add_public_value(&mut self, public_value: pallas::Base) {
|
|
self.public_values.push(public_value)
|
|
}
|
|
|
|
pub fn public_exists(&self, public_value: &pallas::Base) -> bool {
|
|
self.public_values.iter().any(|v| v == public_value)
|
|
}
|
|
}
|