|
24 | 24 | }, |
25 | 25 | solana_program::{ |
26 | 26 | clock::Clock, |
27 | | - program::{ |
28 | | - invoke, |
29 | | - invoke_signed, |
30 | | - }, |
| 27 | + program::invoke_signed, |
31 | 28 | program_error::ProgramError, |
32 | 29 | rent::Rent, |
33 | | - system_instruction, |
34 | | - sysvar::Sysvar as SolanaSysvar, |
35 | 30 | }, |
36 | 31 | solitaire::{ |
37 | 32 | trace, |
@@ -368,42 +363,5 @@ pub fn attest(ctx: &ExecutionContext, accs: &mut Attest, data: AttestData) -> So |
368 | 363 | .as_slice(), |
369 | 364 | )?; |
370 | 365 |
|
371 | | - // NOTE: 2022-09-05 |
372 | | - // |
373 | | - // This part is added to avoid rent exemption error that is introduced using |
374 | | - // a wrong implementation in solitaire |
375 | | - // |
376 | | - // This is done after the cross-contract call to get the proper account sizes |
377 | | - // and avoid breaking wormhole call. |
378 | | - // |
379 | | - // It can be removed once wormhole mitigates this problem and upgrades its contract |
380 | | - |
381 | | - // Checking the message account balance |
382 | | - let wh_message_balance = accs.wh_message.info().lamports(); |
383 | | - let wh_message_rent_exempt = Rent::get()?.minimum_balance(accs.wh_message.info().data_len()); |
384 | | - |
385 | | - if wh_message_balance < wh_message_rent_exempt { |
386 | | - let required_deposit = wh_message_rent_exempt - wh_message_balance; |
387 | | - |
388 | | - let transfer_ix = system_instruction::transfer( |
389 | | - accs.payer.key, |
390 | | - accs.wh_message.info().key, |
391 | | - required_deposit, |
392 | | - ); |
393 | | - invoke(&transfer_ix, ctx.accounts)? |
394 | | - } |
395 | | - |
396 | | - // Checking the sequence account balance |
397 | | - let wh_sequence_balance = accs.wh_sequence.info().lamports(); |
398 | | - let wh_sequence_rent_exempt = Rent::get()?.minimum_balance(accs.wh_sequence.data_len()); |
399 | | - |
400 | | - if wh_sequence_balance < wh_sequence_rent_exempt { |
401 | | - let required_deposit = wh_sequence_rent_exempt - wh_sequence_balance; |
402 | | - |
403 | | - let transfer_ix = |
404 | | - system_instruction::transfer(accs.payer.key, accs.wh_sequence.key, required_deposit); |
405 | | - invoke(&transfer_ix, ctx.accounts)? |
406 | | - } |
407 | | - |
408 | 366 | Ok(()) |
409 | 367 | } |
0 commit comments