Skip to content

Commit

Permalink
fix python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaiton committed Jan 10, 2025
1 parent 1fa5bfe commit 6e4d09b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ impl HyperdriveState {
err
))
})?;

let result = U256::from(result_fp).to_string();
let result = U256::try_from(result_fp)
.map_err(|err| {
PyErr::new::<PyValueError, _>(format!("Failed to convert to U256 {}", err))
})?
.to_string();
Ok(result)
}

Expand Down

0 comments on commit 6e4d09b

Please sign in to comment.