-
Notifications
You must be signed in to change notification settings - Fork 56
feat(swift-sdk): add ZK sync, local Docker support, and account management (part 1) #3393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
09c8aef
d2fdce3
5ebd4bc
93205ff
55008db
3212d87
822cc24
2cfe1e8
ac65440
033c509
f1ef279
0bd1341
c8d9d86
a6671ff
13c6e19
c38b5a0
87320a2
53adb35
b367564
e032548
870a0cd
ab5a56a
2c27c01
7fa5afe
f2d9088
7487f45
808c5f1
3d47fac
b224aff
5b1c28f
c3c9c7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,4 +22,4 @@ pub use managed_identity::ManagedIdentity; | |
| pub use platform_wallet_info::PlatformWalletInfo; | ||
|
|
||
| #[cfg(feature = "manager")] | ||
| pub use key_wallet_manager; | ||
| pub use key_wallet; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if key-wallet is used elsewhere in the crate without the manager feature gate
rg -n "use key_wallet" packages/rs-platform-wallet/src --type rustRepository: dashpay/platform Length of output: 3546 🏁 Script executed: # Check Cargo.toml for key-wallet dependency configuration
cat -n packages/rs-platform-wallet/Cargo.toml | head -40Repository: dashpay/platform Length of output: 1120 🏁 Script executed: # Search for "manager" feature definition in Cargo.toml
rg -n "manager" packages/rs-platform-wallet/Cargo.tomlRepository: dashpay/platform Length of output: 116 🏁 Script executed: # Check if platform_wallet_info is gated by manager feature
rg -n "#\[cfg.*manager" packages/rs-platform-wallet/src --type rustRepository: dashpay/platform Length of output: 129 🏁 Script executed: # Check what platform_wallet_info module exposes publicly
rg -n "^pub " packages/rs-platform-wallet/src/platform_wallet_info/mod.rs | head -20Repository: dashpay/platform Length of output: 94 🏁 Script executed: # Check if any of the crate's public API depends on the re-export being available
rg -n "platform_wallet::key_wallet" . --type rustRepository: dashpay/platform Length of output: 42 Remove the unused re-export or clarify its purpose. The 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,9 @@ class SPVClient: @unchecked Sendable { | |
| return dash_spv_ffi_config_mainnet() | ||
| case 1: | ||
| return dash_spv_ffi_config_testnet() | ||
| case 2: | ||
| // Regtest (local Docker) | ||
| return dash_spv_ffi_config_new(FFINetwork(rawValue: 2)) | ||
| case 3: | ||
|
Comment on lines
44
to
50
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Borrowed wallet-manager FFI handle can outlive the owning SPV client The wallet-manager handle obtained from the FFI is a borrowed pointer whose lifetime is tied to the SPV client. If the SPV client is deallocated while the wallet manager is still in use (e.g., during async transaction operations), the handle becomes a dangling pointer. Consider either copying the handle or ensuring the SPV client's lifetime encompasses all wallet manager usage. source: ['codex'] 🤖 Fix this with AI agents
Comment on lines
44
to
50
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Core→Platform top-up accepts first InstantSend lock without SPV validation The top-up flow accepts the first InstantSend lock notification for a transaction without verifying that SPV has actually validated it against the chain. An attacker on the local network could inject a fake IS notification. The code should verify the transaction's confirmation status via SPV before crediting the platform account. source: ['codex'] 🤖 Fix this with AI agents |
||
| // Map devnet to custom FFINetwork value 3 | ||
| return dash_spv_ffi_config_new(FFINetwork(rawValue: 3)) | ||
|
|
@@ -134,9 +137,9 @@ class SPVClient: @unchecked Sendable { | |
| } | ||
|
|
||
| private static func readLocalCorePeers() -> [String] { | ||
| // If no override is set, default to 127.0.0.1 and let FFI pick port by network | ||
| // If no override is set, default to dashmate Docker Core P2P port | ||
| let raw = UserDefaults.standard.string(forKey: "corePeerAddresses")?.trimmingCharacters(in: .whitespacesAndNewlines) | ||
| let list = (raw?.isEmpty == false ? raw! : "127.0.0.1") | ||
| let list = (raw?.isEmpty == false ? raw! : "127.0.0.1:20001") | ||
| return list | ||
| .split(separator: ",") | ||
| .map { $0.trimmingCharacters(in: .whitespaces) } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: dashpay/platform
Length of output: 42
🏁 Script executed:
Repository: dashpay/platform
Length of output: 800
🏁 Script executed:
Repository: dashpay/platform
Length of output: 370
🏁 Script executed:
Repository: dashpay/platform
Length of output: 370
🏁 Script executed:
Repository: dashpay/platform
Length of output: 42
🏁 Script executed:
Repository: dashpay/platform
Length of output: 42
🏁 Script executed:
Repository: dashpay/platform
Length of output: 144
🏁 Script executed:
Repository: dashpay/platform
Length of output: 668
🏁 Script executed:
Repository: dashpay/platform
Length of output: 42
🏁 Script executed:
Repository: dashpay/platform
Length of output: 42
🏁 Script executed:
Repository: dashpay/platform
Length of output: 150
🏁 Script executed:
Repository: dashpay/platform
Length of output: 126
🏁 Script executed:
Repository: dashpay/platform
Length of output: 2541
core_key_wallet_managerfeature no longer provides re-export for backwards compatibility.The
core_key_wallet_managerfeature still exists inCargo.tomland is referenced by downstream crates (e.g.,rs-sdkmarks it as a default feature), but the correspondingpub use key_wallet_manager;re-export has been removed. While the comment indicates an intentional merge ofkey_wallet_managerinto thekey_walletcrate, external consumers that relied ondpp::key_wallet_manager::...paths will now encounter compilation errors.Consider either:
#[cfg(feature = "core_key_wallet_manager")] pub use key_wallet as key_wallet_manager;core_key_wallet_managerfeature entirely if it is no longer neededkey_wallet::manager::...directly)🤖 Prompt for AI Agents