Skip to content

Commit

Permalink
Make ABI loader private so we can use expect calls
Browse files Browse the repository at this point in the history
- Why private?
  - This functionality is out of scope for our SDK.
  - It wasn't being used outside this module.
- I think that it is ok to go with the simplest solution right now. We
  could refactor this to emit an error in the future if necessary.
  - It makes sense to use `expect`/`unwrap` here because the
    `include_str!` macro ensures that the ABI JSON string is present.
  • Loading branch information
jpcenteno committed Aug 28, 2023
1 parent 741d8df commit 4022f0f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use std::str::FromStr;

const L1_DEFAULT_BRIDGE_INTERFACE: &str = include_str!("./IL1Bridge.json");

// FIXME this was taken from
pub fn load_contract(raw_abi_string: &str) -> Contract {
fn load_contract(raw_abi_string: &str) -> Contract {
// Note that using `.expect` here is acceptable because we expect the value of
// `L1_DEFAULT_BRIDGE_INTERFACE` to be correct. In the future, we should refactor this piece of
// code to run in compile time.
Expand Down

0 comments on commit 4022f0f

Please sign in to comment.