hopper_core/accounts/
validate.rs1use hopper_runtime::error::ProgramError;
7use hopper_runtime::{AccountView, Address};
8
9#[inline]
11pub fn require_signer(account: &AccountView) -> Result<(), ProgramError> {
12 crate::check::check_signer(account)
13}
14
15#[inline]
17pub fn require_writable(account: &AccountView) -> Result<(), ProgramError> {
18 crate::check::check_writable(account)
19}
20
21#[inline]
23pub fn require_owner(account: &AccountView, owner: &Address) -> Result<(), ProgramError> {
24 crate::check::check_owner(account, owner)
25}
26
27#[inline]
29pub fn require_executable(account: &AccountView) -> Result<(), ProgramError> {
30 crate::check::check_executable(account)
31}
32
33#[inline]
35pub fn require_pda(
36 account: &AccountView,
37 seeds: &[&[u8]],
38 bump: u8,
39 program_id: &Address,
40) -> Result<(), ProgramError> {
41 crate::check::verify_pda(account, seeds, bump, program_id)
42}