pub trait ChainView {
// Required method
fn get_prevout(&self, outpoint: OutPoint) -> Result<TxOut, ChainViewError>;
}Expand description
Read-only view resolving an outpoint’s committed (value, script_pubkey)
for #502 prevout validation.
Implementations MUST return the exact (value_sats, script_pubkey) the
outpoint’s transaction commits to, so a responder can compare it against
the PSBT’s proposer-supplied witness_utxo. Amounts and scripts are
committed to the txid, so this is authoritative for the amount check.
It does NOT prove the outpoint is unspent or confirmed. Returning a
stale or approximate value defeats the check.
Required Methods§
Sourcefn get_prevout(&self, outpoint: OutPoint) -> Result<TxOut, ChainViewError>
fn get_prevout(&self, outpoint: OutPoint) -> Result<TxOut, ChainViewError>
Fetch the committed (value, script_pubkey) of outpoint. Returns
ChainViewError::NotFound when the transaction or output does not
exist on the chain view’s backing endpoint (itself refusal-worthy:
the responder cannot run the amount check without an authoritative
prevout). The returned amount is authoritative because it is
committed to the txid; this does not attest that the output is
unspent.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".