From 96f4723c13681b0a5462711652b30dc7f82666db Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Fri, 6 Jan 2023 10:30:34 +0100 Subject: [PATCH] fix(abigen): tests (#2015) * fix: methods tests * fix: remaining paths in tests --- .../src/contract/events.rs | 14 +++---- .../src/contract/methods.rs | 37 +++++++++---------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/ethers-contract/ethers-contract-abigen/src/contract/events.rs b/ethers-contract/ethers-contract-abigen/src/contract/events.rs index 90727439..bae8ca66 100644 --- a/ethers-contract/ethers-contract-abigen/src/contract/events.rs +++ b/ethers-contract/ethers-contract-abigen/src/contract/events.rs @@ -405,7 +405,7 @@ mod tests { #[doc = "Gets the contract's `Transfer` event"] pub fn transfer_event_filter( &self - ) -> ethers_contract::builders::Event { + ) -> ::ethers_contract::builders::Event { self.0.event() } }); @@ -424,7 +424,7 @@ mod tests { let cx = test_context(); assert_quote!(cx.expand_filter(&event), { #[doc = "Gets the contract's `Transfer` event"] - pub fn transfer_filter(&self) -> ethers_contract::builders::Event { + pub fn transfer_filter(&self) -> ::ethers_contract::builders::Event { self.0.event() } }); @@ -449,7 +449,7 @@ mod tests { assert_quote!(definition, { struct FooFilter { pub a: bool, - pub p1: ethers_core::types::Address, + pub p1: ::ethers_core::types::Address, } }); } @@ -474,7 +474,7 @@ mod tests { assert_quote!(definition, { struct FooAliasedFilter { pub a: bool, - pub p1: ethers_core::types::Address, + pub p1: ::ethers_core::types::Address, } }); } @@ -496,7 +496,7 @@ mod tests { let definition = expand_data_tuple(&name, ¶ms); assert_quote!(definition, { - struct FooFilter(pub bool, pub ethers_core::types::Address); + struct FooFilter(pub bool, pub ::ethers_core::types::Address); }); } @@ -518,7 +518,7 @@ mod tests { let definition = expand_data_tuple(&name, ¶ms); assert_quote!(definition, { - struct FooAliasedFilter(pub bool, pub ethers_core::types::Address); + struct FooAliasedFilter(pub bool, pub ::ethers_core::types::Address); }); } @@ -530,7 +530,7 @@ mod tests { "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f".parse().unwrap() ), { - ethers_core::types::H256([ + ::ethers_core::types::H256([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ]) diff --git a/ethers-contract/ethers-contract-abigen/src/contract/methods.rs b/ethers-contract/ethers-contract-abigen/src/contract/methods.rs index 6fc6bb56..e2d048ad 100644 --- a/ethers-contract/ethers-contract-abigen/src/contract/methods.rs +++ b/ethers-contract/ethers-contract-abigen/src/contract/methods.rs @@ -846,31 +846,28 @@ mod tests { } #[test] - fn expand_inputs_() { + fn test_expand_inputs() { assert_quote!( - expand_inputs( - - &[ - Param { - name: "a".to_string(), - kind: ParamType::Bool, - internal_type: None, - }, - Param { - name: "b".to_string(), - kind: ParamType::Address, - internal_type: None, - }, - ], - ) + expand_inputs(&[ + Param { + name: "a".to_string(), + kind: ParamType::Bool, + internal_type: None, + }, + Param { + name: "b".to_string(), + kind: ParamType::Address, + internal_type: None, + }, + ]) .unwrap(), - { , a: bool, b: ethers_core::types::Address }, + { , a: bool, b: ::ethers_core::types::Address }, ); } #[test] fn expand_fn_outputs_empty() { - assert_quote!(expand_fn_outputs(&[],).unwrap(), { () }); + assert_quote!(expand_fn_outputs(&[]).unwrap(), { () }); } #[test] @@ -892,9 +889,9 @@ mod tests { expand_fn_outputs(&[ Param { name: "a".to_string(), kind: ParamType::Bool, internal_type: None }, Param { name: "b".to_string(), kind: ParamType::Address, internal_type: None }, - ],) + ]) .unwrap(), - { (bool, ethers_core::types::Address) }, + { (bool, ::ethers_core::types::Address) }, ); } }