diff options
Diffstat (limited to 'test_utils/src/lib.rs')
| -rw-r--r-- | test_utils/src/lib.rs | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index f3f9dcf..9996008 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs | |||
| @@ -13,7 +13,7 @@ pub mod relay; | |||
| 13 | 13 | ||
| 14 | pub static PR_KIND: u64 = 318; | 14 | pub static PR_KIND: u64 = 318; |
| 15 | pub static PATCH_KIND: u64 = 317; | 15 | pub static PATCH_KIND: u64 = 317; |
| 16 | pub static REPOSITORY_KIND: u64 = 30317; | 16 | pub static REPOSITORY_KIND: u64 = 30617; |
| 17 | 17 | ||
| 18 | pub static TEST_KEY_1_NSEC: &str = | 18 | pub static TEST_KEY_1_NSEC: &str = |
| 19 | "nsec1ppsg5sm2aexq06juxmu9evtutr6jkwkhp98exxxvwamhru9lyx9s3rwseq"; | 19 | "nsec1ppsg5sm2aexq06juxmu9evtutr6jkwkhp98exxxvwamhru9lyx9s3rwseq"; |
| @@ -132,17 +132,38 @@ pub fn make_event_old_or_change_user( | |||
| 132 | 132 | ||
| 133 | pub fn generate_repo_ref_event() -> nostr::Event { | 133 | pub fn generate_repo_ref_event() -> nostr::Event { |
| 134 | // taken from test git_repo | 134 | // taken from test git_repo |
| 135 | // TODO - this may not be consistant across computers as it might take the | ||
| 136 | // author and committer from global git config | ||
| 135 | let root_commit = "9ee507fc4357d7ee16a5d8901bedcd103f23c17d"; | 137 | let root_commit = "9ee507fc4357d7ee16a5d8901bedcd103f23c17d"; |
| 136 | nostr::event::EventBuilder::new( | 138 | nostr::event::EventBuilder::new( |
| 137 | nostr::Kind::Custom(REPOSITORY_KIND), | 139 | nostr::Kind::Custom(REPOSITORY_KIND), |
| 138 | "", | 140 | "", |
| 139 | [ | 141 | [ |
| 140 | Tag::Identifier(root_commit.to_string()), | 142 | Tag::Identifier( |
| 141 | Tag::Reference(format!("r-{}", root_commit)), | 143 | // root_commit.to_string() |
| 142 | Tag::Name("example name".to_string()), | 144 | format!("{}-consider-it-random", root_commit), |
| 143 | Tag::Description("example description".to_string()), | 145 | ), |
| 144 | Tag::Relay("ws://localhost:8055".into()), | 146 | Tag::Reference(root_commit.into()), |
| 145 | Tag::Relay("ws://localhost:8056".into()), | 147 | Tag::Name("example name".into()), |
| 148 | Tag::Description("example description".into()), | ||
| 149 | Tag::Generic( | ||
| 150 | nostr::TagKind::Custom("clone".to_string()), | ||
| 151 | vec!["git:://123.gitexample.com/test".to_string()], | ||
| 152 | ), | ||
| 153 | Tag::Generic( | ||
| 154 | nostr::TagKind::Custom("web".to_string()), | ||
| 155 | vec![ | ||
| 156 | "https://exampleproject.xyz".to_string(), | ||
| 157 | "https://gitworkshop.dev/123".to_string(), | ||
| 158 | ], | ||
| 159 | ), | ||
| 160 | Tag::Generic( | ||
| 161 | nostr::TagKind::Custom("relays".to_string()), | ||
| 162 | vec![ | ||
| 163 | "ws://localhost:8055".to_string(), | ||
| 164 | "ws://localhost:8056".to_string(), | ||
| 165 | ], | ||
| 166 | ), | ||
| 146 | Tag::public_key(TEST_KEY_1_KEYS.public_key()), | 167 | Tag::public_key(TEST_KEY_1_KEYS.public_key()), |
| 147 | Tag::public_key(TEST_KEY_2_KEYS.public_key()), | 168 | Tag::public_key(TEST_KEY_2_KEYS.public_key()), |
| 148 | ], | 169 | ], |