From 513ed588ca29b28c879617b15e385d1221184ddf Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 8 Sep 2022 18:07:38 +0200 Subject: [PATCH] chore: export abi related types (#1677) * chore: export abi related types * feat: expose function --- ethers-contract/ethers-contract-abigen/src/contract.rs | 2 +- .../ethers-contract-abigen/src/contract/structs.rs | 5 +++++ ethers-contract/ethers-contract-abigen/src/lib.rs | 3 +++ ethers-contract/src/lib.rs | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ethers-contract/ethers-contract-abigen/src/contract.rs b/ethers-contract/ethers-contract-abigen/src/contract.rs index 2d55698b..f287304c 100644 --- a/ethers-contract/ethers-contract-abigen/src/contract.rs +++ b/ethers-contract/ethers-contract-abigen/src/contract.rs @@ -3,7 +3,7 @@ mod common; mod errors; mod events; mod methods; -mod structs; +pub(crate) mod structs; mod types; use super::{util, Abigen}; diff --git a/ethers-contract/ethers-contract-abigen/src/contract/structs.rs b/ethers-contract/ethers-contract-abigen/src/contract/structs.rs index c99f8447..1add4f6a 100644 --- a/ethers-contract/ethers-contract-abigen/src/contract/structs.rs +++ b/ethers-contract/ethers-contract-abigen/src/contract/structs.rs @@ -373,6 +373,11 @@ impl InternalStructs { pub fn rust_type_names(&self) -> &HashMap { &self.rust_type_names } + + /// Returns all the solidity struct types + pub fn structs_types(&self) -> &HashMap { + &self.structs + } } /// This will determine the name of the rust type and will make sure that possible collisions are diff --git a/ethers-contract/ethers-contract-abigen/src/lib.rs b/ethers-contract/ethers-contract-abigen/src/lib.rs index 43d2d537..3c7e537f 100644 --- a/ethers-contract/ethers-contract-abigen/src/lib.rs +++ b/ethers-contract/ethers-contract-abigen/src/lib.rs @@ -13,9 +13,12 @@ mod test_macros; /// Contains types to generate rust bindings for solidity contracts pub mod contract; +pub use contract::structs::InternalStructs; use contract::Context; pub mod rawabi; +pub use rawabi::RawAbi; + mod rustfmt; mod source; mod util; diff --git a/ethers-contract/src/lib.rs b/ethers-contract/src/lib.rs index 13ef0e16..f8672669 100644 --- a/ethers-contract/src/lib.rs +++ b/ethers-contract/src/lib.rs @@ -49,7 +49,7 @@ pub mod builders { #[cfg(any(test, feature = "abigen"))] #[cfg_attr(docsrs, doc(cfg(feature = "abigen")))] pub use ethers_contract_abigen::{ - Abigen, ContractFilter, ExcludeContracts, MultiAbigen, SelectContracts, + Abigen, ContractFilter, ExcludeContracts, InternalStructs, MultiAbigen, RawAbi, SelectContracts, }; #[cfg(any(test, feature = "abigen"))]