X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning%2Foffers%2Fparse.rs;fp=lightning-c-bindings%2Fsrc%2Flightning%2Foffers%2Fparse.rs;h=fc84acd63f9f99c3a1edea5b5f817a3d5ff09a92;hp=22ab654a839d28d5e90e9d2f7774cb62a16979fb;hb=5502fccd64611f16f5ebba3759c68b1a4d69b537;hpb=1ec49fac7433e5b8693c3858a3e25998bc888eeb diff --git a/lightning-c-bindings/src/lightning/offers/parse.rs b/lightning-c-bindings/src/lightning/offers/parse.rs index 22ab654..fc84acd 100644 --- a/lightning-c-bindings/src/lightning/offers/parse.rs +++ b/lightning-c-bindings/src/lightning/offers/parse.rs @@ -92,7 +92,7 @@ impl Clone for Bolt12ParseError { #[allow(unused)] /// Used only if an object of this type is returned as a trait impl by a method pub(crate) extern "C" fn Bolt12ParseError_clone_void(this_ptr: *const c_void) -> *mut c_void { - Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt12ParseError)).clone() })) as *mut c_void + Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt12ParseError)).clone() })) as *mut c_void } #[no_mangle] /// Creates a copy of the Bolt12ParseError @@ -146,6 +146,8 @@ pub enum Bolt12SemanticError { MissingPayerMetadata, /// A payer id was expected but was missing. MissingPayerId, + /// The payment id for a refund or request is already in use. + DuplicatePaymentId, /// Blinded paths were expected but were missing. MissingPaths, /// The blinded payinfo given does not match the number of blinded path hops. @@ -185,6 +187,7 @@ impl Bolt12SemanticError { Bolt12SemanticError::UnexpectedMetadata => nativeBolt12SemanticError::UnexpectedMetadata, Bolt12SemanticError::MissingPayerMetadata => nativeBolt12SemanticError::MissingPayerMetadata, Bolt12SemanticError::MissingPayerId => nativeBolt12SemanticError::MissingPayerId, + Bolt12SemanticError::DuplicatePaymentId => nativeBolt12SemanticError::DuplicatePaymentId, Bolt12SemanticError::MissingPaths => nativeBolt12SemanticError::MissingPaths, Bolt12SemanticError::InvalidPayInfo => nativeBolt12SemanticError::InvalidPayInfo, Bolt12SemanticError::MissingCreationTime => nativeBolt12SemanticError::MissingCreationTime, @@ -216,6 +219,7 @@ impl Bolt12SemanticError { Bolt12SemanticError::UnexpectedMetadata => nativeBolt12SemanticError::UnexpectedMetadata, Bolt12SemanticError::MissingPayerMetadata => nativeBolt12SemanticError::MissingPayerMetadata, Bolt12SemanticError::MissingPayerId => nativeBolt12SemanticError::MissingPayerId, + Bolt12SemanticError::DuplicatePaymentId => nativeBolt12SemanticError::DuplicatePaymentId, Bolt12SemanticError::MissingPaths => nativeBolt12SemanticError::MissingPaths, Bolt12SemanticError::InvalidPayInfo => nativeBolt12SemanticError::InvalidPayInfo, Bolt12SemanticError::MissingCreationTime => nativeBolt12SemanticError::MissingCreationTime, @@ -247,6 +251,7 @@ impl Bolt12SemanticError { nativeBolt12SemanticError::UnexpectedMetadata => Bolt12SemanticError::UnexpectedMetadata, nativeBolt12SemanticError::MissingPayerMetadata => Bolt12SemanticError::MissingPayerMetadata, nativeBolt12SemanticError::MissingPayerId => Bolt12SemanticError::MissingPayerId, + nativeBolt12SemanticError::DuplicatePaymentId => Bolt12SemanticError::DuplicatePaymentId, nativeBolt12SemanticError::MissingPaths => Bolt12SemanticError::MissingPaths, nativeBolt12SemanticError::InvalidPayInfo => Bolt12SemanticError::InvalidPayInfo, nativeBolt12SemanticError::MissingCreationTime => Bolt12SemanticError::MissingCreationTime, @@ -278,6 +283,7 @@ impl Bolt12SemanticError { nativeBolt12SemanticError::UnexpectedMetadata => Bolt12SemanticError::UnexpectedMetadata, nativeBolt12SemanticError::MissingPayerMetadata => Bolt12SemanticError::MissingPayerMetadata, nativeBolt12SemanticError::MissingPayerId => Bolt12SemanticError::MissingPayerId, + nativeBolt12SemanticError::DuplicatePaymentId => Bolt12SemanticError::DuplicatePaymentId, nativeBolt12SemanticError::MissingPaths => Bolt12SemanticError::MissingPaths, nativeBolt12SemanticError::InvalidPayInfo => Bolt12SemanticError::InvalidPayInfo, nativeBolt12SemanticError::MissingCreationTime => Bolt12SemanticError::MissingCreationTime, @@ -291,6 +297,16 @@ impl Bolt12SemanticError { pub extern "C" fn Bolt12SemanticError_clone(orig: &Bolt12SemanticError) -> Bolt12SemanticError { orig.clone() } +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn Bolt12SemanticError_clone_void(this_ptr: *const c_void) -> *mut c_void { + Box::into_raw(Box::new(unsafe { (*(this_ptr as *const Bolt12SemanticError)).clone() })) as *mut c_void +} +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +pub(crate) extern "C" fn Bolt12SemanticError_free_void(this_ptr: *mut c_void) { + let _ = unsafe { Box::from_raw(this_ptr as *mut Bolt12SemanticError) }; +} #[no_mangle] /// Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError pub extern "C" fn Bolt12SemanticError_already_expired() -> Bolt12SemanticError { @@ -376,6 +392,10 @@ pub extern "C" fn Bolt12SemanticError_missing_payer_metadata() -> Bolt12Semantic pub extern "C" fn Bolt12SemanticError_missing_payer_id() -> Bolt12SemanticError { Bolt12SemanticError::MissingPayerId} #[no_mangle] +/// Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError +pub extern "C" fn Bolt12SemanticError_duplicate_payment_id() -> Bolt12SemanticError { + Bolt12SemanticError::DuplicatePaymentId} +#[no_mangle] /// Utility method to constructs a new MissingPaths-variant Bolt12SemanticError pub extern "C" fn Bolt12SemanticError_missing_paths() -> Bolt12SemanticError { Bolt12SemanticError::MissingPaths}