Skip to content

Commit

Permalink
solana: add missing endpoint constraint (#190)
Browse files Browse the repository at this point in the history
Co-authored-by: A5 Pickle <[email protected]>
  • Loading branch information
a5-pickle and a5-pickle authored Aug 9, 2024
1 parent d003059 commit 3e0d3e0
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ use common::wormhole_cctp_solana::cctp::token_messenger_minter_program::{
pub struct UpdateCctpRouterEndpoint<'info> {
admin: OwnerOnly<'info>,

#[account(
constraint = {
require_eq!(
args.chain,
router_endpoint.chain,
crate::error::MatchingEngineError::InvalidEndpoint,
);
true
}
)]
router_endpoint: ExistingMutRouterEndpoint<'info>,

/// CHECK: Seeds must be \["remote_token_messenger"\, remote_domain.to_string()] (CCTP Token
Expand Down

0 comments on commit 3e0d3e0

Please sign in to comment.