diff options
author | Florian Klink <flokli@flokli.de> | 2023-10-05T07·59+0300 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-10-05T09·52+0000 |
commit | 1f03a520a9d0d7d49de59f8a7b8dc314281642fa (patch) | |
tree | 895b4f0c132896b0abfa10945cdf49a38d7f4aa0 /tvix/store/src/proto/tests | |
parent | 7706a8f224d6277b7c4f32ffaf869dc7f28e643d (diff) |
feat(tvix/store): add validation for references r/6706
This validates the size of reference digests in the PathInfo message, as well as inside the narinfo submessage. If narinfo is set, they need to parse to StorePath, and have the same digest there as in the PathInfo message. `proto::tests::pathinfo::validate_references` needed to be updated, because we actually did not populate the proper references before. Change-Id: I9545b2487aab9fe0d229c26aceba5ddc5e6daafd Reviewed-on: https://cl.tvl.fyi/c/depot/+/9545 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: edef <edef@edef.eu> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/proto/tests')
-rw-r--r-- | tvix/store/src/proto/tests/pathinfo.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/store/src/proto/tests/pathinfo.rs b/tvix/store/src/proto/tests/pathinfo.rs index a74b7c3f7ce5..3a9ce2e7e3e7 100644 --- a/tvix/store/src/proto/tests/pathinfo.rs +++ b/tvix/store/src/proto/tests/pathinfo.rs @@ -161,7 +161,7 @@ fn validate_references() { size: 0, })), }), - references: vec![DUMMY_DIGEST_2.clone().into()], + references: vec![DUMMY_OUTPUT_HASH.clone().into()], narinfo: None, }; assert!(path_info.validate().is_ok()); @@ -190,7 +190,7 @@ fn validate_references() { nar_size: 0, nar_sha256: DUMMY_DIGEST.clone().into(), signatures: vec![], - reference_names: vec![format!("/nix/store/{}", DUMMY_NAME)], + reference_names: vec![DUMMY_NAME.to_string()], }), ..path_info }; |