diff --git a/Cargo.lock b/Cargo.lock index eb12de8ad..4e03c9fca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.48", @@ -568,7 +568,7 @@ name = "clap_derive" version = "4.5.0" source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.48", @@ -958,7 +958,7 @@ name = "enum-as-inner" version = "0.6.0" source = "git+https://github.com/bluejekyll/enum-as-inner/?rev=c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2#c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.48", @@ -1245,6 +1245,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.5" @@ -1823,12 +1829,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "oneshot-uniffi" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c548d5c78976f6955d72d0ced18c48ca07030f7a1d4024529fedd7c1c01b29c" - [[package]] name = "opaque-debug" version = "0.3.0" @@ -2529,7 +2529,7 @@ dependencies = [ [[package]] name = "sargon" -version = "0.7.8" +version = "0.7.9" dependencies = [ "actix-rt", "aes-gcm", @@ -3110,7 +3110,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -3122,7 +3122,7 @@ name = "strum_macros" version = "0.26.1" source = "git+https://github.com/Peternator7/strum/?rev=f746c3699acf150112e26c00e6c8ca666d8d068d#f746c3699acf150112e26c00e6c8ca666d8d068d" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -3207,8 +3207,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" dependencies = [ "smawk", - "unicode-linebreak", - "unicode-width", ] [[package]] @@ -3498,12 +3496,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-linebreak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" - [[package]] name = "unicode-normalization" version = "0.1.22" @@ -3513,12 +3505,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - [[package]] name = "unicode-xid" version = "0.2.4" @@ -3527,8 +3513,8 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "uniffi" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "anyhow", "camino 1.1.6", @@ -3541,8 +3527,8 @@ dependencies = [ [[package]] name = "uniffi_bindgen" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "anyhow", "askama", @@ -3552,7 +3538,7 @@ dependencies = [ "fs-err", "glob", "goblin", - "heck", + "heck 0.5.0", "once_cell", "paste 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", "serde", @@ -3565,8 +3551,8 @@ dependencies = [ [[package]] name = "uniffi_build" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "anyhow", "camino 1.1.6", @@ -3575,8 +3561,8 @@ dependencies = [ [[package]] name = "uniffi_checksum_derive" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "quote", "syn 2.0.48", @@ -3584,23 +3570,22 @@ dependencies = [ [[package]] name = "uniffi_core" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "anyhow", "bytes", "camino 1.1.6", "log", "once_cell", - "oneshot-uniffi", "paste 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", "static_assertions", ] [[package]] name = "uniffi_macros" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "bincode", "camino 1.1.6", @@ -3616,8 +3601,8 @@ dependencies = [ [[package]] name = "uniffi_meta" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "anyhow", "bytes", @@ -3627,8 +3612,8 @@ dependencies = [ [[package]] name = "uniffi_testing" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "anyhow", "camino 1.1.6", @@ -3639,8 +3624,8 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.27.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +version = "0.27.1" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "anyhow", "textwrap", @@ -3914,7 +3899,7 @@ dependencies = [ [[package]] name = "weedle2" version = "5.0.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=d52c5460ae42ecad1e73a5b394ac96d48f4769de#d52c5460ae42ecad1e73a5b394ac96d48f4769de" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=6f33088e8100a2ea9586c8c3ecf98ab51d5aba62#6f33088e8100a2ea9586c8c3ecf98ab51d5aba62" dependencies = [ "nom", ] diff --git a/Cargo.toml b/Cargo.toml index 7aeb93445..b0070ba33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon" -version = "0.7.8" +version = "0.7.9" edition = "2021" build = "build.rs" @@ -109,8 +109,8 @@ itertools = { git = "https://github.com/rust-itertools/itertools/", rev = "98eca # enum-as-inner = "0.6.0" enum-as-inner = { git = "https://github.com/bluejekyll/enum-as-inner/", rev = "c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2" } -# uniffi = "0.27.0" -uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "d52c5460ae42ecad1e73a5b394ac96d48f4769de", features = [ +# uniffi = "0.27.1" +uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "6f33088e8100a2ea9586c8c3ecf98ab51d5aba62", features = [ "cli", ] } @@ -177,8 +177,8 @@ aes-gcm = { git = "https://github.com/RustCrypto/AEADs", rev = "7e82b01cd4901f6a hkdf = { git = "https://github.com/RustCrypto/KDFs/", rev = "1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" } [dev-dependencies] -# uniffi = "0.27.0" -uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "d52c5460ae42ecad1e73a5b394ac96d48f4769de", features = [ +# uniffi = "0.27.1" +uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "6f33088e8100a2ea9586c8c3ecf98ab51d5aba62", features = [ "bindgen-tests", ] } @@ -191,8 +191,8 @@ reqwest = { git = "https://github.com/seanmonstar/reqwest", rev = "0720159f6369f actix-rt = { git = "https://github.com/actix/actix-net", rev = "57fd6ea8098d1f2d281c305fc331216c4fe1992e" } [build-dependencies] -# uniffi = "0.27.0" -uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "d52c5460ae42ecad1e73a5b394ac96d48f4769de", features = [ +# uniffi = "0.27.1" +uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "6f33088e8100a2ea9586c8c3ecf98ab51d5aba62", features = [ "build", ] } diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Profile/Profile+Swiftified.swift b/apple/Sources/Sargon/Extensions/Swiftified/Profile/Profile+Swiftified.swift index fb984a6c7..6776b333d 100644 --- a/apple/Sources/Sargon/Extensions/Swiftified/Profile/Profile+Swiftified.swift +++ b/apple/Sources/Sargon/Extensions/Swiftified/Profile/Profile+Swiftified.swift @@ -29,6 +29,7 @@ extension Profile { } } +public typealias ProfileID = ProfileId extension Profile: Identifiable { public typealias ID = ProfileID public var id: ID { diff --git a/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/MnemonicWithPassphrase.kt b/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/MnemonicWithPassphrase.kt index 12319aa12..8c9260c74 100644 --- a/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/MnemonicWithPassphrase.kt +++ b/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/MnemonicWithPassphrase.kt @@ -1,6 +1,6 @@ package com.radixdlt.sargon.extensions -import com.radixdlt.sargon.BIP39Passphrase +import com.radixdlt.sargon.Bip39Passphrase import com.radixdlt.sargon.CommonException import com.radixdlt.sargon.DerivationPath import com.radixdlt.sargon.Hash @@ -21,7 +21,7 @@ import kotlinx.serialization.json.Json @Throws(SargonException::class) fun MnemonicWithPassphrase.Companion.init(phrase: String) = MnemonicWithPassphrase( mnemonic = Mnemonic.init(phrase = phrase), - passphrase = BIP39Passphrase() + passphrase = Bip39Passphrase() ) @Throws(SargonException::class) @@ -77,7 +77,7 @@ fun MnemonicWithPassphrase.sign( private data class AndroidMnemonicWithPassphrase( @SerialName("mnemonic") val phrase: String, - @SerialName("bip39Passphrase") + @SerialName("Bip39Passphrase") val passphrase: String ) { diff --git a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/MnemonicWithPassphraseTest.kt b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/MnemonicWithPassphraseTest.kt index 166310924..645590239 100644 --- a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/MnemonicWithPassphraseTest.kt +++ b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/MnemonicWithPassphraseTest.kt @@ -41,7 +41,7 @@ class MnemonicWithPassphraseTest { @Test fun testFromAndroidJson() { val androidJsonWithoutPassphrase = - """{"mnemonic":"remind index lift gun sleep inner double leopard exist sugar item whisper coast duty leopard law radar neutral odor tape finger position capital track","bip39Passphrase":""}""".trimIndent() + """{"mnemonic":"remind index lift gun sleep inner double leopard exist sugar item whisper coast duty leopard law radar neutral odor tape finger position capital track","Bip39Passphrase":""}""".trimIndent() assertEquals( MnemonicWithPassphrase( mnemonic = Mnemonic.init(phrase = "remind index lift gun sleep inner double leopard exist sugar item whisper coast duty leopard law radar neutral odor tape finger position capital track"), @@ -52,7 +52,7 @@ class MnemonicWithPassphraseTest { val androidJsonWithoutPassphrasePrettyPrinted = """{ "mnemonic": "remind index lift gun sleep inner double leopard exist sugar item whisper coast duty leopard law radar neutral odor tape finger position capital track", - "bip39Passphrase": "" + "Bip39Passphrase": "" }""".trimIndent() assertEquals( MnemonicWithPassphrase( @@ -63,7 +63,7 @@ class MnemonicWithPassphraseTest { ) val androidJsonWithPassphrase = - """{"mnemonic":"remind index lift gun sleep inner double leopard exist sugar item whisper coast duty leopard law radar neutral odor tape finger position capital track","bip39Passphrase":"super secret"}""".trimIndent() + """{"mnemonic":"remind index lift gun sleep inner double leopard exist sugar item whisper coast duty leopard law radar neutral odor tape finger position capital track","Bip39Passphrase":"super secret"}""".trimIndent() assertEquals( MnemonicWithPassphrase( mnemonic = Mnemonic.init(phrase = "remind index lift gun sleep inner double leopard exist sugar item whisper coast duty leopard law radar neutral odor tape finger position capital track"), diff --git a/src/core/types/identified_vec_of/identified_vec_of_uniffi_converter.rs b/src/core/types/identified_vec_of/identified_vec_of_uniffi_converter.rs index 10db34bca..e0cbb7015 100644 --- a/src/core/types/identified_vec_of/identified_vec_of_uniffi_converter.rs +++ b/src/core/types/identified_vec_of/identified_vec_of_uniffi_converter.rs @@ -1,6 +1,7 @@ use crate::prelude::*; use indexmap::IndexMap; -use std::any::TypeId; +use std::any::TypeId as StdTypeId; +use uniffi::TypeId as UFTypeId; use uniffi::{ check_remaining, deps::bytes::{Buf, BufMut}, @@ -27,10 +28,6 @@ unsafe impl> Lower fn lower(obj: Self) -> RustBuffer { Self::lower_into_rust_buffer(obj) } - - const TYPE_ID_META: MetadataBuffer = - MetadataBuffer::from_code(metadata::codes::TYPE_VEC) - .concat(V::TYPE_ID_META); } unsafe impl> @@ -41,8 +38,6 @@ unsafe impl> fn lower_return(obj: Self) -> uniffi::Result { Ok(>::lower(obj)) } - - const TYPE_ID_META: MetadataBuffer = >::TYPE_ID_META; } unsafe impl + 'static> Lift for IdentifiedVecOf @@ -62,7 +57,11 @@ unsafe impl + 'static> fn try_lift(buf: RustBuffer) -> uniffi::Result { Self::try_lift_from_rust_buffer(buf) } +} +impl> UFTypeId + for IdentifiedVecOf +{ const TYPE_ID_META: MetadataBuffer = MetadataBuffer::from_code(metadata::codes::TYPE_VEC) .concat(V::TYPE_ID_META);