Create a repo+vault and N intents; return (repo, sorted ids, tempdir).
(n: usize)
| 310 | |
| 311 | /// Create a repo+vault and N intents; return (repo, sorted ids, tempdir). |
| 312 | fn repo_with_intents(n: usize) -> (Repository, Vec<String>, tempfile::TempDir) { |
| 313 | let dir = tempdir().unwrap(); |
| 314 | let repo = Repository::init(dir.path()).unwrap(); |
| 315 | repo.init_vault().unwrap(); |
| 316 | let mut ids = Vec::new(); |
| 317 | for i in 0..n { |
| 318 | let result = repo |
| 319 | .vault_intent_create(IntentCreateOptions { |
| 320 | title: format!("Intent {i}"), |
| 321 | priority: Some("medium".to_string()), |
| 322 | assignee: None, |
| 323 | labels: Vec::new(), |
| 324 | session_id: None, |
| 325 | turn_id: None, |
| 326 | }) |
| 327 | .unwrap(); |
| 328 | ids.push(result.id); |
| 329 | } |
| 330 | ids.sort(); |
| 331 | (repo, ids, dir) |
| 332 | } |
| 333 | |
| 334 | /// Lift+attest a stored intent with a given keypair, returning the node. |
| 335 | fn attest_with(repo: &Repository, id: &str, kp: &KeyPair) -> CanonicalNode { |