hc_deepkey_types/
authorized_spec_change.rs

1use crate::AuthoritySpec;
2use hdi::prelude::*;
3
4pub type Authorization = (u8, Signature);
5
6#[hdk_entry_helper]
7#[derive(Clone)]
8pub struct AuthorizedSpecChange {
9    pub new_spec: AuthoritySpec,
10    // Signature of the content of the authority_spec field,
11    // signed by throwaway RootKey on Create,
12    // or according to previous AuthSpec upon Update.
13    pub authorization_of_new_spec: Vec<Authorization>,
14}
15
16impl AuthorizedSpecChange {
17    pub fn new(new_spec: AuthoritySpec, authorization_of_new_spec: Vec<Authorization>) -> Self {
18        Self {
19            new_spec,
20            authorization_of_new_spec,
21        }
22    }
23    pub fn as_new_spec_ref(&self) -> &AuthoritySpec {
24        &self.new_spec
25    }
26    pub fn as_authorization_of_new_spec_ref(&self) -> &Vec<Authorization> {
27        &self.authorization_of_new_spec
28    }
29}