diff --git a/sphinx-ffi/Cargo.toml b/sphinx-ffi/Cargo.toml index 0b3f6ee..65ef33d 100644 --- a/sphinx-ffi/Cargo.toml +++ b/sphinx-ffi/Cargo.toml @@ -25,7 +25,7 @@ sphinx-signer = { path = "../signer", default-features = false, features = [ "no-native", ] } sphinx-glyph = { path = "../glyph", default-features = false } -sphinx = { git = "https://github.com/stakwork/sphinx", rev = "b51771ba9a8b5e4742cc8818136410a8f719ba17", features = [ +sphinx = { git = "https://github.com/stakwork/sphinx", rev = "2735386f05f10d8dac3b7db414d3fc6ac4f3b210", features = [ "msg", "bindings", ] } diff --git a/sphinx-ffi/src/auto.rs b/sphinx-ffi/src/auto.rs index b73d7da..5547817 100644 --- a/sphinx-ffi/src/auto.rs +++ b/sphinx-ffi/src/auto.rs @@ -14,6 +14,7 @@ pub struct Msg { pub sent_to: Option, pub from_me: Option, pub payment_hash: Option, + pub error: Option, } pub struct ParsedInvite { @@ -761,6 +762,7 @@ impl From for Msg { sent_to: rr.sent_to, from_me: rr.from_me, payment_hash: rr.payment_hash, + error: rr.error, } } } diff --git a/sphinx-ffi/src/sphinxrs.swift b/sphinx-ffi/src/sphinxrs.swift index dddd279..6f23f93 100644 --- a/sphinx-ffi/src/sphinxrs.swift +++ b/sphinx-ffi/src/sphinxrs.swift @@ -487,10 +487,11 @@ public struct Msg { public var `sentTo`: String? public var `fromMe`: Bool? public var `paymentHash`: String? + public var `error`: String? // Default memberwise initializers are never public by default, so we // declare one manually. - public init(`message`: String?, `type`: UInt8?, `uuid`: String?, `tag`: String?, `index`: String?, `sender`: String?, `msat`: UInt64?, `timestamp`: UInt64?, `sentTo`: String?, `fromMe`: Bool?, `paymentHash`: String?) { + public init(`message`: String?, `type`: UInt8?, `uuid`: String?, `tag`: String?, `index`: String?, `sender`: String?, `msat`: UInt64?, `timestamp`: UInt64?, `sentTo`: String?, `fromMe`: Bool?, `paymentHash`: String?, `error`: String?) { self.`message` = `message` self.`type` = `type` self.`uuid` = `uuid` @@ -502,6 +503,7 @@ public struct Msg { self.`sentTo` = `sentTo` self.`fromMe` = `fromMe` self.`paymentHash` = `paymentHash` + self.`error` = `error` } } @@ -541,6 +543,9 @@ extension Msg: Equatable, Hashable { if lhs.`paymentHash` != rhs.`paymentHash` { return false } + if lhs.`error` != rhs.`error` { + return false + } return true } @@ -556,6 +561,7 @@ extension Msg: Equatable, Hashable { hasher.combine(`sentTo`) hasher.combine(`fromMe`) hasher.combine(`paymentHash`) + hasher.combine(`error`) } } @@ -573,7 +579,8 @@ public struct FfiConverterTypeMsg: FfiConverterRustBuffer { `timestamp`: FfiConverterOptionUInt64.read(from: &buf), `sentTo`: FfiConverterOptionString.read(from: &buf), `fromMe`: FfiConverterOptionBool.read(from: &buf), - `paymentHash`: FfiConverterOptionString.read(from: &buf) + `paymentHash`: FfiConverterOptionString.read(from: &buf), + `error`: FfiConverterOptionString.read(from: &buf) ) } @@ -589,6 +596,7 @@ public struct FfiConverterTypeMsg: FfiConverterRustBuffer { FfiConverterOptionString.write(value.`sentTo`, into: &buf) FfiConverterOptionBool.write(value.`fromMe`, into: &buf) FfiConverterOptionString.write(value.`paymentHash`, into: &buf) + FfiConverterOptionString.write(value.`error`, into: &buf) } } diff --git a/sphinx-ffi/src/sphinxrs.udl b/sphinx-ffi/src/sphinxrs.udl index 69b69e0..c57f872 100644 --- a/sphinx-ffi/src/sphinxrs.udl +++ b/sphinx-ffi/src/sphinxrs.udl @@ -55,6 +55,7 @@ dictionary Msg { string? sent_to; boolean? from_me; string? payment_hash; + string? error; }; dictionary ParsedInvite {