File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
solana/programs/matching-engine/src/fallback/processor Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,8 @@ pub fn close_fast_market_order(accounts: &[AccountInfo]) -> Result<()> {
59
59
msg ! ( "Refund recipient (account #2) is not a signer" ) ;
60
60
return Err ( ProgramError :: InvalidAccountData . into ( ) ) ;
61
61
}
62
- let fast_market_order_deserialized =
63
- FastMarketOrder :: try_deserialize ( & mut & fast_market_order . data . borrow ( ) [ .. ] ) ?;
62
+ let fast_market_order_data = & fast_market_order . data . borrow ( ) [ .. ] ;
63
+ let fast_market_order_deserialized = FastMarketOrder :: try_read ( fast_market_order_data ) ?;
64
64
// Check that the fast_market_order is owned by the close_account_refund_recipient
65
65
if fast_market_order_deserialized. close_account_refund_recipient
66
66
!= close_account_refund_recipient. key ( ) . as_ref ( )
@@ -75,15 +75,13 @@ pub fn close_fast_market_order(accounts: &[AccountInfo]) -> Result<()> {
75
75
) ;
76
76
}
77
77
78
- let fast_market_order_data =
79
- FastMarketOrder :: try_deserialize ( & mut & fast_market_order. data . borrow ( ) [ ..] ) ?;
80
- if fast_market_order_data. close_account_refund_recipient
78
+ if fast_market_order_deserialized. close_account_refund_recipient
81
79
!= close_account_refund_recipient. key ( ) . as_ref ( )
82
80
{
83
81
return Err ( MatchingEngineError :: MismatchingCloseAccountRefundRecipient . into ( ) ) . map_err (
84
82
|e : Error | {
85
83
e. with_pubkeys ( (
86
- Pubkey :: from ( fast_market_order_data . close_account_refund_recipient ) ,
84
+ Pubkey :: from ( fast_market_order_deserialized . close_account_refund_recipient ) ,
87
85
close_account_refund_recipient. key ( ) ,
88
86
) )
89
87
} ,
You can’t perform that action at this time.
0 commit comments