Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove unused test #504

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions crates/primitives/benches/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ fn primitives(c: &mut Criterion) {
g.bench_function("keccak256/32", |b| {
let mut out = B256::random();
b.iter(|| {
for _ in 0..10 {
out = keccak256(out);
}
out = keccak256(out.as_slice());
black_box(&out);
});
});
Expand Down
18 changes: 1 addition & 17 deletions crates/primitives/src/signature/sig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,30 +531,14 @@ impl<'de> serde::Deserialize<'de> for crate::Signature {
}

#[cfg(test)]
#[allow(unused_imports)]
mod tests {

use super::*;
use std::str::FromStr;

#[cfg(feature = "rlp")]
use alloy_rlp::{Decodable, Encodable};

#[test]
#[cfg(TODO)] // TODO: Transaction
fn can_recover_tx_sender() {
// random mainnet tx: https://etherscan.io/tx/0x86718885c4b4218c6af87d3d0b0d83e3cc465df2a05c048aa4db9f1a6f9de91f
let tx_rlp = hex::decode("02f872018307910d808507204d2cb1827d0094388c818ca8b9251b393131c08a736a67ccb19297880320d04823e2701c80c001a0cf024f4815304df2867a1a74e9d2707b6abda0337d2d54a4438d453f4160f190a07ac0e6b3bc9395b5b9c8b9e6d77204a236577a5b18467b9175c01de4faa208d9").unwrap();
let tx: Transaction = rlp::decode(&tx_rlp).unwrap();
assert_eq!(tx.rlp(), tx_rlp);
assert_eq!(
tx.hash,
"0x86718885c4b4218c6af87d3d0b0d83e3cc465df2a05c048aa4db9f1a6f9de91f".parse().unwrap()
);
assert_eq!(tx.transaction_type, Some(2.into()));
let expected = Address::from_str("0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5").unwrap();
assert_eq!(tx.recover_from().unwrap(), expected);
}

#[test]
#[cfg(feature = "k256")]
fn can_recover_tx_sender_not_normalized() {
Expand Down
24 changes: 0 additions & 24 deletions crates/sol-types/tests/ui/type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -129,27 +129,3 @@ error[E0412]: cannot find type `a` in this scope
|
739 | mapping(mapping(a b => c d) e => mapping(f g => h i) j) map;
| ^ not found in this scope

error[E0277]: the trait bound `(alloy_sol_types::sol_data::Address, alloy_sol_types::sol_data::Address, alloy_sol_types::sol_data::String, Bool, alloy_sol_types::sol_data::Bytes, alloy_sol_types::sol_data::FixedBytes<1>, alloy_sol_types::sol_data::FixedBytes<2>, alloy_sol_types::sol_data::FixedBytes<3>, alloy_sol_types::sol_data::FixedBytes<4>, alloy_sol_types::sol_data::FixedBytes<5>, alloy_sol_types::sol_data::FixedBytes<6>, alloy_sol_types::sol_data::FixedBytes<7>, alloy_sol_types::sol_data::FixedBytes<8>, alloy_sol_types::sol_data::FixedBytes<9>, alloy_sol_types::sol_data::FixedBytes<10>, alloy_sol_types::sol_data::FixedBytes<11>, alloy_sol_types::sol_data::FixedBytes<12>, alloy_sol_types::sol_data::FixedBytes<13>, alloy_sol_types::sol_data::FixedBytes<14>, alloy_sol_types::sol_data::FixedBytes<15>, alloy_sol_types::sol_data::FixedBytes<16>, alloy_sol_types::sol_data::FixedBytes<17>, alloy_sol_types::sol_data::FixedBytes<18>, alloy_sol_types::sol_data::FixedBytes<19>, alloy_sol_types::sol_data::FixedBytes<20>, alloy_sol_types::sol_data::FixedBytes<21>, alloy_sol_types::sol_data::FixedBytes<22>, alloy_sol_types::sol_data::FixedBytes<23>, alloy_sol_types::sol_data::FixedBytes<24>, alloy_sol_types::sol_data::FixedBytes<25>, alloy_sol_types::sol_data::FixedBytes<26>, alloy_sol_types::sol_data::FixedBytes<27>, alloy_sol_types::sol_data::FixedBytes<28>, alloy_sol_types::sol_data::FixedBytes<29>, alloy_sol_types::sol_data::FixedBytes<30>, alloy_sol_types::sol_data::FixedBytes<31>, alloy_sol_types::sol_data::FixedBytes<32>, Int<256>, Int<8>, Int<16>, Int<24>, Int<32>, Int<40>, Int<48>, Int<56>, Int<64>, Int<72>, Int<80>, Int<88>, Int<96>, Int<104>, Int<112>, Int<120>, Int<128>, Int<136>, Int<144>, Int<152>, Int<160>, Int<168>, Int<176>, Int<184>, Int<192>, Int<200>, Int<208>, Int<216>, Int<224>, Int<232>, Int<240>, Int<248>, Int<256>, alloy_sol_types::sol_data::Uint<256>, alloy_sol_types::sol_data::Uint<8>, alloy_sol_types::sol_data::Uint<16>, alloy_sol_types::sol_data::Uint<24>, alloy_sol_types::sol_data::Uint<32>, alloy_sol_types::sol_data::Uint<40>, alloy_sol_types::sol_data::Uint<48>, alloy_sol_types::sol_data::Uint<56>, alloy_sol_types::sol_data::Uint<64>, alloy_sol_types::sol_data::Uint<72>, alloy_sol_types::sol_data::Uint<80>, alloy_sol_types::sol_data::Uint<88>, alloy_sol_types::sol_data::Uint<96>, alloy_sol_types::sol_data::Uint<104>, alloy_sol_types::sol_data::Uint<112>, alloy_sol_types::sol_data::Uint<120>, alloy_sol_types::sol_data::Uint<128>, alloy_sol_types::sol_data::Uint<136>, alloy_sol_types::sol_data::Uint<144>, alloy_sol_types::sol_data::Uint<152>, alloy_sol_types::sol_data::Uint<160>, alloy_sol_types::sol_data::Uint<168>, alloy_sol_types::sol_data::Uint<176>, alloy_sol_types::sol_data::Uint<184>, alloy_sol_types::sol_data::Uint<192>, alloy_sol_types::sol_data::Uint<200>, alloy_sol_types::sol_data::Uint<208>, alloy_sol_types::sol_data::Uint<216>, alloy_sol_types::sol_data::Uint<224>, alloy_sol_types::sol_data::Uint<232>, alloy_sol_types::sol_data::Uint<240>, alloy_sol_types::sol_data::Uint<248>, alloy_sol_types::sol_data::Uint<256>): SolType` is not satisfied
--> tests/ui/type.rs:3:1
|
3 | / sol! {
4 | | struct BuiltinTypes {
5 | | address a;
6 | | address payable ap;
... |
111 | | }
112 | | }
| |_^ the trait `SolType` is not implemented for `(Address, ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...)`
|
= help: the following other types implement trait `SolType`:
()
(T1,)
(T1, T2)
(T1, T2, T3)
(T1, T2, T3, T4)
(T1, T2, T3, T4, T5)
(T1, T2, T3, T4, T5, T6)
(T1, T2, T3, T4, T5, T6, T7)
and $N others
= note: this error originates in the macro `sol` (in Nightly builds, run with -Z macro-backtrace for more info)
Loading