From 24b9ae24040ba2957e39440c1679a8ff3dd106cf Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Wed, 4 Jan 2023 12:29:10 +0100 Subject: [PATCH] fix(contract): doctests (#2007) --- ethers-contract/src/contract.rs | 4 +++- ethers-contract/src/event.rs | 4 ++-- ethers-contract/src/stream.rs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ethers-contract/src/contract.rs b/ethers-contract/src/contract.rs index 0ebb2559..5f417611 100644 --- a/ethers-contract/src/contract.rs +++ b/ethers-contract/src/contract.rs @@ -107,10 +107,12 @@ use std::{fmt::Debug, marker::PhantomData, sync::Arc}; /// ``` /// /// # Event Logging +/// /// Querying structured logs requires you to have defined a struct with the expected /// datatypes and to have implemented `Detokenize` for it. This boilerplate code /// is generated for you via the [`abigen`] and [`Abigen` builder] utilities. -/// +// +// Ignore because `ethers-contract-derive` macros do not work in doctests in `ethers-contract`. /// ```ignore /// # async fn foo() -> Result<(), Box> { /// use ethers_core::{abi::Abi, types::Address}; diff --git a/ethers-contract/src/event.rs b/ethers-contract/src/event.rs index 23864128..c050749e 100644 --- a/ethers-contract/src/event.rs +++ b/ethers-contract/src/event.rs @@ -133,8 +133,8 @@ where /// requests, and this is done on an interval basis. /// /// # Example - /// - /// ``` + // Ignore because `ethers-contract-derive` macros do not work in doctests in `ethers-contract`. + /// ```ignore /// # #[cfg(feature = "abigen")] /// # async fn test(contract: ethers_contract::Contract) { /// # use ethers_core::types::*; diff --git a/ethers-contract/src/stream.rs b/ethers-contract/src/stream.rs index d0f672d2..e258ea4c 100644 --- a/ethers-contract/src/stream.rs +++ b/ethers-contract/src/stream.rs @@ -75,8 +75,8 @@ where /// will be wrapped into the right-hand variant of that `Either`. /// /// # Example - /// - /// ``` + // Ignore because `ethers-contract-derive` macros do not work in doctests in `ethers-contract`. + /// ```ignore /// # #[cfg(feature = "abigen")] /// # async fn test(contract: ethers_contract::Contract) { /// # use ethers_core::types::*;