From 1df90c609399c675e629b97294aee81a0b1e66dd Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 22 Dec 2025 21:02:03 +0000 Subject: chore: bump rust-nostr to latest master so we can more easily support grasp purgatory feature --- grasp-audit/src/audit.rs | 6 +++--- grasp-audit/src/fixtures.rs | 14 +++++++------- grasp-audit/src/specs/grasp01/event_acceptance_policy.rs | 4 ++-- grasp-audit/src/specs/grasp01/nip01_smoke.rs | 4 ++-- grasp-audit/src/specs/grasp01/push_authorization.rs | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) (limited to 'grasp-audit/src') diff --git a/grasp-audit/src/audit.rs b/grasp-audit/src/audit.rs index 0a4df42..5fb6904 100644 --- a/grasp-audit/src/audit.rs +++ b/grasp-audit/src/audit.rs @@ -132,7 +132,7 @@ impl AuditConfig { TagKind::SingleLetter(t_tag), vec![format!( "audit-cleanup-after-{}", - self.cleanup_after.as_u64() + self.cleanup_after.as_secs() )], ), ] @@ -328,7 +328,7 @@ mod tests { let after = Timestamp::now(); // Event timestamp should be between before and after (inclusive) - assert!(event.created_at.as_u64() >= before.as_u64()); - assert!(event.created_at.as_u64() <= after.as_u64()); + assert!(event.created_at.as_secs() >= before.as_secs()); + assert!(event.created_at.as_secs() <= after.as_secs()); } } diff --git a/grasp-audit/src/fixtures.rs b/grasp-audit/src/fixtures.rs index a15bd79..62f93e8 100644 --- a/grasp-audit/src/fixtures.rs +++ b/grasp-audit/src/fixtures.rs @@ -676,7 +676,7 @@ impl<'a> TestContext<'a> { .to_string(); // Create state announcement with deterministic commit hash - let base_time = Timestamp::now().as_u64(); + let base_time = Timestamp::now().as_secs(); let older_timestamp = Timestamp::from(base_time - 10); // 10 seconds ago // Tag format: ["refs/heads/main", ""] @@ -712,7 +712,7 @@ impl<'a> TestContext<'a> { .to_string(); // Create PR event 1 second in the past - let base_time = Timestamp::now().as_u64(); + let base_time = Timestamp::now().as_secs(); let pr_timestamp = Timestamp::from(base_time - 1); // Build NIP-34 PR event (kind 1618) @@ -755,7 +755,7 @@ impl<'a> TestContext<'a> { .to_string(); // Create PR event 1 second in the past - let base_time = Timestamp::now().as_u64(); + let base_time = Timestamp::now().as_secs(); let pr_timestamp = Timestamp::from(base_time - 1); // Build NIP-34 PR event (kind 1618) @@ -883,7 +883,7 @@ impl<'a> TestContext<'a> { let repo_id = self.extract_repo_id(&repo)?; // Build state event - let base_time = Timestamp::now().as_u64(); + let base_time = Timestamp::now().as_secs(); let older_timestamp = Timestamp::from(base_time - 10); // 10 seconds ago let state_event = self @@ -1036,7 +1036,7 @@ impl<'a> TestContext<'a> { let repo = self.get_cached_dependency(FixtureKind::ValidRepo)?; // Build maintainer's state event (state event ONLY - no announcement) - let base_time = Timestamp::now().as_u64(); + let base_time = Timestamp::now().as_secs(); let maintainer_timestamp = Timestamp::from(base_time - 5); // 5 seconds ago (more recent than owner's state) let maintainer_state_event = self @@ -1187,7 +1187,7 @@ impl<'a> TestContext<'a> { self.client.send_event(maintainer_announcement).await?; // Build recursive maintainer's state event - let base_time = Timestamp::now().as_u64(); + let base_time = Timestamp::now().as_secs(); let recursive_maintainer_timestamp = Timestamp::from(base_time - 2); // 2 seconds ago (most recent) let recursive_maintainer_state_event = self @@ -1338,7 +1338,7 @@ impl<'a> TestContext<'a> { // ============================================================ // Use the same commit hash that's already pushed to the relay // but point HEAD to develop branch instead of main - let base_time = Timestamp::now().as_u64(); + let base_time = Timestamp::now().as_secs(); let develop_timestamp = Timestamp::from(base_time - 1); // 1 second ago (most recent) let develop_state_event = self diff --git a/grasp-audit/src/specs/grasp01/event_acceptance_policy.rs b/grasp-audit/src/specs/grasp01/event_acceptance_policy.rs index c34fe66..00a48fd 100644 --- a/grasp-audit/src/specs/grasp01/event_acceptance_policy.rs +++ b/grasp-audit/src/specs/grasp01/event_acceptance_policy.rs @@ -271,7 +271,7 @@ impl EventAcceptancePolicyTests { .to_string(); // Create unique repository identifier - let timestamp = Timestamp::now().as_u64(); + let timestamp = Timestamp::now().as_secs(); let repo_id = format!("test-repo-no-clone-{}", timestamp); // Create repo announcement WITHOUT service in clone tag @@ -352,7 +352,7 @@ impl EventAcceptancePolicyTests { .replace("wss://", "https://"); // Create unique repository identifier - let timestamp = Timestamp::now().as_u64(); + let timestamp = Timestamp::now().as_secs(); let repo_id = format!("test-repo-no-relays-{}", timestamp); // Create repo announcement WITHOUT service in relays tag diff --git a/grasp-audit/src/specs/grasp01/nip01_smoke.rs b/grasp-audit/src/specs/grasp01/nip01_smoke.rs index 4dbcd3d..bd45ea4 100644 --- a/grasp-audit/src/specs/grasp01/nip01_smoke.rs +++ b/grasp-audit/src/specs/grasp01/nip01_smoke.rs @@ -216,7 +216,7 @@ impl Nip01SmokeTests { let invalid_event_json = serde_json::json!({ "id": event.id.to_hex(), "pubkey": event.pubkey.to_hex(), - "created_at": event.created_at.as_u64(), + "created_at": event.created_at.as_secs(), "kind": event.kind.as_u16(), "tags": event.tags, "content": event.content, @@ -261,7 +261,7 @@ impl Nip01SmokeTests { let invalid_event_json = serde_json::json!({ "id": EventId::all_zeros().to_hex(), // Wrong ID! "pubkey": event.pubkey.to_hex(), - "created_at": event.created_at.as_u64(), + "created_at": event.created_at.as_secs(), "kind": event.kind.as_u16(), "tags": event.tags, "content": event.content, diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs index ec08032..25738d1 100644 --- a/grasp-audit/src/specs/grasp01/push_authorization.rs +++ b/grasp-audit/src/specs/grasp01/push_authorization.rs @@ -29,7 +29,7 @@ /// /// Run `test_pr_test_commit_hash_discovery` to discover/verify this value. #[allow(dead_code)] -const PR_TEST_COMMIT_HASH: &str = "5d40fb1555a0c28bf4d650515a73aaa54d4d9bfb"; +const PR_TEST_COMMIT_HASH: &str = "8935183ff722bf04e861928c6a7e50868c6ca4a6"; use crate::{ clone_repo, create_commit, create_deterministic_commit_with_variant, try_push, try_push_to_ref, -- cgit v1.2.3