Skip to content

Commit

Permalink
sent to as part of msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanfeenstra committed Feb 12, 2024
1 parent 5793a77 commit 02d52dd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion sphinx-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "f38edff78a1fe6f6a89019ac6134f3a4f1bd790a", features = [
sphinx = { git = "https://github.com/stakwork/sphinx", rev = "705c55dc7e15acaa9350012d08a94677d47c6320", features = [
"msg",
"bindings",
] }
Expand Down
4 changes: 2 additions & 2 deletions sphinx-ffi/src/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub struct Msg {
pub index: Option<String>,
pub msat: Option<u64>,
pub timestamp: Option<u64>,
pub sent_to: Option<String>,
}

pub struct RunReturn {
Expand All @@ -24,7 +25,6 @@ pub struct RunReturn {
pub new_balance: Option<u64>,
pub my_contact_info: Option<String>,
pub sent_status: Option<String>,
pub sent_to: Option<String>,
pub settled_status: Option<String>,
pub error: Option<String>,
pub new_tribe: Option<String>,
Expand Down Expand Up @@ -372,6 +372,7 @@ impl From<bindings::Msg> for Msg {
index: rr.index,
msat: rr.msat,
timestamp: rr.timestamp,
sent_to: rr.sent_to,
}
}
}
Expand All @@ -390,7 +391,6 @@ impl From<bindings::RunReturn> for RunReturn {
new_balance: rr.new_balance,
my_contact_info: rr.my_contact_info,
sent_status: rr.sent_status,
sent_to: rr.sent_to,
settled_status: rr.settled_status,
error: rr.error,
new_tribe: rr.new_tribe,
Expand Down
22 changes: 11 additions & 11 deletions sphinx-ffi/src/sphinxrs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -483,17 +483,19 @@ public struct Msg {
public var `sender`: String?
public var `msat`: UInt64?
public var `timestamp`: UInt64?
public var `sentTo`: String?

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(`message`: String?, `type`: UInt8?, `uuid`: String?, `index`: String?, `sender`: String?, `msat`: UInt64?, `timestamp`: UInt64?) {
public init(`message`: String?, `type`: UInt8?, `uuid`: String?, `index`: String?, `sender`: String?, `msat`: UInt64?, `timestamp`: UInt64?, `sentTo`: String?) {
self.`message` = `message`
self.`type` = `type`
self.`uuid` = `uuid`
self.`index` = `index`
self.`sender` = `sender`
self.`msat` = `msat`
self.`timestamp` = `timestamp`
self.`sentTo` = `sentTo`
}
}

Expand Down Expand Up @@ -521,6 +523,9 @@ extension Msg: Equatable, Hashable {
if lhs.`timestamp` != rhs.`timestamp` {
return false
}
if lhs.`sentTo` != rhs.`sentTo` {
return false
}
return true
}

Expand All @@ -532,6 +537,7 @@ extension Msg: Equatable, Hashable {
hasher.combine(`sender`)
hasher.combine(`msat`)
hasher.combine(`timestamp`)
hasher.combine(`sentTo`)
}
}

Expand All @@ -545,7 +551,8 @@ public struct FfiConverterTypeMsg: FfiConverterRustBuffer {
`index`: FfiConverterOptionString.read(from: &buf),
`sender`: FfiConverterOptionString.read(from: &buf),
`msat`: FfiConverterOptionUInt64.read(from: &buf),
`timestamp`: FfiConverterOptionUInt64.read(from: &buf)
`timestamp`: FfiConverterOptionUInt64.read(from: &buf),
`sentTo`: FfiConverterOptionString.read(from: &buf)
)
}

Expand All @@ -557,6 +564,7 @@ public struct FfiConverterTypeMsg: FfiConverterRustBuffer {
FfiConverterOptionString.write(value.`sender`, into: &buf)
FfiConverterOptionUInt64.write(value.`msat`, into: &buf)
FfiConverterOptionUInt64.write(value.`timestamp`, into: &buf)
FfiConverterOptionString.write(value.`sentTo`, into: &buf)
}
}

Expand All @@ -582,7 +590,6 @@ public struct RunReturn {
public var `newBalance`: UInt64?
public var `myContactInfo`: String?
public var `sentStatus`: String?
public var `sentTo`: String?
public var `settledStatus`: String?
public var `error`: String?
public var `newTribe`: String?
Expand All @@ -593,7 +600,7 @@ public struct RunReturn {

// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(`msgs`: [Msg], `topic0`: String?, `payload0`: Data?, `topic1`: String?, `payload1`: Data?, `topic2`: String?, `payload2`: Data?, `stateMp`: Data?, `newBalance`: UInt64?, `myContactInfo`: String?, `sentStatus`: String?, `sentTo`: String?, `settledStatus`: String?, `error`: String?, `newTribe`: String?, `tribeMembers`: String?, `newInvite`: String?, `inviterContactInfo`: String?, `lspHost`: String?) {
public init(`msgs`: [Msg], `topic0`: String?, `payload0`: Data?, `topic1`: String?, `payload1`: Data?, `topic2`: String?, `payload2`: Data?, `stateMp`: Data?, `newBalance`: UInt64?, `myContactInfo`: String?, `sentStatus`: String?, `settledStatus`: String?, `error`: String?, `newTribe`: String?, `tribeMembers`: String?, `newInvite`: String?, `inviterContactInfo`: String?, `lspHost`: String?) {
self.`msgs` = `msgs`
self.`topic0` = `topic0`
self.`payload0` = `payload0`
Expand All @@ -605,7 +612,6 @@ public struct RunReturn {
self.`newBalance` = `newBalance`
self.`myContactInfo` = `myContactInfo`
self.`sentStatus` = `sentStatus`
self.`sentTo` = `sentTo`
self.`settledStatus` = `settledStatus`
self.`error` = `error`
self.`newTribe` = `newTribe`
Expand Down Expand Up @@ -652,9 +658,6 @@ extension RunReturn: Equatable, Hashable {
if lhs.`sentStatus` != rhs.`sentStatus` {
return false
}
if lhs.`sentTo` != rhs.`sentTo` {
return false
}
if lhs.`settledStatus` != rhs.`settledStatus` {
return false
}
Expand Down Expand Up @@ -691,7 +694,6 @@ extension RunReturn: Equatable, Hashable {
hasher.combine(`newBalance`)
hasher.combine(`myContactInfo`)
hasher.combine(`sentStatus`)
hasher.combine(`sentTo`)
hasher.combine(`settledStatus`)
hasher.combine(`error`)
hasher.combine(`newTribe`)
Expand All @@ -717,7 +719,6 @@ public struct FfiConverterTypeRunReturn: FfiConverterRustBuffer {
`newBalance`: FfiConverterOptionUInt64.read(from: &buf),
`myContactInfo`: FfiConverterOptionString.read(from: &buf),
`sentStatus`: FfiConverterOptionString.read(from: &buf),
`sentTo`: FfiConverterOptionString.read(from: &buf),
`settledStatus`: FfiConverterOptionString.read(from: &buf),
`error`: FfiConverterOptionString.read(from: &buf),
`newTribe`: FfiConverterOptionString.read(from: &buf),
Expand All @@ -740,7 +741,6 @@ public struct FfiConverterTypeRunReturn: FfiConverterRustBuffer {
FfiConverterOptionUInt64.write(value.`newBalance`, into: &buf)
FfiConverterOptionString.write(value.`myContactInfo`, into: &buf)
FfiConverterOptionString.write(value.`sentStatus`, into: &buf)
FfiConverterOptionString.write(value.`sentTo`, into: &buf)
FfiConverterOptionString.write(value.`settledStatus`, into: &buf)
FfiConverterOptionString.write(value.`error`, into: &buf)
FfiConverterOptionString.write(value.`newTribe`, into: &buf)
Expand Down
2 changes: 1 addition & 1 deletion sphinx-ffi/src/sphinxrs.udl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dictionary Msg {
string? sender;
u64? msat;
u64? timestamp;
string? sent_to;
};

dictionary RunReturn {
Expand All @@ -64,7 +65,6 @@ dictionary RunReturn {
u64? new_balance;
string? my_contact_info;
string? sent_status;
string? sent_to;
string? settled_status;
string? error;
string? new_tribe;
Expand Down
12 changes: 6 additions & 6 deletions sphinx-ffi/src/uniffi/sphinxrs/sphinxrs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,8 @@ data class Msg (
var `index`: String?,
var `sender`: String?,
var `msat`: ULong?,
var `timestamp`: ULong?
var `timestamp`: ULong?,
var `sentTo`: String?
) {

}
Expand All @@ -939,6 +940,7 @@ public object FfiConverterTypeMsg: FfiConverterRustBuffer<Msg> {
FfiConverterOptionalString.read(buf),
FfiConverterOptionalULong.read(buf),
FfiConverterOptionalULong.read(buf),
FfiConverterOptionalString.read(buf),
)
}

Expand All @@ -949,7 +951,8 @@ public object FfiConverterTypeMsg: FfiConverterRustBuffer<Msg> {
FfiConverterOptionalString.allocationSize(value.`index`) +
FfiConverterOptionalString.allocationSize(value.`sender`) +
FfiConverterOptionalULong.allocationSize(value.`msat`) +
FfiConverterOptionalULong.allocationSize(value.`timestamp`)
FfiConverterOptionalULong.allocationSize(value.`timestamp`) +
FfiConverterOptionalString.allocationSize(value.`sentTo`)
)

override fun write(value: Msg, buf: ByteBuffer) {
Expand All @@ -960,6 +963,7 @@ public object FfiConverterTypeMsg: FfiConverterRustBuffer<Msg> {
FfiConverterOptionalString.write(value.`sender`, buf)
FfiConverterOptionalULong.write(value.`msat`, buf)
FfiConverterOptionalULong.write(value.`timestamp`, buf)
FfiConverterOptionalString.write(value.`sentTo`, buf)
}
}

Expand All @@ -978,7 +982,6 @@ data class RunReturn (
var `newBalance`: ULong?,
var `myContactInfo`: String?,
var `sentStatus`: String?,
var `sentTo`: String?,
var `settledStatus`: String?,
var `error`: String?,
var `newTribe`: String?,
Expand Down Expand Up @@ -1011,7 +1014,6 @@ public object FfiConverterTypeRunReturn: FfiConverterRustBuffer<RunReturn> {
FfiConverterOptionalString.read(buf),
FfiConverterOptionalString.read(buf),
FfiConverterOptionalString.read(buf),
FfiConverterOptionalString.read(buf),
)
}

Expand All @@ -1027,7 +1029,6 @@ public object FfiConverterTypeRunReturn: FfiConverterRustBuffer<RunReturn> {
FfiConverterOptionalULong.allocationSize(value.`newBalance`) +
FfiConverterOptionalString.allocationSize(value.`myContactInfo`) +
FfiConverterOptionalString.allocationSize(value.`sentStatus`) +
FfiConverterOptionalString.allocationSize(value.`sentTo`) +
FfiConverterOptionalString.allocationSize(value.`settledStatus`) +
FfiConverterOptionalString.allocationSize(value.`error`) +
FfiConverterOptionalString.allocationSize(value.`newTribe`) +
Expand All @@ -1049,7 +1050,6 @@ public object FfiConverterTypeRunReturn: FfiConverterRustBuffer<RunReturn> {
FfiConverterOptionalULong.write(value.`newBalance`, buf)
FfiConverterOptionalString.write(value.`myContactInfo`, buf)
FfiConverterOptionalString.write(value.`sentStatus`, buf)
FfiConverterOptionalString.write(value.`sentTo`, buf)
FfiConverterOptionalString.write(value.`settledStatus`, buf)
FfiConverterOptionalString.write(value.`error`, buf)
FfiConverterOptionalString.write(value.`newTribe`, buf)
Expand Down

0 comments on commit 02d52dd

Please sign in to comment.