use crate::delegation::constraint::Constraint;
use crate::delegation::operation::Operation;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DelegationScope {
pub allowed_operations: Vec<Operation>,
pub constraints: Vec<Constraint>,
}
impl DelegationScope {
pub fn new() -> Self {
Self::default()
}
pub fn allow_operation(mut self, op: Operation) -> Self {
self.allowed_operations.push(op);
self
}
pub fn constrain(mut self, c: Constraint) -> Self {
self.constraints.push(c);
self
}
}