casper_client/types/
proof.rs

1use serde::{Deserialize, Serialize};
2
3use casper_types::crypto::{PublicKey, Signature};
4
5#[cfg(doc)]
6use crate::types::Block;
7
8/// A pair of public key and signature, representing proof of having signed a given piece of data,
9/// generally a [`Block`].
10#[derive(Clone, PartialOrd, Ord, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)]
11#[serde(deny_unknown_fields)]
12pub struct Proof {
13    public_key: PublicKey,
14    signature: Signature,
15}
16
17impl Proof {
18    /// Returns the public key.
19    pub fn public_key(&self) -> &PublicKey {
20        &self.public_key
21    }
22
23    /// Returns the signature.
24    pub fn signature(&self) -> &Signature {
25        &self.signature
26    }
27}