test: rm useless test

This commit is contained in:
DaniPopes 2023-02-24 22:33:58 +01:00
parent 75f63f9d6d
commit 5f32e983e9
No known key found for this signature in database
GPG Key ID: 0F09640DDB7AC692
1 changed files with 1 additions and 28 deletions

View File

@ -230,19 +230,7 @@ pub(crate) fn event_struct_alias(event_name: &str) -> Ident {
mod tests { mod tests {
use super::*; use super::*;
use crate::Abigen; use crate::Abigen;
use ethers_core::abi::{EventParam, Hash, ParamType}; use ethers_core::abi::{EventParam, ParamType};
use proc_macro2::Literal;
/// Expands a 256-bit `Hash` into a literal representation that can be used with
/// quasi-quoting for code generation. We do this to avoid allocating at runtime
fn expand_hash(hash: Hash) -> TokenStream {
let bytes = hash.as_bytes().iter().copied().map(Literal::u8_unsuffixed);
let ethers_core = ethers_core_crate();
quote! {
#ethers_core::types::H256([#( #bytes ),*])
}
}
fn test_context() -> Context { fn test_context() -> Context {
Context::from_abigen(Abigen::new("TestToken", "[]").unwrap()).unwrap() Context::from_abigen(Abigen::new("TestToken", "[]").unwrap()).unwrap()
@ -393,19 +381,4 @@ mod tests {
struct FooAliasedFilter(pub bool, pub ::ethers_core::types::Address); struct FooAliasedFilter(pub bool, pub ::ethers_core::types::Address);
}); });
} }
#[test]
fn expand_hash_value() {
assert_quote!(
expand_hash(
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f".parse().unwrap()
),
{
::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,
])
},
);
}
} }