Skip to content

Commit

Permalink
bump sphinx rhash in inner msg, drop bad enc child key binding
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanfeenstra committed Aug 20, 2024
1 parent c9b11eb commit 43504ed
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 55 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 = "d8c490d241b37ab0c47e725f9dae5d2e92f0ccfa", features = [
sphinx = { git = "https://github.com/stakwork/sphinx", rev = "768a010bc4e7e5807dd679819faf39c94f7eeab6", features = [
"msg",
"bindings",
"macaroon",
Expand Down
16 changes: 0 additions & 16 deletions sphinx-ffi/src/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,22 +801,6 @@ pub fn signed_timestamp(seed: String, idx: u64, time: String, network: String) -
.into())
}

pub fn contact_for_encrypted_child_key(
seed: String,
unique_time: String,
full_state: Vec<u8>,
encrypted_child_idx: String,
) -> Result<String> {
Ok(bindings::contact_for_encrypted_child_key(
&seed,
&unique_time,
&full_state,
&encrypted_child_idx,
)
.map_err(|e| SphinxError::SendFailed { r: e.to_string() })?
.into())
}

pub fn find_route(
full_state: Vec<u8>,
to_pubkey: String,
Expand Down
15 changes: 0 additions & 15 deletions sphinx-ffi/src/sphinxrs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2642,18 +2642,6 @@ public func `idFromMacaroon`(`macaroon`: String) throws -> String {
)
}

public func `contactForEncryptedChildKey`(`seed`: String, `uniqueTime`: String, `state`: Data, `encryptedChildKey`: String) throws -> String {
return try FfiConverterString.lift(
try rustCallWithError(FfiConverterTypeSphinxError.lift) {
uniffi_sphinxrs_fn_func_contact_for_encrypted_child_key(
FfiConverterString.lower(`seed`),
FfiConverterString.lower(`uniqueTime`),
FfiConverterData.lower(`state`),
FfiConverterString.lower(`encryptedChildKey`),$0)
}
)
}

public func `findRoute`(`state`: Data, `toPubkey`: String, `routeHint`: String?, `amtMsat`: UInt64) throws -> String {
return try FfiConverterString.lift(
try rustCallWithError(FfiConverterTypeSphinxError.lift) {
Expand Down Expand Up @@ -2921,9 +2909,6 @@ private var initializationResult: InitializationResult {
if (uniffi_sphinxrs_checksum_func_id_from_macaroon() != 36424) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_sphinxrs_checksum_func_contact_for_encrypted_child_key() != 36351) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_sphinxrs_checksum_func_find_route() != 27285) {
return InitializationResult.apiChecksumMismatch
}
Expand Down
2 changes: 0 additions & 2 deletions sphinx-ffi/src/sphinxrs.udl
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,5 @@ namespace sphinxrs {
[Throws=SphinxError]
string id_from_macaroon(string macaroon);
[Throws=SphinxError]
string contact_for_encrypted_child_key(string seed, string unique_time, bytes state, string encrypted_child_key);
[Throws=SphinxError]
string find_route(bytes state, string to_pubkey, string? route_hint, u64 amt_msat);
};
5 changes: 0 additions & 5 deletions sphinx-ffi/src/sphinxrsFFI.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@ RustBuffer uniffi_sphinxrs_fn_func_fetch_pings(RustBuffer seed, RustBuffer uniqu
);
RustBuffer uniffi_sphinxrs_fn_func_id_from_macaroon(RustBuffer macaroon, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_sphinxrs_fn_func_contact_for_encrypted_child_key(RustBuffer seed, RustBuffer unique_time, RustBuffer state, RustBuffer encrypted_child_key, RustCallStatus *_Nonnull out_status
);
RustBuffer uniffi_sphinxrs_fn_func_find_route(RustBuffer state, RustBuffer to_pubkey, RustBuffer route_hint, uint64_t amt_msat, RustCallStatus *_Nonnull out_status
);
RustBuffer ffi_sphinxrs_rustbuffer_alloc(int32_t size, RustCallStatus *_Nonnull out_status
Expand Down Expand Up @@ -474,9 +472,6 @@ uint16_t uniffi_sphinxrs_checksum_func_fetch_pings(void
);
uint16_t uniffi_sphinxrs_checksum_func_id_from_macaroon(void

);
uint16_t uniffi_sphinxrs_checksum_func_contact_for_encrypted_child_key(void

);
uint16_t uniffi_sphinxrs_checksum_func_find_route(void

Expand Down
16 changes: 0 additions & 16 deletions sphinx-ffi/src/uniffi/sphinxrs/sphinxrs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,6 @@ internal interface _UniFFILib : Library {
): RustBuffer.ByValue
fun uniffi_sphinxrs_fn_func_id_from_macaroon(`macaroon`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
fun uniffi_sphinxrs_fn_func_contact_for_encrypted_child_key(`seed`: RustBuffer.ByValue,`uniqueTime`: RustBuffer.ByValue,`state`: RustBuffer.ByValue,`encryptedChildKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
fun uniffi_sphinxrs_fn_func_find_route(`state`: RustBuffer.ByValue,`toPubkey`: RustBuffer.ByValue,`routeHint`: RustBuffer.ByValue,`amtMsat`: Long,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
fun ffi_sphinxrs_rustbuffer_alloc(`size`: Int,_uniffi_out_err: RustCallStatus,
Expand Down Expand Up @@ -696,8 +694,6 @@ internal interface _UniFFILib : Library {
): Short
fun uniffi_sphinxrs_checksum_func_id_from_macaroon(
): Short
fun uniffi_sphinxrs_checksum_func_contact_for_encrypted_child_key(
): Short
fun uniffi_sphinxrs_checksum_func_find_route(
): Short
fun ffi_sphinxrs_uniffi_contract_version(
Expand Down Expand Up @@ -957,9 +953,6 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
if (lib.uniffi_sphinxrs_checksum_func_id_from_macaroon() != 36424.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_sphinxrs_checksum_func_contact_for_encrypted_child_key() != 36351.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_sphinxrs_checksum_func_find_route() != 27285.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -3135,15 +3128,6 @@ fun `idFromMacaroon`(`macaroon`: String): String {

@Throws(SphinxException::class)

fun `contactForEncryptedChildKey`(`seed`: String, `uniqueTime`: String, `state`: ByteArray, `encryptedChildKey`: String): String {
return FfiConverterString.lift(
rustCallWithError(SphinxException) { _status ->
_UniFFILib.INSTANCE.uniffi_sphinxrs_fn_func_contact_for_encrypted_child_key(FfiConverterString.lower(`seed`),FfiConverterString.lower(`uniqueTime`),FfiConverterByteArray.lower(`state`),FfiConverterString.lower(`encryptedChildKey`),_status)
})
}

@Throws(SphinxException::class)

fun `findRoute`(`state`: ByteArray, `toPubkey`: String, `routeHint`: String?, `amtMsat`: ULong): String {
return FfiConverterString.lift(
rustCallWithError(SphinxException) { _status ->
Expand Down

0 comments on commit 43504ed

Please sign in to comment.