Overview
event.rs defines a fully-implemented Event struct (with new(), with_metadata(), to_json(), from_json()) and has its own passing unit tests — but lib.rs's module declarations (pub mod cache; pub mod config; pub mod hash_validator; pub mod metrics; pub mod rate_limit; pub mod stellar;) never include pub mod event;, so this file is not part of the compiled crate at all. It also references crate::error::Result and crate::error::AuditError, but no error.rs file exists anywhere in contract/src — so even if declared, it would not compile as-is.
Files
contract/src/lib.rs
contract/src/event.rs
contract/src/error.rs (new)
Acceptance Criteria
Overview
event.rsdefines a fully-implementedEventstruct (withnew(),with_metadata(),to_json(),from_json()) and has its own passing unit tests — butlib.rs's module declarations (pub mod cache; pub mod config; pub mod hash_validator; pub mod metrics; pub mod rate_limit; pub mod stellar;) never includepub mod event;, so this file is not part of the compiled crate at all. It also referencescrate::error::Resultandcrate::error::AuditError, but noerror.rsfile exists anywhere incontract/src— so even if declared, it would not compile as-is.Files
contract/src/lib.rscontract/src/event.rscontract/src/error.rs(new)Acceptance Criteria
contract/src/error.rsdefiningAuditError(at minimum aSerializationErrorvariant, matchingevent.rs's usage) and a crate-levelResult<T>aliaspub mod error;andpub mod event;tolib.rsEvent::new()into at least the verify/submit/revoke/transfer handlers to emit an audit event per request, persisted via the existingCacheBackend(or a dedicated append-only store)cargo buildandcargo testpass withevent.rsincluded in the compiled crateGET /auditendpoint to read back emitted events, or explicitly note it as a follow-up if out of scope for this issue