Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg committed Jan 9, 2025
1 parent 33dfe23 commit 4de2e3e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions crates/e2e-tests/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ static SEQUENCER_RPC: LazyLock<Url> = LazyLock::new(|| {
});

/// Test account private key
const TEST_PRIVATE_KEY: B256 = b256!("59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d");
const TEST_PRIVATE_KEY: B256 =
b256!("59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d");

/// Default delegation address for testing
const DEFAULT_DELEGATION_ADDRESS: &str = "0x90f79bf6eb2c4f870365e785982e1f101e93b906";
Expand Down Expand Up @@ -70,7 +71,8 @@ async fn test_wallet_api() -> Result<(), Box<dyn std::error::Error>> {
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
Expand All @@ -84,16 +86,13 @@ async fn test_wallet_api() -> Result<(), Box<dyn std::error::Error>> {
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");
Expand Down

0 comments on commit 4de2e3e

Please sign in to comment.