v0.3.7-pre.008

This commit is contained in:
2026-09-02 16:56:11 +02:00
parent 6e406a6b84
commit 48d26b43f9
19 changed files with 693 additions and 30 deletions

View File

@@ -0,0 +1,24 @@
// file: crates/ksp-app-backfill-desk/unit_tests/backfill_run.rs
// version: 1
#[test]
fn generated_run_ids_are_backend_owned_bounded_and_unique_in_session() {
let state = crate::BackfillRunState::new();
let first = state.next_job_id();
let second = state.next_job_id();
assert!(first.is_ok());
assert!(second.is_ok());
let first = match first {
std::result::Result::Ok(value) => value,
std::result::Result::Err(_) => return,
};
let second = match second {
std::result::Result::Ok(value) => value,
std::result::Result::Err(_) => return,
};
assert_ne!(first, second);
assert!(first.as_str().starts_with("backfill-desk-"));
assert!(second.as_str().starts_with("backfill-desk-"));
assert!(first.as_str().len() <= ksp_job_api::MAX_JOB_ID_BYTES);
assert!(second.as_str().len() <= ksp_job_api::MAX_JOB_ID_BYTES);
}

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-backfill-desk/unit_tests/dto_backfill.rs
// version: 1
// version: 2
#[test]
fn request_limits_are_derived_from_job_owned_public_bounds() {
@@ -29,3 +29,17 @@ fn request_options_expose_exact_current_commitments_and_http_scopes() {
vec!["latest_address".to_owned(), "before_address".to_owned(), "after_address".to_owned(), "explicit_signatures".to_owned()]
);
}
#[test]
fn start_acknowledgement_contains_only_backend_job_identity_and_initial_state() {
let response = crate::BackfillStartResponseDto { job_id: "backfill-desk-1".to_owned(), state: "created".to_owned() };
let serialized = serde_json::to_string(&response);
assert!(serialized.is_ok());
if let std::result::Result::Ok(serialized) = serialized {
assert!(serialized.contains("backfill-desk-1"));
assert!(serialized.contains("created"));
for forbidden in ["address", "signature", "provider", "endpoint", "credential", "token"] {
assert!(!serialized.contains(forbidden));
}
}
}