From bc86d16e84e250a626962da0345985ef9bceec21 Mon Sep 17 00:00:00 2001 From: Gustavo Inacio Date: Mon, 4 Mar 2024 21:13:41 -0300 Subject: [PATCH] style: fix fmt and clippy Signed-off-by: Gustavo Inacio --- tap_aggregator/src/aggregator.rs | 25 +++++-------------- .../timeline_aggretion_protocol_benchmark.rs | 2 +- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/tap_aggregator/src/aggregator.rs b/tap_aggregator/src/aggregator.rs index bbd6a6ca..7479cd9c 100644 --- a/tap_aggregator/src/aggregator.rs +++ b/tap_aggregator/src/aggregator.rs @@ -199,23 +199,20 @@ mod tests { domain_separator: Eip712Domain, ) { // Create 2 different receipts - let mut receipts = Vec::new(); - receipts.push( + let receipts = vec![ EIP712SignedMessage::new( &domain_separator, Receipt::new(allocation_ids[0], 42).unwrap(), &keys.0, ) .unwrap(), - ); - receipts.push( EIP712SignedMessage::new( &domain_separator, Receipt::new(allocation_ids[0], 43).unwrap(), &keys.0, ) .unwrap(), - ); + ]; let res = aggregator::check_signatures_unique(&receipts); assert!(res.is_ok()); @@ -299,31 +296,26 @@ mod tests { allocation_ids: Vec
, domain_separator: Eip712Domain, ) { - let mut receipts = Vec::new(); - receipts.push( + let receipts = vec![ EIP712SignedMessage::new( &domain_separator, Receipt::new(allocation_ids[0], 42).unwrap(), &keys.0, ) .unwrap(), - ); - receipts.push( EIP712SignedMessage::new( &domain_separator, Receipt::new(allocation_ids[0], 43).unwrap(), &keys.0, ) .unwrap(), - ); - receipts.push( EIP712SignedMessage::new( &domain_separator, Receipt::new(allocation_ids[1], 44).unwrap(), &keys.0, ) .unwrap(), - ); + ]; let res = aggregator::check_allocation_id(&receipts, allocation_ids[0]); @@ -338,31 +330,26 @@ mod tests { allocation_ids: Vec
, domain_separator: Eip712Domain, ) { - let mut receipts = Vec::new(); - receipts.push( + let receipts = vec![ EIP712SignedMessage::new( &domain_separator, Receipt::new(allocation_ids[0], 42).unwrap(), &keys.0, ) .unwrap(), - ); - receipts.push( EIP712SignedMessage::new( &domain_separator, Receipt::new(allocation_ids[0], 43).unwrap(), &keys.0, ) .unwrap(), - ); - receipts.push( EIP712SignedMessage::new( &domain_separator, Receipt::new(allocation_ids[0], 44).unwrap(), &keys.0, ) .unwrap(), - ); + ]; let res = aggregator::check_allocation_id(&receipts, allocation_ids[0]); diff --git a/tap_core/benches/timeline_aggretion_protocol_benchmark.rs b/tap_core/benches/timeline_aggretion_protocol_benchmark.rs index 326db0f5..37cbc183 100644 --- a/tap_core/benches/timeline_aggretion_protocol_benchmark.rs +++ b/tap_core/benches/timeline_aggretion_protocol_benchmark.rs @@ -11,7 +11,7 @@ use std::str::FromStr; use alloy_primitives::Address; -use alloy_sol_types::{Eip712Domain}; +use alloy_sol_types::Eip712Domain; use criterion::{black_box, criterion_group, criterion_main, Criterion}; use ethers::signers::{LocalWallet, Signer, Wallet}; use ethers_core::k256::ecdsa::SigningKey;