objects/object/
state_signature.rs1use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
8pub struct StateSignature {
9 pub algorithm: String,
11 pub public_key: String,
13 pub signature: String,
15}
16
17impl StateSignature {
18 pub fn algorithm(&self) -> &str {
20 &self.algorithm
21 }
22}
23
24#[derive(Clone, Copy, Debug, PartialEq, Eq)]
26pub enum SignatureStatus {
27 Valid,
29 Invalid,
31 Unsigned,
33}
34
35impl SignatureStatus {
36 pub fn is_valid(self) -> bool {
38 self == SignatureStatus::Valid
39 }
40
41 pub fn is_unsigned(self) -> bool {
43 self == SignatureStatus::Unsigned
44 }
45}