Skip to content

Commit 1236918

Browse files
committed
temp
1 parent 6503571 commit 1236918

File tree

125 files changed

+766
-435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+766
-435
lines changed

Cargo.lock

Lines changed: 59 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/anvil/core/src/eth/serde_helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub mod sequence {
2727
return Err(serde::de::Error::custom(format!(
2828
"expected params sequence with length 1 but got {}",
2929
seq.len()
30-
)))
30+
)));
3131
}
3232
Ok(seq.remove(0))
3333
}
@@ -46,7 +46,7 @@ pub mod empty_params {
4646
return Err(serde::de::Error::custom(format!(
4747
"expected params sequence with length 0 but got {}",
4848
seq.len()
49-
)))
49+
)));
5050
}
5151
Ok(())
5252
}

crates/anvil/core/src/eth/transaction/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn transaction_request_to_typed(
7070
gas_limit: gas.unwrap_or_default(),
7171
is_system_tx: other.get_deserialized::<bool>("isSystemTx")?.ok()?,
7272
input: input.into_input().unwrap_or_default(),
73-
}))
73+
}));
7474
}
7575

7676
match (
@@ -198,7 +198,7 @@ impl MaybeImpersonatedTransaction {
198198
#[cfg(feature = "impersonated-tx")]
199199
pub fn recover(&self) -> Result<Address, alloy_primitives::SignatureError> {
200200
if let Some(sender) = self.impersonated_sender {
201-
return Ok(sender)
201+
return Ok(sender);
202202
}
203203
self.transaction.recover()
204204
}
@@ -211,7 +211,7 @@ impl MaybeImpersonatedTransaction {
211211
pub fn hash(&self) -> B256 {
212212
if self.transaction.is_impersonated() {
213213
if let Some(sender) = self.impersonated_sender {
214-
return self.transaction.impersonated_hash(sender)
214+
return self.transaction.impersonated_hash(sender);
215215
}
216216
}
217217
self.transaction.hash()
@@ -919,7 +919,7 @@ impl Decodable for TypedTransaction {
919919

920920
// Legacy TX
921921
if header.list {
922-
return Ok(TxEnvelope::decode(buf)?.into())
922+
return Ok(TxEnvelope::decode(buf)?.into());
923923
}
924924

925925
// Check byte after header
@@ -965,7 +965,7 @@ impl Encodable2718 for TypedTransaction {
965965
impl Decodable2718 for TypedTransaction {
966966
fn typed_decode(ty: u8, buf: &mut &[u8]) -> Result<Self, Eip2718Error> {
967967
if ty == 0x7E {
968-
return Ok(Self::Deposit(DepositTransaction::decode(buf)?))
968+
return Ok(Self::Deposit(DepositTransaction::decode(buf)?));
969969
}
970970
match TxEnvelope::typed_decode(ty, buf)? {
971971
TxEnvelope::Eip2930(tx) => Ok(Self::EIP2930(tx)),
@@ -1298,7 +1298,7 @@ impl Encodable2718 for TypedReceipt {
12981298
impl Decodable2718 for TypedReceipt {
12991299
fn typed_decode(ty: u8, buf: &mut &[u8]) -> Result<Self, Eip2718Error> {
13001300
if ty == 0x7E {
1301-
return Ok(Self::Deposit(DepositReceipt::decode(buf)?))
1301+
return Ok(Self::Deposit(DepositReceipt::decode(buf)?));
13021302
}
13031303
match ReceiptEnvelope::typed_decode(ty, buf)? {
13041304
ReceiptEnvelope::Eip2930(tx) => Ok(Self::EIP2930(tx)),

crates/anvil/server/src/ipc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl tokio_util::codec::Decoder for JsonRpcCodec {
159159
return match String::from_utf8(bts.as_ref().to_vec()) {
160160
Ok(val) => Ok(Some(val)),
161161
Err(_) => Ok(None),
162-
}
162+
};
163163
}
164164
}
165165
Ok(None)

crates/anvil/server/src/pubsub.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<Handler: PubSubRpcHandler> PubSubContext<Handler> {
6868
let mut subscriptions = self.subscriptions.lock();
6969
if let Some(idx) = subscriptions.iter().position(|(i, _)| id == i) {
7070
trace!(target: "rpc", ?id, "removed subscription");
71-
return Some(subscriptions.swap_remove(idx).1)
71+
return Some(subscriptions.swap_remove(idx).1);
7272
}
7373
None
7474
}
@@ -174,7 +174,7 @@ where
174174
error!(target: "rpc", ?err, "Failed to send message");
175175
}
176176
} else {
177-
break
177+
break;
178178
}
179179
}
180180

@@ -183,7 +183,7 @@ where
183183
if let Poll::Ready(Err(err)) = pin.connection.poll_flush_unpin(cx) {
184184
trace!(target: "rpc", ?err, "websocket err");
185185
// close the connection
186-
return Poll::Ready(())
186+
return Poll::Ready(());
187187
}
188188

189189
loop {
@@ -195,25 +195,25 @@ where
195195
Err(err) => match err {
196196
RequestError::Axum(err) => {
197197
trace!(target: "rpc", ?err, "client disconnected");
198-
return Poll::Ready(())
198+
return Poll::Ready(());
199199
}
200200
RequestError::Io(err) => {
201201
trace!(target: "rpc", ?err, "client disconnected");
202-
return Poll::Ready(())
202+
return Poll::Ready(());
203203
}
204204
RequestError::Serde(err) => {
205205
pin.process_request(Err(err));
206206
}
207207
RequestError::Disconnect => {
208208
trace!(target: "rpc", "client disconnected");
209-
return Poll::Ready(())
209+
return Poll::Ready(());
210210
}
211211
},
212212
_ => {}
213213
},
214214
Poll::Ready(None) => {
215215
trace!(target: "rpc", "socket connection finished");
216-
return Poll::Ready(())
216+
return Poll::Ready(());
217217
}
218218
Poll::Pending => break,
219219
}
@@ -256,7 +256,7 @@ where
256256
}
257257

258258
if !progress {
259-
return Poll::Pending
259+
return Poll::Pending;
260260
}
261261
}
262262
}

crates/anvil/src/anvil.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async fn main() -> eyre::Result<()> {
5757
&mut std::io::stdout(),
5858
),
5959
}
60-
return Ok(())
60+
return Ok(());
6161
}
6262

6363
let _ = fdlimit::raise_fd_limit();

crates/anvil/src/cmd.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ impl Future for PeriodicStateDumper {
575575
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
576576
let this = self.get_mut();
577577
if this.dump_state.is_none() {
578-
return Poll::Pending
578+
return Poll::Pending;
579579
}
580580

581581
loop {
@@ -586,7 +586,7 @@ impl Future for PeriodicStateDumper {
586586
}
587587
Poll::Pending => {
588588
this.in_progress_dump = Some(flush);
589-
return Poll::Pending
589+
return Poll::Pending;
590590
}
591591
}
592592
}
@@ -596,7 +596,7 @@ impl Future for PeriodicStateDumper {
596596
let path = this.dump_state.clone().expect("exists; see above");
597597
this.in_progress_dump = Some(Box::pin(Self::dump_state(api, path)));
598598
} else {
599-
break
599+
break;
600600
}
601601
}
602602

@@ -626,7 +626,7 @@ impl StateFile {
626626
}
627627
let mut state = Self { path, state: None };
628628
if !state.path.exists() {
629-
return Ok(state)
629+
return Ok(state);
630630
}
631631

632632
state.state = Some(SerializableState::load(&state.path).map_err(|err| err.to_string())?);
@@ -661,14 +661,14 @@ impl FromStr for ForkUrl {
661661
fn from_str(s: &str) -> Result<Self, Self::Err> {
662662
if let Some((url, block)) = s.rsplit_once('@') {
663663
if block == "latest" {
664-
return Ok(Self { url: url.to_string(), block: None })
664+
return Ok(Self { url: url.to_string(), block: None });
665665
}
666666
// this will prevent false positives for auths `user:[email protected]`
667667
if !block.is_empty() && !block.contains(':') && !block.contains('.') {
668668
let block: u64 = block
669669
.parse()
670670
.map_err(|_| format!("Failed to parse block number: `{block}`"))?;
671-
return Ok(Self { url: url.to_string(), block: Some(block) })
671+
return Ok(Self { url: url.to_string(), block: Some(block) });
672672
}
673673
}
674674
Ok(Self { url: s.to_string(), block: None })

0 commit comments

Comments
 (0)