@@ -115,21 +115,21 @@ impl InterceptorCranker {
115115
116116 info ! (
117117 "Receipt {} raw bytes:\n \
118- Interpreted values:\n \
119- deposit_time: {}\n \
120- cool_down: {}\n \
121- current_time: {}",
118+ Interpreted values:\n \
119+ deposit_time: {}\n \
120+ cool_down: {}\n \
121+ current_time: {}",
122122 receipt. base, deposit_time, cool_down, now
123123 ) ;
124124 emit_deposit_receipt ( & receipt, & self . cluster_name ) ;
125125
126126 if deposit_time > now {
127127 info ! (
128- "Receipt {} not yet expired (future deposit time). Current time: {}, Deposit time: {}" ,
129- receipt. base,
130- now,
131- deposit_time
132- ) ;
128+ "Receipt {} not yet expired (future deposit time). Current time: {}, Deposit time: {}" ,
129+ receipt. base,
130+ now,
131+ deposit_time
132+ ) ;
133133 future_deposits += 1 ;
134134 continue ;
135135 }
@@ -171,11 +171,11 @@ impl InterceptorCranker {
171171 }
172172 None => {
173173 emit_error ( format ! (
174- "Receipt {} has invalid timing values - would overflow. Deposit time: {}, Cool down: {}" ,
175- receipt. base,
176- deposit_time,
177- cool_down
178- ) , & self . cluster_name ) ;
174+ "Receipt {} has invalid timing values - would overflow. Deposit time: {}, Cool down: {}" ,
175+ receipt. base,
176+ deposit_time,
177+ cool_down
178+ ) , & self . cluster_name ) ;
179179 }
180180 }
181181 }
@@ -263,6 +263,35 @@ impl InterceptorCranker {
263263 let owner_ata =
264264 get_associated_token_address ( & receipt. owner , & stake_pool_deposit_authority. pool_mint ) ;
265265
266+ // Check if account exists
267+ match self . rpc_client . get_account ( & owner_ata) . await {
268+ Ok ( _) => {
269+ info ! ( "Owner token account exists: {owner_ata}" ) ;
270+ }
271+ Err ( _) => {
272+ info ! ( "Creating owner token account: {owner_ata}" ) ;
273+ let create_ata_ix = create_associated_token_account (
274+ & self . payer . pubkey ( ) ,
275+ & receipt. owner ,
276+ & stake_pool_deposit_authority. pool_mint ,
277+ & spl_token:: id ( ) ,
278+ ) ;
279+
280+ let recent_blockhash = self . rpc_client . get_latest_blockhash ( ) . await ?;
281+ let create_ata_tx = Transaction :: new_signed_with_payer (
282+ & [ create_ata_ix] ,
283+ Some ( & self . payer . pubkey ( ) ) ,
284+ & [ self . payer . as_ref ( ) ] ,
285+ recent_blockhash,
286+ ) ;
287+
288+ self . rpc_client
289+ . send_and_confirm_transaction ( & create_ata_tx)
290+ . await ?;
291+ info ! ( "Created owner ata token account" ) ;
292+ }
293+ }
294+
266295 let fee_wallet_token_account = get_associated_token_address (
267296 & stake_pool_deposit_authority. fee_wallet ,
268297 & stake_pool_deposit_authority. pool_mint ,
0 commit comments