commit f6d381330ac3c00ab42fd50a020b82f8891147d1
parent 461bcae68c5a8bc3239b3db0e1788ecbd3c0653c
Author: triesap <tyson@radroots.org>
Date: Tue, 28 Jul 2026 23:48:23 +0000
event: use identity-owned public keys
- add direct identity dependencies where SDK boundaries construct event references
- parse fixture authors into canonical PublicKey values at explicit test and smoke boundaries
- migrate knowledge examples and public API coverage to the typed event-reference author
- verify affected SDK packages, binding tests, architecture checks, and formatting
Diffstat:
6 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/crates/event_codec_wasm/Cargo.toml b/crates/event_codec_wasm/Cargo.toml
@@ -39,3 +39,6 @@ nostr = { workspace = true }
radroots_core = { workspace = true, default-features = false, features = [
"std",
] }
+radroots_identity = { workspace = true, default-features = false, features = [
+ "std",
+] }
diff --git a/crates/event_codec_wasm/src/lib.rs b/crates/event_codec_wasm/src/lib.rs
@@ -969,7 +969,8 @@ mod tests {
fn knowledge_event_ref(seed: char, kind: u32) -> radroots_event::RadrootsEventRef {
radroots_event::RadrootsEventRef {
id: synthetic_event_id(seed),
- author: synthetic_pubkey('a'),
+ author: radroots_identity::PublicKey::from_hex(&synthetic_pubkey('a'))
+ .expect("fixture public key"),
kind,
d_tag: None,
relays: Some(vec!["wss://relay.example.test".to_string()]),
diff --git a/crates/sdk/examples/sdk_v1_knowledge_prepare.rs b/crates/sdk/examples/sdk_v1_knowledge_prepare.rs
@@ -1,5 +1,6 @@
use nostr::{EventBuilder, Keys, Kind, Tag, Timestamp};
use radroots_event::RadrootsEventEnvelopeParts;
+use radroots_identity::PublicKey;
use radroots_sdk::knowledge::prelude::*;
const CREATED_AT: u32 = 1_800_000_000;
@@ -70,7 +71,10 @@ fn hex_64(character: char) -> String {
fn event_ref(character: char, kind: u32) -> RadrootsEventRef {
RadrootsEventRef {
id: hex_64(character),
- author: hex_64('a'),
+ author: PublicKey::from_hex(
+ "585591529da0bab31b3b1b1f986611cf5f435dca84f978c89ee8a40cca7103df",
+ )
+ .expect("fixture public key"),
kind,
d_tag: None,
relays: Some(vec![RELAY.to_owned()]),
diff --git a/crates/sdk/tests/knowledge_public_api.rs b/crates/sdk/tests/knowledge_public_api.rs
@@ -2,6 +2,7 @@
use nostr::{EventBuilder, Keys, Kind, Tag, Timestamp};
use radroots_event::RadrootsEventEnvelopeParts;
+use radroots_identity::PublicKey;
use radroots_sdk::knowledge::prelude::*;
use std::sync::LazyLock;
@@ -482,7 +483,7 @@ fn hex_64(character: char) -> String {
fn event_ref(character: char, kind: u32) -> RadrootsEventRef {
RadrootsEventRef {
id: hex_64(character),
- author: hex_64('a'),
+ author: PublicKey::from_hex(&public_key_hex()).expect("fixture public key"),
kind,
d_tag: None,
relays: Some(vec![RELAY.to_owned()]),
diff --git a/tools/sdk_xtask_import/Cargo.toml b/tools/sdk_xtask_import/Cargo.toml
@@ -20,6 +20,7 @@ radroots_core_bindings = { path = "../../crates/core_bindings", version = "=0.1.
radroots_event = { workspace = true, features = ["dto-bindgen"] }
radroots_event_bindings = { path = "../../crates/event_bindings", version = "=0.1.0-alpha" }
radroots_event_index = { workspace = true, features = ["dto-bindgen"] }
+radroots_identity = { workspace = true }
radroots_identity_bindings = { path = "../../crates/identity_bindings", version = "=0.1.0-alpha" }
radroots_replica_schema_bindings = { path = "../../crates/replica_schema_bindings", version = "=0.1.0-alpha" }
radroots_runtime_contract_v1 = { path = "../../crates/runtime_contract_v1", version = "=0.1.0-alpha" }
diff --git a/tools/sdk_xtask_import/src/smoke.rs b/tools/sdk_xtask_import/src/smoke.rs
@@ -178,7 +178,10 @@ fn hex_64(character: char) -> String {
fn event_ref(character: char, kind: u32) -> RadrootsEventRef {
RadrootsEventRef {
id: hex_64(character),
- author: hex_64('a'),
+ author: radroots_identity::PublicKey::from_hex(
+ "585591529da0bab31b3b1b1f986611cf5f435dca84f978c89ee8a40cca7103df",
+ )
+ .expect("fixture public key"),
kind,
d_tag: None,
relays: Some(vec!["wss://relay.radroots.example".to_owned()]),