Skip to content
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
1,165 changes: 369 additions & 796 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ chrono = { version = "0.4", default-features = false, features = [
"clock",
"std",
] }
axum = "0.7"
axum = "0.8"
ciborium = "0.2"
color-eyre = "0.6"
comfy-table = "7"
Expand Down Expand Up @@ -331,10 +331,14 @@ yansi = { version = "1.0", features = ["detect-tty", "detect-env"] }
path-slash = "0.2"
jiff = "0.2"

## Pinned dependencies. Enabled for the workspace in crates/test-utils.

# Use unicode-rs which has a smaller binary size than the default ICU4X as the IDNA backend, used
# by the `url` crate.
# See the `idna_adapter` README.md for more details: https://docs.rs/crate/idna_adapter/latest
idna_adapter = "=1.1.0"
# Avoid duplicating `zip 2` and `zip 3`. Remove once all `zip` dependencies are updated to `zip 3`.
zip-extract = "=0.2.1"

[patch.crates-io]
## alloy-core
Expand Down
2 changes: 1 addition & 1 deletion crates/anvil/server/src/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Sink<String> for SocketConn {
}

fn start_send(self: Pin<&mut Self>, item: String) -> Result<(), Self::Error> {
self.project().0.start_send(Message::Text(item))
self.project().0.start_send(Message::Text(item.into()))
}

fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ serde.workspace = true
aws-sdk-kms = { workspace = true, default-features = false, optional = true }

# gcp-kms
gcloud-sdk = { version = "0.26.4", default-features = false, optional = true }
gcloud-sdk = { version = "0.27", default-features = false, optional = true }

# bin
foundry-cli.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
traces::identifier::SignaturesIdentifier,
Cast, SimpleCast,
};
use alloy_consensus::transaction::Recovered;
use alloy_consensus::transaction::{Recovered, SignerRecoverable};
use alloy_dyn_abi::{DynSolValue, ErrorExt, EventExt};
use alloy_primitives::{eip191_hash_message, hex, keccak256, Address, B256};
use alloy_provider::Provider;
Expand Down
1 change: 1 addition & 0 deletions crates/cheatcodes/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ impl_from!(
alloy_sol_types::Error,
alloy_dyn_abi::Error,
alloy_primitives::SignatureError,
alloy_consensus::crypto::RecoveryError,
eyre::Report,
FsPathError,
hex::FromHexError,
Expand Down
34 changes: 17 additions & 17 deletions crates/common/src/transactions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Wrappers for transactions.

use alloy_consensus::{Transaction, TxEnvelope};
use alloy_consensus::{transaction::SignerRecoverable, Transaction, TxEnvelope};
use alloy_eips::eip7702::SignedAuthorization;
use alloy_network::AnyTransactionReceipt;
use alloy_primitives::{Address, TxKind, U256};
Expand Down Expand Up @@ -175,20 +175,6 @@ pub fn get_pretty_tx_receipt_attr(
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_extract_revert_reason() {
let error_string_1 = "server returned an error response: error code 3: execution reverted: Transaction too old";
let error_string_2 = "server returned an error response: error code 3: Invalid signature";

assert_eq!(extract_revert_reason(error_string_1), Some("Transaction too old".to_string()));
assert_eq!(extract_revert_reason(error_string_2), None);
}
}

/// Used for broadcasting transactions
/// A transaction can either be a [`TransactionRequest`] waiting to be signed
/// or a [`TxEnvelope`], already signed
Expand All @@ -212,7 +198,7 @@ impl TransactionMaybeSigned {
/// Creates a new signed transaction for broadcast.
pub fn new_signed(
tx: TxEnvelope,
) -> core::result::Result<Self, alloy_primitives::SignatureError> {
) -> core::result::Result<Self, alloy_consensus::crypto::RecoveryError> {
let from = tx.recover_signer()?;
Ok(Self::Signed { tx, from })
}
Expand Down Expand Up @@ -286,9 +272,23 @@ impl From<TransactionRequest> for TransactionMaybeSigned {
}

impl TryFrom<TxEnvelope> for TransactionMaybeSigned {
type Error = alloy_primitives::SignatureError;
type Error = alloy_consensus::crypto::RecoveryError;

fn try_from(tx: TxEnvelope) -> core::result::Result<Self, Self::Error> {
Self::new_signed(tx)
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_extract_revert_reason() {
let error_string_1 = "server returned an error response: error code 3: execution reverted: Transaction too old";
let error_string_2 = "server returned an error response: error code 3: Invalid signature";

assert_eq!(extract_revert_reason(error_string_1), Some("Transaction too old".to_string()));
assert_eq!(extract_revert_reason(error_string_2), None);
}
}
6 changes: 3 additions & 3 deletions crates/forge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ thiserror.workspace = true
tokio = { workspace = true, features = ["time"] }
toml = { workspace = true, features = ["preserve_order"] }
toml_edit = "0.22"
watchexec = "6.0"
watchexec-events = "5.0"
watchexec-signals = "4.0"
watchexec = "8.0"
watchexec-events = "6.0"
watchexec-signals = "5.0"
clearscreen = "4.0"
evm-disassembler.workspace = true

Expand Down
3 changes: 2 additions & 1 deletion crates/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ rand.workspace = true
snapbox = { version = "0.6", features = ["json", "regex", "term-svg"] }
tempfile.workspace = true

# See /Cargo.toml.
## Pinned dependencies. See /Cargo.toml.
idna_adapter.workspace = true
zip-extract.workspace = true

[dev-dependencies]
tokio.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern crate tracing;

// See /Cargo.toml.
use idna_adapter as _;
use zip_extract as _;

// Macros useful for testing.
mod macros;
Expand Down
Loading