Skip to content

Commit cf77460

Browse files
fix: backport fmt and anvil fixes to v1.4.1 (#12092)
* fix(fmt): ensure commasep breaks with final trailing cmnt (#12031) * fix(fmt): refine logic over comments between uninformed commasep (#12055) * fix(anvil): set envelope for non deposit tx in debug tracers (#12080) * chore: bump v1.4.1 (#12083) chore: bumpt v1.4.1 * fix(fmt): don't normalize single-line non-doc block cmnts (#12078) * fix: don't normalize single-line non-doc block cmnts * fix: preserve consecutive whitespaces * fix: use byte length instead of char count --------- Co-authored-by: 0xrusowsky <[email protected]>
1 parent e5d659d commit cf77460

File tree

13 files changed

+260
-91
lines changed

13 files changed

+260
-91
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ members = [
2929
resolver = "2"
3030

3131
[workspace.package]
32-
version = "1.4.0"
32+
version = "1.4.1"
3333
edition = "2024"
3434
# Remember to update clippy.toml as well
3535
rust-version = "1.89"

crates/anvil/src/eth/backend/mem/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ use alloy_consensus::{
4242
};
4343
use alloy_eip5792::{Capabilities, DelegationCapability};
4444
use alloy_eips::{
45+
Encodable2718,
4546
eip1559::BaseFeeParams,
4647
eip4844::{BlobTransactionSidecar, kzg_to_versioned_hash},
4748
eip7840::BlobParams,
@@ -2753,7 +2754,10 @@ impl Backend {
27532754

27542755
let target_tx = block.transactions[index].clone();
27552756
let target_tx = PendingTransaction::from_maybe_impersonated(target_tx)?;
2756-
let tx_env = target_tx.to_revm_tx_env();
2757+
let mut tx_env = target_tx.to_revm_tx_env();
2758+
if env.networks.optimism {
2759+
tx_env.enveloped_tx = Some(target_tx.transaction.transaction.encoded_2718().into());
2760+
}
27572761

27582762
let mut evm = self.new_evm_with_inspector_ref(&cache_db, &env, &mut inspector);
27592763

crates/common/src/comments/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ impl<'ast> CommentGatherer<'ast> {
235235
let line_begin_pos = (line_begin_in_file - self.start_bpos).to_usize();
236236
let mut col = CharPos(self.text[line_begin_pos..self.pos].chars().count());
237237

238-
// To preserve alignment in non-doc comments, normalize the block based on its
239-
// least-indented line.
240-
if !is_doc {
238+
// To preserve alignment in multi-line non-doc comments, normalize the block based
239+
// on its least-indented line.
240+
if !is_doc && token_text.contains('\n') {
241241
col = token_text.lines().skip(1).fold(col, |min, line| {
242242
if line.is_empty() {
243243
return min;

0 commit comments

Comments
 (0)