refactor(tvix/store/tests/fixtures): use [u8; 20]
This makes the fixture more use-able when interacting with the trait, the Bytes are only useful for the gRPC version. Change-Id: Iaaea1adc6df18491f236a28c4343f5b4ee5fcfd3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11271 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
This commit is contained in:
parent
bfc5b209a6
commit
93dc5df957
4 changed files with 9 additions and 10 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue