Skip to content

Commit

Permalink
bump sphinx, private tribes, bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanfeenstra committed Feb 6, 2024
1 parent 5a94bf9 commit d6fb5e7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 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 = "c300c753f5ee9f5381b0246b8df5f78b7241d460", features = [
sphinx = { git = "https://github.com/stakwork/sphinx", rev = "60cff7f2e408d384e690ecff948a04573cb6409e", features = [
"msg",
"bindings",
] }
Expand Down
2 changes: 2 additions & 0 deletions sphinx-ffi/src/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ pub fn join_tribe(
tribe_route_hint: String,
alias: String,
amt_msat: u64,
is_private: bool,
) -> Result<RunReturn> {
Ok(bindings::join_tribe(
&seed,
Expand All @@ -296,6 +297,7 @@ pub fn join_tribe(
&tribe_route_hint,
&alias,
amt_msat,
is_private,
)
.map_err(|e| SphinxError::HandleFailed { r: e.to_string() })?
.into())
Expand Down
7 changes: 4 additions & 3 deletions sphinx-ffi/src/sphinxrs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ public func `createTribe`(`seed`: String, `uniqueTime`: String, `state`: Data, `
)
}

public func `joinTribe`(`seed`: String, `uniqueTime`: String, `state`: Data, `tribePubkey`: String, `tribeRouteHint`: String, `alias`: String, `amtMsat`: UInt64) throws -> RunReturn {
public func `joinTribe`(`seed`: String, `uniqueTime`: String, `state`: Data, `tribePubkey`: String, `tribeRouteHint`: String, `alias`: String, `amtMsat`: UInt64, `isPrivate`: Bool) throws -> RunReturn {
return try FfiConverterTypeRunReturn.lift(
try rustCallWithError(FfiConverterTypeSphinxError.lift) {
uniffi_sphinxrs_fn_func_join_tribe(
Expand All @@ -1734,7 +1734,8 @@ public func `joinTribe`(`seed`: String, `uniqueTime`: String, `state`: Data, `tr
FfiConverterString.lower(`tribePubkey`),
FfiConverterString.lower(`tribeRouteHint`),
FfiConverterString.lower(`alias`),
FfiConverterUInt64.lower(`amtMsat`),$0)
FfiConverterUInt64.lower(`amtMsat`),
FfiConverterBool.lower(`isPrivate`),$0)
}
)
}
Expand Down Expand Up @@ -1918,7 +1919,7 @@ private var initializationResult: InitializationResult {
if (uniffi_sphinxrs_checksum_func_create_tribe() != 28873) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_sphinxrs_checksum_func_join_tribe() != 63841) {
if (uniffi_sphinxrs_checksum_func_join_tribe() != 6857) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_sphinxrs_checksum_func_list_tribe_members() != 48922) {
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 @@ -156,7 +156,7 @@ namespace sphinxrs {
[Throws=SphinxError]
RunReturn create_tribe(string seed, string unique_time, bytes state, string tribe_server_pubkey, string tribe_json);
[Throws=SphinxError]
RunReturn join_tribe(string seed, string unique_time, bytes state, string tribe_pubkey, string tribe_route_hint, string alias, u64 amt_msat);
RunReturn join_tribe(string seed, string unique_time, bytes state, string tribe_pubkey, string tribe_route_hint, string alias, u64 amt_msat, boolean is_private);
[Throws=SphinxError]
RunReturn list_tribe_members(string seed, string unique_time, bytes state, string tribe_server_pubkey, string tribe_pubkey);
[Throws=SphinxError]
Expand Down
2 changes: 1 addition & 1 deletion sphinx-ffi/src/sphinxrsFFI.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ RustBuffer uniffi_sphinxrs_fn_func_make_invoice(RustBuffer seed, RustBuffer uniq
);
RustBuffer uniffi_sphinxrs_fn_func_create_tribe(RustBuffer seed, RustBuffer unique_time, RustBuffer state, RustBuffer tribe_server_pubkey, RustBuffer tribe_json, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_sphinxrs_fn_func_join_tribe(RustBuffer seed, RustBuffer unique_time, RustBuffer state, RustBuffer tribe_pubkey, RustBuffer tribe_route_hint, RustBuffer alias, uint64_t amt_msat, RustCallStatus *_Nonnull out_status
RustBuffer uniffi_sphinxrs_fn_func_join_tribe(RustBuffer seed, RustBuffer unique_time, RustBuffer state, RustBuffer tribe_pubkey, RustBuffer tribe_route_hint, RustBuffer alias, uint64_t amt_msat, int8_t is_private, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_sphinxrs_fn_func_list_tribe_members(RustBuffer seed, RustBuffer unique_time, RustBuffer state, RustBuffer tribe_server_pubkey, RustBuffer tribe_pubkey, RustCallStatus *_Nonnull out_status
);
Expand Down
8 changes: 4 additions & 4 deletions sphinx-ffi/src/uniffi/sphinxrs/sphinxrs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ internal interface _UniFFILib : Library {
): RustBuffer.ByValue
fun uniffi_sphinxrs_fn_func_create_tribe(`seed`: RustBuffer.ByValue,`uniqueTime`: RustBuffer.ByValue,`state`: RustBuffer.ByValue,`tribeServerPubkey`: RustBuffer.ByValue,`tribeJson`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
fun uniffi_sphinxrs_fn_func_join_tribe(`seed`: RustBuffer.ByValue,`uniqueTime`: RustBuffer.ByValue,`state`: RustBuffer.ByValue,`tribePubkey`: RustBuffer.ByValue,`tribeRouteHint`: RustBuffer.ByValue,`alias`: RustBuffer.ByValue,`amtMsat`: Long,_uniffi_out_err: RustCallStatus,
fun uniffi_sphinxrs_fn_func_join_tribe(`seed`: RustBuffer.ByValue,`uniqueTime`: RustBuffer.ByValue,`state`: RustBuffer.ByValue,`tribePubkey`: RustBuffer.ByValue,`tribeRouteHint`: RustBuffer.ByValue,`alias`: RustBuffer.ByValue,`amtMsat`: Long,`isPrivate`: Byte,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
fun uniffi_sphinxrs_fn_func_list_tribe_members(`seed`: RustBuffer.ByValue,`uniqueTime`: RustBuffer.ByValue,`state`: RustBuffer.ByValue,`tribeServerPubkey`: RustBuffer.ByValue,`tribePubkey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
Expand Down Expand Up @@ -699,7 +699,7 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
if (lib.uniffi_sphinxrs_checksum_func_create_tribe() != 28873.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_sphinxrs_checksum_func_join_tribe() != 63841.toShort()) {
if (lib.uniffi_sphinxrs_checksum_func_join_tribe() != 6857.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_sphinxrs_checksum_func_list_tribe_members() != 48922.toShort()) {
Expand Down Expand Up @@ -2201,10 +2201,10 @@ fun `createTribe`(`seed`: String, `uniqueTime`: String, `state`: ByteArray, `tri

@Throws(SphinxException::class)

fun `joinTribe`(`seed`: String, `uniqueTime`: String, `state`: ByteArray, `tribePubkey`: String, `tribeRouteHint`: String, `alias`: String, `amtMsat`: ULong): RunReturn {
fun `joinTribe`(`seed`: String, `uniqueTime`: String, `state`: ByteArray, `tribePubkey`: String, `tribeRouteHint`: String, `alias`: String, `amtMsat`: ULong, `isPrivate`: Boolean): RunReturn {
return FfiConverterTypeRunReturn.lift(
rustCallWithError(SphinxException) { _status ->
_UniFFILib.INSTANCE.uniffi_sphinxrs_fn_func_join_tribe(FfiConverterString.lower(`seed`),FfiConverterString.lower(`uniqueTime`),FfiConverterByteArray.lower(`state`),FfiConverterString.lower(`tribePubkey`),FfiConverterString.lower(`tribeRouteHint`),FfiConverterString.lower(`alias`),FfiConverterULong.lower(`amtMsat`),_status)
_UniFFILib.INSTANCE.uniffi_sphinxrs_fn_func_join_tribe(FfiConverterString.lower(`seed`),FfiConverterString.lower(`uniqueTime`),FfiConverterByteArray.lower(`state`),FfiConverterString.lower(`tribePubkey`),FfiConverterString.lower(`tribeRouteHint`),FfiConverterString.lower(`alias`),FfiConverterULong.lower(`amtMsat`),FfiConverterBoolean.lower(`isPrivate`),_status)
})
}

Expand Down

0 comments on commit d6fb5e7

Please sign in to comment.