|
1 | 1 | use std::{collections::HashSet, time::Duration}; |
2 | 2 |
|
3 | 3 | use guinea::GuineaInstruction; |
4 | | -use magicblock_core::traits::AccountsBank; |
5 | 4 | use solana_account::{ReadableAccount, WritableAccount}; |
6 | 5 | use solana_keypair::Keypair; |
7 | 6 | use solana_program::{ |
@@ -51,7 +50,7 @@ async fn test_insufficient_fee() { |
51 | 50 | let env = ExecutionTestEnv::new(); |
52 | 51 | let mut payer = env.get_payer(); |
53 | 52 | payer.set_lamports(ExecutionTestEnv::BASE_FEE - 1); |
54 | | - payer.commmit(); |
| 53 | + payer.commit(); |
55 | 54 |
|
56 | 55 | let (ix, _) = |
57 | 56 | setup_guinea_instruction(&env, &GuineaInstruction::PrintSizes, false); |
@@ -105,7 +104,7 @@ async fn test_non_delegated_payer_rejection() { |
105 | 104 | let mut payer = env.get_payer(); |
106 | 105 | payer.set_delegated(false); // Mark the payer as not delegated |
107 | 106 | let fee_payer_initial_balance = payer.lamports(); |
108 | | - payer.commmit(); |
| 107 | + payer.commit(); |
109 | 108 |
|
110 | 109 | let (ix, _) = |
111 | 110 | setup_guinea_instruction(&env, &GuineaInstruction::PrintSizes, false); |
@@ -133,7 +132,7 @@ async fn test_escrowed_payer_success() { |
133 | 132 | payer.set_lamports(ExecutionTestEnv::BASE_FEE - 1); |
134 | 133 | payer.set_delegated(false); |
135 | 134 | let escrow = ephemeral_balance_pda_from_payer(&payer.pubkey); |
136 | | - payer.commmit(); |
| 135 | + payer.commit(); |
137 | 136 |
|
138 | 137 | env.fund_account(escrow, LAMPORTS_PER_SOL); // Fund the escrow PDA |
139 | 138 |
|
@@ -220,7 +219,7 @@ async fn test_escrow_charged_for_failed_transaction() { |
220 | 219 | payer.set_lamports(0); |
221 | 220 | payer.set_delegated(false); |
222 | 221 | let escrow = ephemeral_balance_pda_from_payer(&payer.pubkey); |
223 | | - payer.commmit(); |
| 222 | + payer.commit(); |
224 | 223 | let account = env |
225 | 224 | .create_account_with_config(LAMPORTS_PER_SOL, 0, guinea::ID) // Account with no data |
226 | 225 | .pubkey(); |
@@ -266,7 +265,7 @@ async fn test_transaction_gasless_mode() { |
266 | 265 | payer.set_lamports(1); // Not enough to cover standard fee |
267 | 266 | payer.set_delegated(false); // Explicitly set the payer as NON-delegated. |
268 | 267 | let initial_balance = payer.lamports(); |
269 | | - payer.commmit(); |
| 268 | + payer.commit(); |
270 | 269 |
|
271 | 270 | let ix = Instruction::new_with_bincode( |
272 | 271 | guinea::ID, |
@@ -312,7 +311,7 @@ async fn test_transaction_gasless_mode_with_not_existing_account() { |
312 | 311 | payer.set_lamports(1); // Not enough to cover standard fee |
313 | 312 | payer.set_delegated(false); // Explicitly set the payer as NON-delegated. |
314 | 313 | let initial_balance = payer.lamports(); |
315 | | - payer.commmit(); |
| 314 | + payer.commit(); |
316 | 315 |
|
317 | 316 | let ix = Instruction::new_with_bincode( |
318 | 317 | guinea::ID, |
@@ -351,51 +350,3 @@ async fn test_transaction_gasless_mode_with_not_existing_account() { |
351 | 350 | "payer balance should not change in gasless mode" |
352 | 351 | ); |
353 | 352 | } |
354 | | - |
355 | | -/// Verifies that in zero-fee ("gasless") mode, transactions are processed |
356 | | -/// successfully even when the fee payer does not exists. |
357 | | -#[tokio::test] |
358 | | -async fn test_transaction_gasless_mode_not_existing_feepayer() { |
359 | | - // Initialize the environment with a base fee of 0. |
360 | | - let env = ExecutionTestEnv::new_with_config(0); |
361 | | - let payer = env.get_payer().pubkey; |
362 | | - env.accountsdb.remove_account(&payer); |
363 | | - |
364 | | - // Simple noop instruction that does not touch the fee payer account |
365 | | - let ix = Instruction::new_with_bincode( |
366 | | - guinea::ID, |
367 | | - &GuineaInstruction::PrintSizes, |
368 | | - vec![], |
369 | | - ); |
370 | | - let txn = env.build_transaction(&[ix]); |
371 | | - let signature = txn.signatures[0]; |
372 | | - |
373 | | - // In a normal fee-paying mode, this execution would fail. |
374 | | - env.execute_transaction(txn) |
375 | | - .await |
376 | | - .expect("transaction should succeed in gasless mode"); |
377 | | - |
378 | | - // Verify the transaction was fully processed and broadcast successfully. |
379 | | - let status = env |
380 | | - .dispatch |
381 | | - .transaction_status |
382 | | - .recv_timeout(Duration::from_millis(100)) |
383 | | - .expect("should receive a transaction status update"); |
384 | | - |
385 | | - assert_eq!(status.signature, signature); |
386 | | - assert!( |
387 | | - status.result.result.is_ok(), |
388 | | - "Transaction execution should be successful" |
389 | | - ); |
390 | | - |
391 | | - // Verify that the payer balance is zero (or doesn't exist) |
392 | | - let final_balance = env |
393 | | - .accountsdb |
394 | | - .get_account(&payer) |
395 | | - .unwrap_or_default() |
396 | | - .lamports(); |
397 | | - assert_eq!( |
398 | | - final_balance, 0, |
399 | | - "payer balance of a not existing feepayer should be 0 in gasless mode" |
400 | | - ); |
401 | | -} |
0 commit comments