From 74e5564e6e60081ffa7ca70dc9b2ae42933e3117 Mon Sep 17 00:00:00 2001 From: pauldelucia Date: Fri, 5 Dec 2025 11:33:15 +0700 Subject: [PATCH] feat: update rust-dashcore with platform addresses --- Cargo.lock | 308 +++--------------- packages/rs-dapi/Cargo.toml | 4 +- packages/rs-dpp/Cargo.toml | 10 +- .../src/address_funds/platform_address.rs | 8 +- packages/rs-platform-wallet/Cargo.toml | 7 +- packages/rs-platform-wallet/src/lib.rs | 14 +- packages/rs-sdk-ffi/Cargo.toml | 2 +- 7 files changed, 81 insertions(+), 272 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42a0013ef95..cc7b659dffb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1284,31 +1284,6 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" -[[package]] -name = "crossterm" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" -dependencies = [ - "bitflags 2.9.4", - "crossterm_winapi", - "libc", - "mio 0.8.11", - "parking_lot", - "signal-hook", - "signal-hook-mio", - "winapi", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi", -] - [[package]] name = "crunchy" version = "0.2.4" @@ -1443,18 +1418,7 @@ dependencies = [ [[package]] name = "dash-network" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" -dependencies = [ - "bincode 2.0.0-rc.3", - "bincode_derive", - "hex", - "serde", -] - -[[package]] -name = "dash-network" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "bincode 2.0.0-rc.3", "bincode_derive", @@ -1525,55 +1489,27 @@ dependencies = [ [[package]] name = "dash-spv" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "anyhow", "async-trait", "bincode 1.3.3", "blsful", "clap", - "crossterm", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore_hashes 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "dashcore", + "dashcore_hashes", "hex", "hickory-resolver", "indexmap 2.11.4", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "key-wallet-manager 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "log", - "rand 0.8.5", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "dash-spv" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" -dependencies = [ - "anyhow", - "async-trait", - "bincode 1.3.3", - "blsful", - "clap", - "crossterm", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "dashcore_hashes 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "hex", - "hickory-resolver", - "indexmap 2.11.4", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "key-wallet-manager 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", + "key-wallet", + "key-wallet-manager", "log", "rand 0.8.5", "serde", "serde_json", "thiserror 1.0.69", "tokio", + "tokio-util", "tracing", "tracing-subscriber", ] @@ -1581,18 +1517,18 @@ dependencies = [ [[package]] name = "dash-spv-ffi" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "cbindgen 0.29.0", "clap", - "dash-spv 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "dash-spv", + "dashcore", "env_logger 0.10.2", "futures", "hex", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "key-wallet", "key-wallet-ffi", - "key-wallet-manager 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "key-wallet-manager", "libc", "log", "once_cell", @@ -1600,13 +1536,14 @@ dependencies = [ "serde", "serde_json", "tokio", + "tokio-util", "tracing", ] [[package]] name = "dashcore" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "anyhow", "base64-compat", @@ -1616,9 +1553,9 @@ dependencies = [ "bitvec", "blake3", "blsful", - "dash-network 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore-private 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore_hashes 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "dash-network", + "dashcore-private", + "dashcore_hashes", "ed25519-dalek", "hex", "hex_lit", @@ -1629,60 +1566,17 @@ dependencies = [ "thiserror 2.0.16", ] -[[package]] -name = "dashcore" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" -dependencies = [ - "anyhow", - "base64-compat", - "bech32", - "bincode 2.0.0-rc.3", - "bincode_derive", - "bitvec", - "blake3", - "blsful", - "dash-network 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "dashcore-private 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "dashcore_hashes 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "hex", - "hex_lit", - "log", - "rustversion", - "secp256k1", - "serde", - "thiserror 2.0.16", -] - -[[package]] -name = "dashcore-private" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" - [[package]] name = "dashcore-private" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" - -[[package]] -name = "dashcore-rpc" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" -dependencies = [ - "dashcore-rpc-json 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "hex", - "jsonrpc", - "log", - "serde", - "serde_json", -] +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" [[package]] name = "dashcore-rpc" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ - "dashcore-rpc-json 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", + "dashcore-rpc-json", "hex", "jsonrpc", "log", @@ -1693,52 +1587,25 @@ dependencies = [ [[package]] name = "dashcore-rpc-json" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "bincode 2.0.0-rc.3", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "dashcore", "hex", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "key-wallet", "serde", "serde_json", "serde_repr", "serde_with 2.3.3", ] -[[package]] -name = "dashcore-rpc-json" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" -dependencies = [ - "bincode 2.0.0-rc.3", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "hex", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "serde", - "serde_json", - "serde_repr", - "serde_with 2.3.3", -] - -[[package]] -name = "dashcore_hashes" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" -dependencies = [ - "bincode 2.0.0-rc.3", - "dashcore-private 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "rs-x11-hash", - "secp256k1", - "serde", -] - [[package]] name = "dashcore_hashes" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "bincode 2.0.0-rc.3", - "dashcore-private 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", + "dashcore-private", "rs-x11-hash", "secp256k1", "serde", @@ -1926,9 +1793,9 @@ dependencies = [ "chrono", "chrono-tz", "ciborium", - "dash-spv 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore-rpc 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "dash-spv", + "dashcore", + "dashcore-rpc", "data-contracts", "derive_more 1.0.0", "dpp", @@ -1940,8 +1807,8 @@ dependencies = [ "itertools 0.13.0", "json-schema-compatibility-validator", "jsonschema", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "key-wallet-manager 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "key-wallet", + "key-wallet-manager", "lazy_static", "log", "nohash-hasher", @@ -3546,19 +3413,20 @@ dependencies = [ [[package]] name = "key-wallet" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "aes", + "async-trait", "base58ck", "bincode 2.0.0-rc.3", "bincode_derive", "bip39", "bitflags 2.9.4", "bs58", - "dash-network 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore-private 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore_hashes 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "dash-network", + "dashcore", + "dashcore-private", + "dashcore_hashes", "getrandom 0.2.16", "hex", "hkdf", @@ -3572,43 +3440,17 @@ dependencies = [ "zeroize", ] -[[package]] -name = "key-wallet" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" -dependencies = [ - "base58ck", - "bincode 2.0.0-rc.3", - "bincode_derive", - "bip39", - "bitflags 2.9.4", - "dash-network 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "dashcore-private 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "dashcore_hashes 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "getrandom 0.2.16", - "hex", - "hkdf", - "rand 0.8.5", - "secp256k1", - "serde", - "serde_json", - "sha2", - "tracing", - "zeroize", -] - [[package]] name = "key-wallet-ffi" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "cbindgen 0.29.0", - "dash-network 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "dash-network", + "dashcore", "hex", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "key-wallet-manager 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "key-wallet", + "key-wallet-manager", "libc", "secp256k1", "tokio", @@ -3617,27 +3459,13 @@ dependencies = [ [[package]] name = "key-wallet-manager" version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0#c877c1a74d145e2003d549619698511513db925c" +source = "git+https://github.com/dashpay/rust-dashcore?rev=daecabc5609409a2e4ce3de657208451d59d518f#daecabc5609409a2e4ce3de657208451d59d518f" dependencies = [ "async-trait", "bincode 2.0.0-rc.3", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "dashcore_hashes 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "secp256k1", - "zeroize", -] - -[[package]] -name = "key-wallet-manager" -version = "0.40.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964#e44b1fb2086ad57c8884995f9f93f14de91bf964" -dependencies = [ - "async-trait", - "bincode 2.0.0-rc.3", - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "dashcore_hashes 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", + "dashcore", + "dashcore_hashes", + "key-wallet", "secp256k1", "zeroize", ] @@ -3936,18 +3764,6 @@ dependencies = [ "adler2", ] -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - [[package]] name = "mio" version = "1.0.4" @@ -4575,11 +4391,12 @@ dependencies = [ name = "platform-wallet" version = "2.1.0-rc.1" dependencies = [ - "dashcore 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "async-trait", + "dashcore", "dpp", "indexmap 2.11.4", - "key-wallet 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", - "key-wallet-manager 0.40.0 (git+https://github.com/dashpay/rust-dashcore?tag=v0.40.0)", + "key-wallet", + "key-wallet-manager", "serde", "thiserror 1.0.69", ] @@ -5362,8 +5179,8 @@ dependencies = [ "ciborium", "clap", "dapi-grpc", - "dash-spv 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", - "dashcore-rpc 0.40.0 (git+https://github.com/dashpay/rust-dashcore?rev=e44b1fb2086ad57c8884995f9f93f14de91bf964)", + "dash-spv", + "dashcore-rpc", "dotenvy", "dpp", "envy", @@ -6105,27 +5922,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-mio" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" -dependencies = [ - "libc", - "mio 0.8.11", - "signal-hook", -] - [[package]] name = "signal-hook-registry" version = "1.4.6" @@ -6670,7 +6466,7 @@ dependencies = [ "bytes", "io-uring", "libc", - "mio 1.0.4", + "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", diff --git a/packages/rs-dapi/Cargo.toml b/packages/rs-dapi/Cargo.toml index 64c474f9d5d..1cc73fcf3a1 100644 --- a/packages/rs-dapi/Cargo.toml +++ b/packages/rs-dapi/Cargo.toml @@ -85,8 +85,8 @@ prometheus = "0.14" once_cell = "1.19" # Dash Core RPC client -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "e44b1fb2086ad57c8884995f9f93f14de91bf964" } -dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "e44b1fb2086ad57c8884995f9f93f14de91bf964" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f" } +dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f" } rs-dash-event-bus = { path = "../rs-dash-event-bus" } diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index f0f4f4e94ee..07fdec47ee9 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -23,7 +23,7 @@ chrono = { version = "0.4.35", default-features = false, features = [ ] } chrono-tz = { version = "0.8", optional = true } ciborium = { version = "0.2.2", optional = true } -dashcore = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0", features = [ +dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f", features = [ "std", "secp-recovery", "rand", @@ -31,10 +31,10 @@ dashcore = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0", "serde", "eddsa", ], default-features = false } -key-wallet = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0", optional = true } -key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0", optional = true } -dash-spv = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0", optional = true } -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0", optional = true } +key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f", optional = true } +key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f", optional = true } +dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f", optional = true } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f", optional = true } env_logger = { version = "0.11" } getrandom = { version = "0.2", features = ["js"] } diff --git a/packages/rs-dpp/src/address_funds/platform_address.rs b/packages/rs-dpp/src/address_funds/platform_address.rs index 3ab07b415b9..c0acb9a00ac 100644 --- a/packages/rs-dpp/src/address_funds/platform_address.rs +++ b/packages/rs-dpp/src/address_funds/platform_address.rs @@ -51,8 +51,12 @@ impl TryFrom
for PlatformAddress { fn try_from(address: Address) -> Result { match address.payload() { - Payload::PubkeyHash(hash) => Ok(PlatformAddress::P2pkh(*hash.as_ref())), - Payload::ScriptHash(hash) => Ok(PlatformAddress::P2sh(*hash.as_ref())), + Payload::PubkeyHash(hash) | Payload::PlatformPubkeyHash(hash) => { + Ok(PlatformAddress::P2pkh(*hash.as_ref())) + } + Payload::ScriptHash(hash) | Payload::PlatformScriptHash(hash) => { + Ok(PlatformAddress::P2sh(*hash.as_ref())) + } _ => Err(ProtocolError::DecodingError( "unsupported address type for PlatformAddress: only P2PKH and P2SH are supported" .to_string(), diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index e27366f1382..b4f89984c27 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -11,13 +11,14 @@ description = "Platform wallet with identity management support" dpp = { path = "../rs-dpp" } # Key wallet dependencies (from rust-dashcore) -key-wallet = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0" } -key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0", optional = true } +key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f" } +key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f", optional = true } # Core dependencies -dashcore = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0" } +dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f" } # Standard dependencies +async-trait = "0.1" serde = { version = "1.0", features = ["derive"] } thiserror = "1.0" diff --git a/packages/rs-platform-wallet/src/lib.rs b/packages/rs-platform-wallet/src/lib.rs index fb8bda8f892..4713dfaed80 100644 --- a/packages/rs-platform-wallet/src/lib.rs +++ b/packages/rs-platform-wallet/src/lib.rs @@ -3,6 +3,7 @@ //! This crate provides a wallet implementation that combines traditional //! wallet functionality with Dash Platform identity management. +use async_trait::async_trait; use dashcore::Address as DashAddress; use dashcore::Transaction; use dpp::identity::Identity; @@ -96,17 +97,20 @@ impl PlatformWalletInfo { } /// Implement WalletTransactionChecker by delegating to ManagedWalletInfo +#[async_trait] impl WalletTransactionChecker for PlatformWalletInfo { - fn check_transaction( + async fn check_transaction( &mut self, tx: &Transaction, network: Network, context: TransactionContext, - update_state_with_wallet_if_found: Option<&Wallet>, + wallet: &mut Wallet, + update_state: bool, ) -> TransactionCheckResult { // Delegate to the underlying wallet info self.wallet_info - .check_transaction(tx, network, context, update_state_with_wallet_if_found) + .check_transaction(tx, network, context, wallet, update_state) + .await } } @@ -363,6 +367,10 @@ impl WalletInfoInterface for PlatformWalletInfo { current_block_height, ) } + + fn update_chain_height(&mut self, network: Network, current_height: u32) { + self.wallet_info.update_chain_height(network, current_height) + } } /// Errors that can occur in platform wallet operations diff --git a/packages/rs-sdk-ffi/Cargo.toml b/packages/rs-sdk-ffi/Cargo.toml index 21f92dc3856..7fcfbfcb776 100644 --- a/packages/rs-sdk-ffi/Cargo.toml +++ b/packages/rs-sdk-ffi/Cargo.toml @@ -22,7 +22,7 @@ rs-sdk-trusted-context-provider = { path = "../rs-sdk-trusted-context-provider", simple-signer = { path = "../simple-signer" } # Core SDK integration (always included for unified SDK) -dash-spv-ffi = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.40.0", optional = true } +dash-spv-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "daecabc5609409a2e4ce3de657208451d59d518f", optional = true } # FFI and serialization serde = { version = "1.0", features = ["derive"] }