Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix: skip json abi formatting (#1777)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 11, 2022
1 parent 123e2de commit 12548b5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,16 @@ pub(crate) fn struct_declaration(cx: &Context) -> TokenStream {

let abi_parse = if !cx.human_readable {
quote! {
pub static #abi_name: #ethers_contract::Lazy<#ethers_core::abi::Abi> = #ethers_contract::Lazy::new(|| #ethers_core::utils::__serde_json::from_str(#abi)
#[rustfmt::skip]
const __ABI: &str = #abi;

/// The parsed JSON-ABI of the contract.
pub static #abi_name: #ethers_contract::Lazy<#ethers_core::abi::Abi> = #ethers_contract::Lazy::new(|| #ethers_core::utils::__serde_json::from_str(__ABI)
.expect("invalid abi"));
}
} else {
quote! {
/// The parsed human readable ABI of the contract.
pub static #abi_name: #ethers_contract::Lazy<#ethers_core::abi::Abi> = #ethers_contract::Lazy::new(|| #ethers_core::abi::parse_abi_str(#abi)
.expect("invalid abi"));
}
Expand Down

0 comments on commit 12548b5

Please sign in to comment.