Create a repo+vault and N intents; return (repo, sorted ids, tempdir).
(n: usize)
| 387 | |
| 388 | /// Create a repo+vault and N intents; return (repo, sorted ids, tempdir). |
| 389 | fn repo_with_intents(n: usize) -> (Repository, Vec<String>, tempfile::TempDir) { |
| 390 | let dir = tempdir().unwrap(); |
| 391 | let repo = Repository::init(dir.path()).unwrap(); |
| 392 | repo.init_vault().unwrap(); |
| 393 | let mut ids = Vec::new(); |
| 394 | for i in 0..n { |
| 395 | let result = repo |
| 396 | .vault_intent_create(IntentCreateOptions { |
| 397 | title: format!("Intent {i}"), |
| 398 | priority: Some("medium".to_string()), |
| 399 | assignee: None, |
| 400 | labels: Vec::new(), |
| 401 | session_id: None, |
| 402 | turn_id: None, |
| 403 | kind: None, |
| 404 | }) |
| 405 | .unwrap(); |
| 406 | ids.push(result.id); |
| 407 | } |
| 408 | ids.sort(); |
| 409 | (repo, ids, dir) |
| 410 | } |
| 411 | |
| 412 | /// Lift+attest a stored intent with a given keypair, returning the node. |
| 413 | fn attest_with(repo: &Repository, id: &str, kp: &KeyPair) -> CanonicalNode { |