Skip to content

Commit 7638f0a

Browse files
dependabot[bot]lutter
authored andcommitted
build(deps): bump sha1 from 0.10.6 to 0.11.0
Bumps [sha1](https://github.com/RustCrypto/hashes) from 0.10.6 to 0.11.0. - [Commits](RustCrypto/hashes@sha1-v0.10.6...sha1-v0.11.0) --- updated-dependencies: - dependency-name: sha1 dependency-version: 0.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
1 parent d3ca0f2 commit 7638f0a

4 files changed

Lines changed: 19 additions & 9 deletions

File tree

Cargo.lock

Lines changed: 15 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gnd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Inflector = { workspace = true }
7171
semver = { workspace = true }
7272

7373
# Build command
74-
sha1 = "0.10"
74+
sha1 = "0.11"
7575
wasmparser = { workspace = true }
7676

7777
# Interactive prompts

gnd/src/commands/build.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ async fn upload_file_to_ipfs(
456456
let content_hash = {
457457
let mut hasher = Sha1::new();
458458
hasher.update(&content);
459-
format!("{:x}", hasher.finalize())
459+
hex::encode(hasher.finalize())
460460
};
461461

462462
let ipfs_hash = if let Some(hash) = uploaded.content_to_ipfs.get(&content_hash) {
@@ -911,8 +911,7 @@ fn file_hash(path: &Path) -> Result<String> {
911911
let content = fs::read(path).with_context(|| format!("Failed to read file: {:?}", path))?;
912912
let mut hasher = Sha1::new();
913913
hasher.update(&content);
914-
let result = hasher.finalize();
915-
Ok(format!("{:x}", result))
914+
Ok(hex::encode(hasher.finalize()))
916915
}
917916

918917
#[cfg(test)]

gnd/src/commands/test/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn deployment_hash_from_path_and_seed(path: &Path, seed: u128) -> Result<Deploym
121121

122122
let input = format!("{}\0{}", path.display(), seed);
123123
let digest = Sha1::digest(input.as_bytes());
124-
let qm = format!("Qm{:x}", digest);
124+
let qm = format!("Qm{}", hex::encode(digest));
125125
DeploymentHash::new(qm).map_err(|e| anyhow!("Failed to create deployment hash: {}", e))
126126
}
127127

0 commit comments

Comments
 (0)