Skip to content

Commit

Permalink
replace try_from uses
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelabro committed Aug 20, 2024
1 parent 2bc3bf6 commit 58ae35c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/papyrus_execution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,16 @@ const INITIAL_GAS_COST: u64 = 10000000000;
pub type ExecutionResult<T> = Result<T, ExecutionError>;

static VERSIONED_CONSTANTS_13_0: Lazy<VersionedConstants> = Lazy::new(|| {
VersionedConstants::try_from(Path::new("./resources/versioned_constants_13_0.json"))
.expect("Versioned constants JSON file is malformed")
VersionedConstants::new_from_path_to_json_file(Path::new(
"./resources/versioned_constants_13_0.json",
))
.expect("Versioned constants JSON file is malformed")
});
static VERSIONED_CONSTANTS_13_1: Lazy<VersionedConstants> = Lazy::new(|| {
VersionedConstants::try_from(Path::new("./resources/versioned_constants_13_1.json"))
.expect("Versioned constants JSON file is malformed")
VersionedConstants::new_from_path_to_json_file(Path::new(
"./resources/versioned_constants_13_1.json",
))
.expect("Versioned constants JSON file is malformed")
});

#[derive(Copy, Clone, Serialize, Deserialize, Debug, PartialEq)]
Expand Down

0 comments on commit 58ae35c

Please sign in to comment.