From d55c2d5a296641fa97e3bf09f1e3a9d474713bb0 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 9 Jan 2025 23:36:18 +0100 Subject: [PATCH] test: fix test constants (#127) These broke in a recent merge, see e.g. CI for #126 --- .github/workflows/integration.yml | 1 + crates/e2e-tests/src/tests.rs | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 86716d0..6d8e1e9 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -38,6 +38,7 @@ jobs: --locked \ --workspace \ -E 'kind(test)' \ + --no-tests=warn \ --no-capture integration-success: diff --git a/crates/e2e-tests/src/tests.rs b/crates/e2e-tests/src/tests.rs index da2a4fd..ced0c80 100644 --- a/crates/e2e-tests/src/tests.rs +++ b/crates/e2e-tests/src/tests.rs @@ -30,7 +30,8 @@ static SEQUENCER_RPC: LazyLock = LazyLock::new(|| { }); /// Test account private key -const TEST_PRIVATE_KEY: &str = "59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"; +const TEST_PRIVATE_KEY: B256 = + b256!("59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"); /// Default delegation address for testing const DEFAULT_DELEGATION_ADDRESS: &str = "0x90f79bf6eb2c4f870365e785982e1f101e93b906"; @@ -43,12 +44,12 @@ async fn assert_chain_advances() -> Result<(), Box> { } let provider = ProviderBuilder::new().on_http(SEQUENCER_RPC.clone()); - + let initial_block = provider.get_block_number().await?; - + // Wait for new block tokio::time::sleep(std::time::Duration::from_secs(5)).await; - + let new_block = provider.get_block_number().await?; assert!( @@ -67,10 +68,11 @@ async fn test_wallet_api() -> Result<(), Box> { } let provider = ProviderBuilder::new().on_http(REPLICA_RPC.clone()); - let signer = PrivateKeySigner::from_bytes(&b256!(TEST_PRIVATE_KEY))?; + let signer = PrivateKeySigner::from_bytes(&TEST_PRIVATE_KEY)?; let delegation_address = Address::from_str( - &std::env::var("DELEGATION_ADDRESS").unwrap_or_else(|_| DEFAULT_DELEGATION_ADDRESS.to_string()), + &std::env::var("DELEGATION_ADDRESS") + .unwrap_or_else(|_| DEFAULT_DELEGATION_ADDRESS.to_string()), )?; // Create and sign authorization @@ -84,16 +86,13 @@ async fn test_wallet_api() -> Result<(), Box> { let auth = auth.into_signed(signature); // Prepare and send transaction - let tx = TransactionRequest::default() - .with_authorization_list(vec![auth]) - .with_to(signer.address()); + let tx = + TransactionRequest::default().with_authorization_list(vec![auth]).with_to(signer.address()); let tx_hash: B256 = provider.client().request("wallet_sendTransaction", vec![tx]).await?; // Wait for and verify transaction receipt - let receipt = PendingTransactionBuilder::new(provider.clone(), tx_hash) - .get_receipt() - .await?; + let receipt = PendingTransactionBuilder::new(provider.clone(), tx_hash).get_receipt().await?; assert!(receipt.status(), "Transaction failed"); assert!(!provider.get_code_at(signer.address()).await?.is_empty(), "No code at signer address"); @@ -150,7 +149,7 @@ async fn test_withdrawal_proof_with_fallback() -> Result<(), Box