From 4022f0fc6ea434562d06a38221a16c83e07b42b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20P=2E=20Centeno?= Date: Mon, 28 Aug 2023 15:55:59 -0300 Subject: [PATCH] Make ABI loader private so we can use expect calls - 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. --- src/abi/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/abi/mod.rs b/src/abi/mod.rs index 521a36f..7d7c90e 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -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.