diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-22 21:02:03 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-22 21:02:03 +0000 |
| commit | 1df90c609399c675e629b97294aee81a0b1e66dd (patch) | |
| tree | 8482cdd0ea87cc0df5a86672bf99399aa0aa1a3d /grasp-audit | |
| parent | 5d3d96c7f0397a079384b7291ff21df76029b126 (diff) | |
chore: bump rust-nostr to latest master
so we can more easily support grasp purgatory feature
Diffstat (limited to 'grasp-audit')
| -rw-r--r-- | grasp-audit/Cargo.toml | 2 | ||||
| -rw-r--r-- | grasp-audit/src/audit.rs | 6 | ||||
| -rw-r--r-- | grasp-audit/src/fixtures.rs | 14 | ||||
| -rw-r--r-- | grasp-audit/src/specs/grasp01/event_acceptance_policy.rs | 4 | ||||
| -rw-r--r-- | grasp-audit/src/specs/grasp01/nip01_smoke.rs | 4 | ||||
| -rw-r--r-- | grasp-audit/src/specs/grasp01/push_authorization.rs | 2 |
6 files changed, 16 insertions, 16 deletions
diff --git a/grasp-audit/Cargo.toml b/grasp-audit/Cargo.toml index 9198cd5..88f3d60 100644 --- a/grasp-audit/Cargo.toml +++ b/grasp-audit/Cargo.toml | |||
| @@ -12,7 +12,7 @@ path = "src/bin/grasp-audit.rs" | |||
| 12 | 12 | ||
| 13 | [dependencies] | 13 | [dependencies] |
| 14 | # Nostr | 14 | # Nostr |
| 15 | nostr-sdk = "0.43" | 15 | nostr-sdk = { git = "https://github.com/rust-nostr/nostr", rev = "e09c9d82a1778683d2a6b968d09eb2c619883bf3" } |
| 16 | 16 | ||
| 17 | # Async | 17 | # Async |
| 18 | tokio = { version = "1", features = ["full"] } | 18 | tokio = { version = "1", features = ["full"] } |
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 { | |||
| 132 | TagKind::SingleLetter(t_tag), | 132 | TagKind::SingleLetter(t_tag), |
| 133 | vec![format!( | 133 | vec![format!( |
| 134 | "audit-cleanup-after-{}", | 134 | "audit-cleanup-after-{}", |
| 135 | self.cleanup_after.as_u64() | 135 | self.cleanup_after.as_secs() |
| 136 | )], | 136 | )], |
| 137 | ), | 137 | ), |
| 138 | ] | 138 | ] |
| @@ -328,7 +328,7 @@ mod tests { | |||
| 328 | let after = Timestamp::now(); | 328 | let after = Timestamp::now(); |
| 329 | 329 | ||
| 330 | // Event timestamp should be between before and after (inclusive) | 330 | // Event timestamp should be between before and after (inclusive) |
| 331 | assert!(event.created_at.as_u64() >= before.as_u64()); | 331 | assert!(event.created_at.as_secs() >= before.as_secs()); |
| 332 | assert!(event.created_at.as_u64() <= after.as_u64()); | 332 | assert!(event.created_at.as_secs() <= after.as_secs()); |
| 333 | } | 333 | } |
| 334 | } | 334 | } |
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> { | |||
| 676 | .to_string(); | 676 | .to_string(); |
| 677 | 677 | ||
| 678 | // Create state announcement with deterministic commit hash | 678 | // Create state announcement with deterministic commit hash |
| 679 | let base_time = Timestamp::now().as_u64(); | 679 | let base_time = Timestamp::now().as_secs(); |
| 680 | let older_timestamp = Timestamp::from(base_time - 10); // 10 seconds ago | 680 | let older_timestamp = Timestamp::from(base_time - 10); // 10 seconds ago |
| 681 | 681 | ||
| 682 | // Tag format: ["refs/heads/main", "<commit_hash>"] | 682 | // Tag format: ["refs/heads/main", "<commit_hash>"] |
| @@ -712,7 +712,7 @@ impl<'a> TestContext<'a> { | |||
| 712 | .to_string(); | 712 | .to_string(); |
| 713 | 713 | ||
| 714 | // Create PR event 1 second in the past | 714 | // Create PR event 1 second in the past |
| 715 | let base_time = Timestamp::now().as_u64(); | 715 | let base_time = Timestamp::now().as_secs(); |
| 716 | let pr_timestamp = Timestamp::from(base_time - 1); | 716 | let pr_timestamp = Timestamp::from(base_time - 1); |
| 717 | 717 | ||
| 718 | // Build NIP-34 PR event (kind 1618) | 718 | // Build NIP-34 PR event (kind 1618) |
| @@ -755,7 +755,7 @@ impl<'a> TestContext<'a> { | |||
| 755 | .to_string(); | 755 | .to_string(); |
| 756 | 756 | ||
| 757 | // Create PR event 1 second in the past | 757 | // Create PR event 1 second in the past |
| 758 | let base_time = Timestamp::now().as_u64(); | 758 | let base_time = Timestamp::now().as_secs(); |
| 759 | let pr_timestamp = Timestamp::from(base_time - 1); | 759 | let pr_timestamp = Timestamp::from(base_time - 1); |
| 760 | 760 | ||
| 761 | // Build NIP-34 PR event (kind 1618) | 761 | // Build NIP-34 PR event (kind 1618) |
| @@ -883,7 +883,7 @@ impl<'a> TestContext<'a> { | |||
| 883 | let repo_id = self.extract_repo_id(&repo)?; | 883 | let repo_id = self.extract_repo_id(&repo)?; |
| 884 | 884 | ||
| 885 | // Build state event | 885 | // Build state event |
| 886 | let base_time = Timestamp::now().as_u64(); | 886 | let base_time = Timestamp::now().as_secs(); |
| 887 | let older_timestamp = Timestamp::from(base_time - 10); // 10 seconds ago | 887 | let older_timestamp = Timestamp::from(base_time - 10); // 10 seconds ago |
| 888 | 888 | ||
| 889 | let state_event = self | 889 | let state_event = self |
| @@ -1036,7 +1036,7 @@ impl<'a> TestContext<'a> { | |||
| 1036 | let repo = self.get_cached_dependency(FixtureKind::ValidRepo)?; | 1036 | let repo = self.get_cached_dependency(FixtureKind::ValidRepo)?; |
| 1037 | 1037 | ||
| 1038 | // Build maintainer's state event (state event ONLY - no announcement) | 1038 | // Build maintainer's state event (state event ONLY - no announcement) |
| 1039 | let base_time = Timestamp::now().as_u64(); | 1039 | let base_time = Timestamp::now().as_secs(); |
| 1040 | let maintainer_timestamp = Timestamp::from(base_time - 5); // 5 seconds ago (more recent than owner's state) | 1040 | let maintainer_timestamp = Timestamp::from(base_time - 5); // 5 seconds ago (more recent than owner's state) |
| 1041 | 1041 | ||
| 1042 | let maintainer_state_event = self | 1042 | let maintainer_state_event = self |
| @@ -1187,7 +1187,7 @@ impl<'a> TestContext<'a> { | |||
| 1187 | self.client.send_event(maintainer_announcement).await?; | 1187 | self.client.send_event(maintainer_announcement).await?; |
| 1188 | 1188 | ||
| 1189 | // Build recursive maintainer's state event | 1189 | // Build recursive maintainer's state event |
| 1190 | let base_time = Timestamp::now().as_u64(); | 1190 | let base_time = Timestamp::now().as_secs(); |
| 1191 | let recursive_maintainer_timestamp = Timestamp::from(base_time - 2); // 2 seconds ago (most recent) | 1191 | let recursive_maintainer_timestamp = Timestamp::from(base_time - 2); // 2 seconds ago (most recent) |
| 1192 | 1192 | ||
| 1193 | let recursive_maintainer_state_event = self | 1193 | let recursive_maintainer_state_event = self |
| @@ -1338,7 +1338,7 @@ impl<'a> TestContext<'a> { | |||
| 1338 | // ============================================================ | 1338 | // ============================================================ |
| 1339 | // Use the same commit hash that's already pushed to the relay | 1339 | // Use the same commit hash that's already pushed to the relay |
| 1340 | // but point HEAD to develop branch instead of main | 1340 | // but point HEAD to develop branch instead of main |
| 1341 | let base_time = Timestamp::now().as_u64(); | 1341 | let base_time = Timestamp::now().as_secs(); |
| 1342 | let develop_timestamp = Timestamp::from(base_time - 1); // 1 second ago (most recent) | 1342 | let develop_timestamp = Timestamp::from(base_time - 1); // 1 second ago (most recent) |
| 1343 | 1343 | ||
| 1344 | let develop_state_event = self | 1344 | 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 { | |||
| 271 | .to_string(); | 271 | .to_string(); |
| 272 | 272 | ||
| 273 | // Create unique repository identifier | 273 | // Create unique repository identifier |
| 274 | let timestamp = Timestamp::now().as_u64(); | 274 | let timestamp = Timestamp::now().as_secs(); |
| 275 | let repo_id = format!("test-repo-no-clone-{}", timestamp); | 275 | let repo_id = format!("test-repo-no-clone-{}", timestamp); |
| 276 | 276 | ||
| 277 | // Create repo announcement WITHOUT service in clone tag | 277 | // Create repo announcement WITHOUT service in clone tag |
| @@ -352,7 +352,7 @@ impl EventAcceptancePolicyTests { | |||
| 352 | .replace("wss://", "https://"); | 352 | .replace("wss://", "https://"); |
| 353 | 353 | ||
| 354 | // Create unique repository identifier | 354 | // Create unique repository identifier |
| 355 | let timestamp = Timestamp::now().as_u64(); | 355 | let timestamp = Timestamp::now().as_secs(); |
| 356 | let repo_id = format!("test-repo-no-relays-{}", timestamp); | 356 | let repo_id = format!("test-repo-no-relays-{}", timestamp); |
| 357 | 357 | ||
| 358 | // Create repo announcement WITHOUT service in relays tag | 358 | // 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 { | |||
| 216 | let invalid_event_json = serde_json::json!({ | 216 | let invalid_event_json = serde_json::json!({ |
| 217 | "id": event.id.to_hex(), | 217 | "id": event.id.to_hex(), |
| 218 | "pubkey": event.pubkey.to_hex(), | 218 | "pubkey": event.pubkey.to_hex(), |
| 219 | "created_at": event.created_at.as_u64(), | 219 | "created_at": event.created_at.as_secs(), |
| 220 | "kind": event.kind.as_u16(), | 220 | "kind": event.kind.as_u16(), |
| 221 | "tags": event.tags, | 221 | "tags": event.tags, |
| 222 | "content": event.content, | 222 | "content": event.content, |
| @@ -261,7 +261,7 @@ impl Nip01SmokeTests { | |||
| 261 | let invalid_event_json = serde_json::json!({ | 261 | let invalid_event_json = serde_json::json!({ |
| 262 | "id": EventId::all_zeros().to_hex(), // Wrong ID! | 262 | "id": EventId::all_zeros().to_hex(), // Wrong ID! |
| 263 | "pubkey": event.pubkey.to_hex(), | 263 | "pubkey": event.pubkey.to_hex(), |
| 264 | "created_at": event.created_at.as_u64(), | 264 | "created_at": event.created_at.as_secs(), |
| 265 | "kind": event.kind.as_u16(), | 265 | "kind": event.kind.as_u16(), |
| 266 | "tags": event.tags, | 266 | "tags": event.tags, |
| 267 | "content": event.content, | 267 | "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 @@ | |||
| 29 | /// | 29 | /// |
| 30 | /// Run `test_pr_test_commit_hash_discovery` to discover/verify this value. | 30 | /// Run `test_pr_test_commit_hash_discovery` to discover/verify this value. |
| 31 | #[allow(dead_code)] | 31 | #[allow(dead_code)] |
| 32 | const PR_TEST_COMMIT_HASH: &str = "5d40fb1555a0c28bf4d650515a73aaa54d4d9bfb"; | 32 | const PR_TEST_COMMIT_HASH: &str = "8935183ff722bf04e861928c6a7e50868c6ca4a6"; |
| 33 | 33 | ||
| 34 | use crate::{ | 34 | use crate::{ |
| 35 | clone_repo, create_commit, create_deterministic_commit_with_variant, try_push, try_push_to_ref, | 35 | clone_repo, create_commit, create_deterministic_commit_with_variant, try_push, try_push_to_ref, |