Skip to content

Commit

Permalink
test: patch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xOsiris committed Jan 24, 2025
1 parent a6d697a commit 0bf2288
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
1 change: 0 additions & 1 deletion world-chain-builder/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion world-chain-builder/crates/world/payload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ op-alloy-consensus.workspace = true

# misc
tracing.workspace = true
thiserror.workspace = true
2 changes: 1 addition & 1 deletion world-chain-builder/crates/world/pbh/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl PbhPayload {

#[cfg(test)]
mod test {
use chrono::{TimeZone, Utc};
use chrono::TimeZone;
use ethers_core::types::U256;
use semaphore::Field;
use test_case::test_case;
Expand Down
2 changes: 0 additions & 2 deletions world-chain-builder/crates/world/pool/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ use crate::validator::WorldChainTransactionValidator;
const MNEMONIC: &str = "test test test test test test test test test test test junk";

pub fn signer(index: u32) -> PrivateKeySigner {


alloy_signer_local::MnemonicBuilder::<English>::default()
.phrase(MNEMONIC)
.index(index)
Expand Down
7 changes: 3 additions & 4 deletions world-chain-builder/crates/world/pool/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ use alloy_primitives::TxHash;
use alloy_rpc_types::erc4337::TransactionConditional;
use op_alloy_consensus::OpTypedTransaction;
use reth::transaction_pool::{
error::{InvalidPoolTransactionError, PoolTransactionError},
EthBlobTransactionSidecar, EthPoolTransaction, PoolTransaction,
TransactionValidationOutcome,
};
error::{InvalidPoolTransactionError, PoolTransactionError},
EthBlobTransactionSidecar, EthPoolTransaction, PoolTransaction, TransactionValidationOutcome,
};
use reth_optimism_node::txpool::OpPooledTransaction;
use reth_optimism_primitives::OpTransactionSigned;
use reth_primitives::transaction::TransactionConversionError;
Expand Down
11 changes: 4 additions & 7 deletions world-chain-builder/crates/world/pool/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,7 @@ pub mod tests {
.await
.expect_err("Validation should fail because of missing proof");

assert!(err
.to_string()
.contains("one or more user ops are missing pbh payloads"),);
assert!(err.to_string().contains("Missing PBH Payload"),);
}

#[tokio::test]
Expand Down Expand Up @@ -489,10 +487,9 @@ pub mod tests {
.add_external_transaction(tx.clone().into())
.await
.expect_err("Validation should fail because of missing proof");

assert!(err
.to_string()
.contains("invalid external nullifier period"),);
.contains("Invalid external nullifier period"),);
}

#[tokio::test]
Expand Down Expand Up @@ -532,7 +529,7 @@ pub mod tests {

assert!(err
.to_string()
.contains("invalid external nullifier period"),);
.contains("Invalid external nullifier period"),);
}

#[tokio::test]
Expand Down Expand Up @@ -566,6 +563,6 @@ pub mod tests {
.await
.expect_err("Validation should fail because of missing proof");

assert!(err.to_string().contains("invalid external nullifier nonce"),);
assert!(err.to_string().contains("Invalid external nullifier nonce"),);
}
}

0 comments on commit 0bf2288

Please sign in to comment.