pub enum OffboardForfeitError {
NoInputs,
WrongCount {
vector: &'static str,
expected: usize,
received: usize,
},
MissingConnectorOutput,
InvalidUserPartialSignature(InvalidUserPartialSignatureError),
}Expand description
Something is wrong with what was handed to an OffboardForfeitContext.
Every variant is a condition the counterparty can cause: a server picks how many cosign nonces it sends and what offboard tx it builds, a client picks how many nonces and partial signatures it sends. None of them may panic, because the side rejecting a malformed message would be the side that goes down.
Variants§
NoInputs
There is nothing to forfeit. Every offboard spends at least one VTXO.
WrongCount
A vector holding one entry per input VTXO has a different length.
Fields
MissingConnectorOutput
The offboard tx has no connector output for the forfeits to spend. OffboardForfeitContext::validate_offboard_tx reports this in more detail; it shows up here only if that check was skipped.
InvalidUserPartialSignature(InvalidUserPartialSignatureError)
Implementations§
Source§impl OffboardForfeitError
impl OffboardForfeitError
Sourcepub fn check_count(
vector: &'static str,
expected: usize,
received: usize,
) -> Result<(), OffboardForfeitError>
pub fn check_count( vector: &'static str, expected: usize, received: usize, ) -> Result<(), OffboardForfeitError>
Returns Self::WrongCount unless received is exactly expected.
vector names what was counted, for the error message.
Trait Implementations§
Source§impl Clone for OffboardForfeitError
impl Clone for OffboardForfeitError
Source§fn clone(&self) -> OffboardForfeitError
fn clone(&self) -> OffboardForfeitError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OffboardForfeitError
impl Debug for OffboardForfeitError
Source§impl Display for OffboardForfeitError
impl Display for OffboardForfeitError
impl Eq for OffboardForfeitError
Source§impl Error for OffboardForfeitError
impl Error for OffboardForfeitError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()