123456789101112131415161718192021222324252627282930313233343536 |
- //! # Nostr Protocol Types
- //!
- //! The types needed to interact with a Nostr relayer, or to be become one.
- #![deny(missing_docs, warnings)]
- pub mod account;
- pub mod client;
- pub mod common;
- pub mod relayer;
- pub mod request;
- pub mod response;
- pub mod types;
- pub use self::{request::Request, response::Response};
- #[macro_use]
- extern crate custom_derive;
- #[macro_use]
- extern crate enum_derive;
- #[cfg(test)]
- mod regression {
- use crate::types::Event;
- #[test]
- fn event() {
- include_str!("../tests/regression_parsing.json")
- .lines()
- .for_each(|line| {
- let event: Event = serde_json::from_str(line).unwrap_or_else(|_| {
- panic!("Failed to parse: {}", line);
- });
- assert!(event.is_valid().is_ok(), "Failed to validate: {}", line);
- });
- }
- }
|