@@ -5,7 +5,6 @@ use anchor_lang::{
55
66use crate :: {
77 error:: ErrorCode ,
8- resize_to_fit:: resize_to_fit,
98 state:: { TaskQueueAuthorityV0 , TaskQueueDataWrapper , TaskV0 , TransactionSourceV0 , TriggerV0 } ,
109} ;
1110
@@ -41,7 +40,7 @@ pub struct QueueTaskV0<'info> {
4140 #[ account(
4241 init,
4342 payer = payer,
44- space = 8 + std:: mem:: size_of:: <TaskV0 >( ) + 60 + args. description. len( ) ,
43+ space = 8 + std:: mem:: size_of:: <TaskV0 >( ) + args . transaction . size ( ) + args. description. len( ) + 60 ,
4544 seeds = [ b"task" . as_ref( ) , task_queue. key( ) . as_ref( ) , & args. id. to_le_bytes( ) [ ..] ] ,
4645 bump,
4746 ) ]
@@ -81,11 +80,10 @@ pub fn handler(ctx: Context<QueueTaskV0>, args: QueueTaskArgsV0) -> Result<()> {
8180 require_gte ! ( crank_reward, task_queue. header( ) . min_crank_reward) ;
8281
8382 let mut transaction = args. transaction ;
84- if let TransactionSourceV0 :: CompiledV0 ( mut compiled_tx) = transaction {
83+ if let TransactionSourceV0 :: CompiledV0 ( ref mut compiled_tx) = transaction {
8584 compiled_tx
8685 . accounts
8786 . extend ( ctx. remaining_accounts . iter ( ) . map ( |a| a. key ( ) ) ) ;
88- transaction = TransactionSourceV0 :: CompiledV0 ( compiled_tx) ;
8987 }
9088 ctx. accounts . task . set_inner ( TaskV0 {
9189 free_tasks : args. free_tasks ,
@@ -106,15 +104,9 @@ pub fn handler(ctx: Context<QueueTaskV0>, args: QueueTaskArgsV0) -> Result<()> {
106104 task_queue. header_mut ( ) . updated_at = Clock :: get ( ) ?. unix_timestamp ;
107105 task_queue. save ( ) ?;
108106
109- // Drop the borrow before calling resize_to_fit
107+ // Drop the borrow
110108 drop ( task_queue_data) ;
111109
112- resize_to_fit (
113- & ctx. accounts . payer . to_account_info ( ) ,
114- & ctx. accounts . system_program . to_account_info ( ) ,
115- & ctx. accounts . task ,
116- ) ?;
117-
118110 let rented_amount = ctx. accounts . task . to_account_info ( ) . lamports ( ) ;
119111 ctx. accounts . task . rent_amount = rented_amount;
120112
0 commit comments