about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/Cargo.lock1
-rw-r--r--tvix/Cargo.nix4
-rw-r--r--tvix/store/Cargo.toml1
-rw-r--r--tvix/store/src/proto.rs12
4 files changed, 16 insertions, 2 deletions
diff --git a/tvix/Cargo.lock b/tvix/Cargo.lock
index 21d16b5a8616..7ca7b330cb5c 100644
--- a/tvix/Cargo.lock
+++ b/tvix/Cargo.lock
@@ -2067,6 +2067,7 @@ name = "tvix-store"
 version = "0.1.0"
 dependencies = [
  "blake3",
+ "lazy_static",
  "prost",
  "prost-build",
  "tonic",
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index 8ef5370268d5..8076dd2c4ada 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -6168,6 +6168,10 @@ rec {
             features = [ "rayon" "std" ];
           }
           {
+            name = "lazy_static";
+            packageId = "lazy_static";
+          }
+          {
             name = "prost";
             packageId = "prost";
           }
diff --git a/tvix/store/Cargo.toml b/tvix/store/Cargo.toml
index 2e03788067cb..66eac5206363 100644
--- a/tvix/store/Cargo.toml
+++ b/tvix/store/Cargo.toml
@@ -5,6 +5,7 @@ edition = "2021"
 
 [dependencies]
 blake3 = { version = "1.3.1", features = ["rayon", "std"] }
+lazy_static = "1.4.0"
 prost = "0.11.2"
 tonic = "0.8.2"
 
diff --git a/tvix/store/src/proto.rs b/tvix/store/src/proto.rs
index de8095495e58..cee8aeec5472 100644
--- a/tvix/store/src/proto.rs
+++ b/tvix/store/src/proto.rs
@@ -24,7 +24,15 @@ impl Directory {
 #[cfg(test)]
 mod tests {
     use super::{Directory, DirectoryNode, FileNode, SymlinkNode};
+    use lazy_static::lazy_static;
 
+    lazy_static! {
+        static ref DUMMY_DIGEST: Vec<u8> = vec![
+            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x00,
+        ];
+    }
     #[test]
     fn test_directory_size() {
         {
@@ -51,7 +59,7 @@ mod tests {
             let d = Directory {
                 directories: vec![DirectoryNode {
                     name: String::from("foo"),
-                    digest: vec![],
+                    digest: DUMMY_DIGEST.to_vec(),
                     size: 4,
                 }],
                 files: vec![],
@@ -64,7 +72,7 @@ mod tests {
                 directories: vec![],
                 files: vec![FileNode {
                     name: String::from("foo"),
-                    digest: vec![],
+                    digest: DUMMY_DIGEST.to_vec(),
                     size: 42,
                     executable: false,
                 }],