Skip to main content

require_keys_eq

Macro require_keys_eq 

Source
macro_rules! require_keys_eq {
    ( $left:expr, $right:expr, $err:expr ) => { ... };
    ( $left:expr, $right:expr ) => { ... };
}
Expand description

Assert two public keys (or any byte slices convertible via [AsRef<[u8; 32]>]) are equal. Narrower than require_eq! but matches the ergonomic spelling ecosystem migrators coming from Anchor / Jiminy are familiar with.

hopper::require_keys_eq!(
    vault.authority,
    ctx.signer.address(),
    ProgramError::InvalidAccountData,
);