pub struct AuditEntry {
pub timestamp: i64,
pub event_type: AuditEventType,
pub pubkey: Option<String>,
pub key_type: Option<String>,
pub message_hash: Option<String>,
pub group_pubkey: Option<String>,
pub participants: Option<Vec<u16>>,
pub threshold: Option<u16>,
pub success: bool,
pub reason: Option<String>,
pub prev_hash: [u8; 32],
pub hash: [u8; 32],
}Expand description
A single audit log entry with hash chain linkage.
Fields§
§timestamp: i64Unix timestamp.
event_type: AuditEventTypeEvent type.
pubkey: Option<String>Public key involved.
key_type: Option<String>Key type (e.g. “nostr”).
message_hash: Option<String>Hash of the signed message.
group_pubkey: Option<String>FROST group public key.
participants: Option<Vec<u16>>FROST participant identifiers.
threshold: Option<u16>FROST threshold.
success: boolWhether the operation succeeded.
reason: Option<String>Failure reason.
prev_hash: [u8; 32]Previous entry hash.
hash: [u8; 32]This entry’s hash.
Implementations§
Source§impl AuditEntry
impl AuditEntry
Sourcepub fn new(event_type: AuditEventType, prev_hash: [u8; 32]) -> Self
pub fn new(event_type: AuditEventType, prev_hash: [u8; 32]) -> Self
Create a new entry with the given event type and previous hash.
Sourcepub fn with_pubkey(self, pubkey: &[u8; 32]) -> Self
pub fn with_pubkey(self, pubkey: &[u8; 32]) -> Self
Set the public key.
Sourcepub fn with_key_type(self, key_type: &str) -> Self
pub fn with_key_type(self, key_type: &str) -> Self
Set the key type.
Sourcepub fn with_message_hash(self, message: &[u8]) -> Self
pub fn with_message_hash(self, message: &[u8]) -> Self
Set the message hash.
Sourcepub fn with_group(self, group_pubkey: &[u8; 32]) -> Self
pub fn with_group(self, group_pubkey: &[u8; 32]) -> Self
Set the FROST group public key.
Sourcepub fn with_participants(self, participants: Vec<u16>) -> Self
pub fn with_participants(self, participants: Vec<u16>) -> Self
Set the FROST participant identifiers.
Sourcepub fn with_threshold(self, threshold: u16) -> Self
pub fn with_threshold(self, threshold: u16) -> Self
Set the FROST threshold.
Sourcepub fn with_success(self, success: bool) -> Self
pub fn with_success(self, success: bool) -> Self
Set whether the operation succeeded.
Sourcepub fn with_reason(self, reason: &str) -> Self
pub fn with_reason(self, reason: &str) -> Self
Set the failure reason.
Trait Implementations§
Source§impl Clone for AuditEntry
impl Clone for AuditEntry
Source§impl Debug for AuditEntry
impl Debug for AuditEntry
Source§impl<'de> Deserialize<'de> for AuditEntry
impl<'de> Deserialize<'de> for AuditEntry
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
Auto Trait Implementations§
impl Forget for AuditEntry
impl Freeze for AuditEntry
impl Move for AuditEntry
impl RefUnwindSafe for AuditEntry
impl Send for AuditEntry
impl Sync for AuditEntry
impl Unpin for AuditEntry
impl UnsafeUnpin for AuditEntry
impl UnwindSafe for AuditEntry
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