pub trait ExternalProof<T: ExternalZeroCopy> {
type Proof<'a>;
// Required method
fn verify<'a>(
account: ExternalAccount<'a, T>,
) -> Result<Self::Proof<'a>, ProgramError>;
}Expand description
Adapter-specific proof verifier for known external accounts.
Proof implementations should perform one focused validation step, such as
“this token account has the expected mint” or “this oracle price is fresh”.
The returned proof token can be carried into downstream APIs that should not
accept a merely raw or adapter-checked account. The token proves the bytes
observed when ExternalProof::verify ran; it must not be carried across a
CPI that can mutate the account. Re-run ExternalAccount::checked after
such a CPI. Basic adapter validation is independently repeated by every
subsequent safe data/view/resolve/explain access.
Required Associated Types§
Required Methods§
Sourcefn verify<'a>(
account: ExternalAccount<'a, T>,
) -> Result<Self::Proof<'a>, ProgramError>
fn verify<'a>( account: ExternalAccount<'a, T>, ) -> Result<Self::Proof<'a>, ProgramError>
Verify account and return the proof token.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".