fix(abigen): tests (#2015)
* fix: methods tests * fix: remaining paths in tests
This commit is contained in:
parent
5917e842d7
commit
96f4723c13
|
@ -405,7 +405,7 @@ mod tests {
|
||||||
#[doc = "Gets the contract's `Transfer` event"]
|
#[doc = "Gets the contract's `Transfer` event"]
|
||||||
pub fn transfer_event_filter(
|
pub fn transfer_event_filter(
|
||||||
&self
|
&self
|
||||||
) -> ethers_contract::builders::Event<M, TransferEventFilter> {
|
) -> ::ethers_contract::builders::Event<M, TransferEventFilter> {
|
||||||
self.0.event()
|
self.0.event()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -424,7 +424,7 @@ mod tests {
|
||||||
let cx = test_context();
|
let cx = test_context();
|
||||||
assert_quote!(cx.expand_filter(&event), {
|
assert_quote!(cx.expand_filter(&event), {
|
||||||
#[doc = "Gets the contract's `Transfer` event"]
|
#[doc = "Gets the contract's `Transfer` event"]
|
||||||
pub fn transfer_filter(&self) -> ethers_contract::builders::Event<M, TransferFilter> {
|
pub fn transfer_filter(&self) -> ::ethers_contract::builders::Event<M, TransferFilter> {
|
||||||
self.0.event()
|
self.0.event()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -449,7 +449,7 @@ mod tests {
|
||||||
assert_quote!(definition, {
|
assert_quote!(definition, {
|
||||||
struct FooFilter {
|
struct FooFilter {
|
||||||
pub a: bool,
|
pub a: bool,
|
||||||
pub p1: ethers_core::types::Address,
|
pub p1: ::ethers_core::types::Address,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -474,7 +474,7 @@ mod tests {
|
||||||
assert_quote!(definition, {
|
assert_quote!(definition, {
|
||||||
struct FooAliasedFilter {
|
struct FooAliasedFilter {
|
||||||
pub a: bool,
|
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);
|
let definition = expand_data_tuple(&name, ¶ms);
|
||||||
|
|
||||||
assert_quote!(definition, {
|
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);
|
let definition = expand_data_tuple(&name, ¶ms);
|
||||||
|
|
||||||
assert_quote!(definition, {
|
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()
|
"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,
|
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
|
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
|
||||||
])
|
])
|
||||||
|
|
|
@ -846,31 +846,28 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn expand_inputs_() {
|
fn test_expand_inputs() {
|
||||||
assert_quote!(
|
assert_quote!(
|
||||||
expand_inputs(
|
expand_inputs(&[
|
||||||
|
Param {
|
||||||
&[
|
name: "a".to_string(),
|
||||||
Param {
|
kind: ParamType::Bool,
|
||||||
name: "a".to_string(),
|
internal_type: None,
|
||||||
kind: ParamType::Bool,
|
},
|
||||||
internal_type: None,
|
Param {
|
||||||
},
|
name: "b".to_string(),
|
||||||
Param {
|
kind: ParamType::Address,
|
||||||
name: "b".to_string(),
|
internal_type: None,
|
||||||
kind: ParamType::Address,
|
},
|
||||||
internal_type: None,
|
])
|
||||||
},
|
|
||||||
],
|
|
||||||
)
|
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
{ , a: bool, b: ethers_core::types::Address },
|
{ , a: bool, b: ::ethers_core::types::Address },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn expand_fn_outputs_empty() {
|
fn expand_fn_outputs_empty() {
|
||||||
assert_quote!(expand_fn_outputs(&[],).unwrap(), { () });
|
assert_quote!(expand_fn_outputs(&[]).unwrap(), { () });
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -892,9 +889,9 @@ mod tests {
|
||||||
expand_fn_outputs(&[
|
expand_fn_outputs(&[
|
||||||
Param { name: "a".to_string(), kind: ParamType::Bool, internal_type: None },
|
Param { name: "a".to_string(), kind: ParamType::Bool, internal_type: None },
|
||||||
Param { name: "b".to_string(), kind: ParamType::Address, internal_type: None },
|
Param { name: "b".to_string(), kind: ParamType::Address, internal_type: None },
|
||||||
],)
|
])
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
{ (bool, ethers_core::types::Address) },
|
{ (bool, ::ethers_core::types::Address) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue