pub struct ProgramSafetyAnalyzer { /* private fields */ }Expand description
Program safety analyzer.
Implementations§
Source§impl ProgramSafetyAnalyzer
impl ProgramSafetyAnalyzer
Sourcepub fn from_client(client: RpcClient) -> Self
pub fn from_client(client: RpcClient) -> Self
Create from existing RpcClient.
Sourcepub fn analyze(&self, program_id: &Pubkey) -> Result<ProgramSafetyReport>
pub fn analyze(&self, program_id: &Pubkey) -> Result<ProgramSafetyReport>
Analyze a program for safety.
Sourcepub fn is_safe(&self, program_id: &Pubkey) -> Result<bool>
pub fn is_safe(&self, program_id: &Pubkey) -> Result<bool>
Check if a program is safe to interact with.
Sourcepub fn add_to_blocklist(&mut self, program_id: Pubkey, reason: String)
pub fn add_to_blocklist(&mut self, program_id: Pubkey, reason: String)
Add a program to the blocklist.
Sourcepub fn remove_from_blocklist(&mut self, program_id: &Pubkey)
pub fn remove_from_blocklist(&mut self, program_id: &Pubkey)
Remove a program from the blocklist.
Sourcepub fn add_to_safe_list(&mut self, program_id: Pubkey)
pub fn add_to_safe_list(&mut self, program_id: Pubkey)
Add a program to the known safe list.
Sourcepub fn remove_from_safe_list(&mut self, program_id: &Pubkey)
pub fn remove_from_safe_list(&mut self, program_id: &Pubkey)
Remove a program from the known safe list.
Sourcepub fn is_blocklisted(&self, program_id: &Pubkey) -> bool
pub fn is_blocklisted(&self, program_id: &Pubkey) -> bool
Check if a program is on the blocklist.
Sourcepub fn is_known_safe(&self, program_id: &Pubkey) -> bool
pub fn is_known_safe(&self, program_id: &Pubkey) -> bool
Check if a program is on the known safe list.
Auto Trait Implementations§
impl !Freeze for ProgramSafetyAnalyzer
impl !RefUnwindSafe for ProgramSafetyAnalyzer
impl !UnwindSafe for ProgramSafetyAnalyzer
impl Send for ProgramSafetyAnalyzer
impl Sync for ProgramSafetyAnalyzer
impl Unpin for ProgramSafetyAnalyzer
impl UnsafeUnpin for ProgramSafetyAnalyzer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more