From d81c6802ffe213312f0814304d38dfbfdcbae887 Mon Sep 17 00:00:00 2001 From: A5 Pickle Date: Fri, 16 Aug 2024 08:08:20 -0500 Subject: [PATCH] solana: add missing constraint --- .../programs/matching-engine/src/composite/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/solana/programs/matching-engine/src/composite/mod.rs b/solana/programs/matching-engine/src/composite/mod.rs index 9a62b0f0..a57fbfc4 100644 --- a/solana/programs/matching-engine/src/composite/mod.rs +++ b/solana/programs/matching-engine/src/composite/mod.rs @@ -567,6 +567,20 @@ pub struct ReserveFastFillSequence<'info> { #[account(mut)] pub payer: Signer<'info>, + #[account( + constraint = { + // Destination endpoint must be for Solana. + require!( + matches!( + fast_order_path.to_endpoint.protocol, + MessageProtocol::Local { .. } + ), + MatchingEngineError::InvalidTargetRouter + ); + + true + }, + )] pub fast_order_path: FastOrderPath<'info>, /// This sequencer determines the next reserved sequence. If it does not exist for a given