pub struct SigningAuthority {
pub delegator: [u8; 20],
pub delegate: [u8; 20],
pub valid_from: u64,
pub valid_until: u64,
pub signature: Vec<u8>,
}Expand description
Cold-key delegation authorizing a hot key to sign blocks for a time window.
The delegator is the long-lived authority key. The delegate is the hot key
used by runtime code to sign individual block headers. The signature is
stored next to the delegation fields but is excluded from delegation_hash().
Fields§
§delegator: [u8; 20]§delegate: [u8; 20]§valid_from: u64§valid_until: u64§signature: Vec<u8>Implementations§
Source§impl SigningAuthority
impl SigningAuthority
Sourcepub fn delegation_hash(&self) -> [u8; 32]
pub fn delegation_hash(&self) -> [u8; 32]
Compute the hash of the delegation fields. The signature is excluded.
Sourcepub fn is_valid_at(&self, timestamp_ms: u64) -> bool
pub fn is_valid_at(&self, timestamp_ms: u64) -> bool
Check if the delegation is valid at the given timestamp in ms.
Trait Implementations§
Source§impl Clone for SigningAuthority
impl Clone for SigningAuthority
Source§fn clone(&self) -> SigningAuthority
fn clone(&self) -> SigningAuthority
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SigningAuthority
impl Debug for SigningAuthority
Source§impl<'de> Deserialize<'de> for SigningAuthority
impl<'de> Deserialize<'de> for SigningAuthority
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SigningAuthority
impl PartialEq for SigningAuthority
Source§impl Serialize for SigningAuthority
impl Serialize for SigningAuthority
impl Eq for SigningAuthority
impl StructuralPartialEq for SigningAuthority
Auto Trait Implementations§
impl Freeze for SigningAuthority
impl RefUnwindSafe for SigningAuthority
impl Send for SigningAuthority
impl Sync for SigningAuthority
impl Unpin for SigningAuthority
impl UnsafeUnpin for SigningAuthority
impl UnwindSafe for SigningAuthority
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more