diff options
Diffstat (limited to 'tvix/store/src')
-rw-r--r-- | tvix/store/src/pathinfoservice/grpc.rs | 2 | ||||
-rw-r--r-- | tvix/store/src/proto/tests/grpc_pathinfoservice.rs | 5 | ||||
-rw-r--r-- | tvix/store/src/proto/tests/pathinfo.rs | 6 | ||||
-rw-r--r-- | tvix/store/src/tests/fixtures.rs | 6 |
4 files changed, 9 insertions, 10 deletions
diff --git a/tvix/store/src/pathinfoservice/grpc.rs b/tvix/store/src/pathinfoservice/grpc.rs index 4e15a5bb0b5b..17d202094a11 100644 --- a/tvix/store/src/pathinfoservice/grpc.rs +++ b/tvix/store/src/pathinfoservice/grpc.rs @@ -195,7 +195,7 @@ mod tests { }; let path_info = grpc_client - .get(fixtures::DUMMY_OUTPUT_HASH.to_vec().try_into().unwrap()) + .get(fixtures::DUMMY_OUTPUT_HASH) .await .expect("must not be error"); diff --git a/tvix/store/src/proto/tests/grpc_pathinfoservice.rs b/tvix/store/src/proto/tests/grpc_pathinfoservice.rs index 8016b9901d96..df74861bc7b4 100644 --- a/tvix/store/src/proto/tests/grpc_pathinfoservice.rs +++ b/tvix/store/src/proto/tests/grpc_pathinfoservice.rs @@ -7,6 +7,7 @@ use crate::tests::fixtures::DUMMY_OUTPUT_HASH; use crate::tests::utils::gen_blob_service; use crate::tests::utils::gen_directory_service; use crate::tests::utils::gen_pathinfo_service; +use bytes::Bytes; use futures::stream::BoxStream; use std::sync::Arc; use tonic::Request; @@ -35,7 +36,7 @@ async fn not_found() { let resp = service .get(Request::new(GetPathInfoRequest { - by_what: Some(ByOutputHash(DUMMY_OUTPUT_HASH.clone())), + by_what: Some(ByOutputHash(Bytes::from(DUMMY_OUTPUT_HASH.to_vec()))), })) .await; @@ -65,7 +66,7 @@ async fn put_get() { let resp = service .get(Request::new(GetPathInfoRequest { - by_what: Some(ByOutputHash(DUMMY_OUTPUT_HASH.clone())), + by_what: Some(ByOutputHash(Bytes::from(DUMMY_OUTPUT_HASH.to_vec()))), })) .await; diff --git a/tvix/store/src/proto/tests/pathinfo.rs b/tvix/store/src/proto/tests/pathinfo.rs index 7c1b69c2a376..dca74dc92fd5 100644 --- a/tvix/store/src/proto/tests/pathinfo.rs +++ b/tvix/store/src/proto/tests/pathinfo.rs @@ -235,8 +235,8 @@ fn validate_inconsistent_narinfo_reference_name_digest() { match path_info.validate().expect_err("must fail") { ValidatePathInfoError::InconsistentNarinfoReferenceNameDigest(0, e_expected, e_actual) => { - assert_eq!(path_info.references[0][..], e_expected); - assert_eq!(DUMMY_OUTPUT_HASH[..], e_actual); + assert_eq!(path_info.references[0][..], e_expected[..]); + assert_eq!(DUMMY_OUTPUT_HASH, e_actual); } e => panic!("unexpected error: {:?}", e), } @@ -274,7 +274,7 @@ fn validate_valid_deriver() { let narinfo = path_info.narinfo.as_mut().unwrap(); narinfo.deriver = Some(crate::proto::StorePath { name: "foo".to_string(), - digest: DUMMY_OUTPUT_HASH.clone(), + digest: Bytes::from(DUMMY_OUTPUT_HASH.as_slice()), }); path_info.validate().expect("must validate"); diff --git a/tvix/store/src/tests/fixtures.rs b/tvix/store/src/tests/fixtures.rs index 7c72d71c6d1e..233f98591528 100644 --- a/tvix/store/src/tests/fixtures.rs +++ b/tvix/store/src/tests/fixtures.rs @@ -5,11 +5,9 @@ use tvix_castore::proto as castorepb; use crate::proto::{nar_info::ca, nar_info::Ca, NarInfo, PathInfo}; pub const DUMMY_NAME: &str = "00000000000000000000000000000000-dummy"; +pub const DUMMY_OUTPUT_HASH: [u8; 20] = [0; 20]; lazy_static! { - // output hash - pub static ref DUMMY_OUTPUT_HASH: bytes::Bytes = vec![0; 20].into(); - /// The NAR representation of a symlink pointing to `/nix/store/somewhereelse` pub static ref NAR_CONTENTS_SYMLINK: Vec<u8> = vec![ 13, 0, 0, 0, 0, 0, 0, 0, b'n', b'i', b'x', b'-', b'a', b'r', b'c', b'h', b'i', b'v', b'e', b'-', b'1', 0, @@ -104,7 +102,7 @@ lazy_static! { size: 0, })), }), - references: vec![DUMMY_OUTPUT_HASH.clone()], + references: vec![DUMMY_OUTPUT_HASH.as_slice().into()], narinfo: None, }; |