From aaaddbe47fc839c1e51bc9894b729ce9a7d56d90 Mon Sep 17 00:00:00 2001 From: 223880 Date: Mon, 4 Nov 2024 07:05:38 -0300 Subject: [PATCH] Add test to NIP-88 --- src/lending/nip_88.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lending/nip_88.rs b/src/lending/nip_88.rs index 4767b80..9aafd1e 100644 --- a/src/lending/nip_88.rs +++ b/src/lending/nip_88.rs @@ -120,4 +120,21 @@ pub (crate) fn Eventkind_90(event: Event) -> Event { Event::Oracle(oracle) => Event::Oracle(oracle), _ => Event::Nip(Nip::new(PubKey::from(""))), } +} + +#[cfg(test)] +mod tests { + use super::*; + use nostr::Event; + use nostr::Relay; + + pub (crate) fn test_nip88() { + let nip = Nip::new(PubKey::from_str("pubkey").unwrap()); + let event = Event::from(nip); + let relay = Relay::new("wss://relay.damus.io"); + let Eventkid_88 = nip.sign(&event); + let Eventkind_89 = nip.sign(&event); + let Eventkind_90 = nip.sign(&event); + relay.publish(event); + } } \ No newline at end of file