Skip to content

Commit

Permalink
Update crates/sdk/src/migrations.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Tomas Zemanovic <[email protected]>
  • Loading branch information
batconjurer and tzemanovic committed May 28, 2024
1 parent 777d40d commit 10e3713
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crates/sdk/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,9 @@ where
}

fn validate(&self) -> eyre::Result<String> {
let mut update_json = String::new();
let mut file = std::fs::File::open(&self.path).map_err(|_| {
eyre!("Could not fine updates file at the specified path.")
let update_json = std::fs::read_to_string(&self.path).map_err(|_| {
eyre!("Could not find or read updates file at the specified path.")
})?;
_ = file
.read_to_string(&mut update_json)
.map_err(|e| eyre!("{}", e))?;
// validate contents against provided hash
if Hash::sha256(update_json.as_bytes()) != self.hash {
Err(eyre!(
Expand Down

0 comments on commit 10e3713

Please sign in to comment.