Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ members = [
]

[workspace.dependencies]
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
dash-spv-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "d6dd5da14902dca4332036c5ef4db03734934eb3" }
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
dash-spv-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "53130869e5b9343ae59016323e5e5269e717a8fd" }
Comment on lines +52 to +60

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Breaking FFI changes shipped under a chore: PR title

The PR title is chore: bump rust-dashcore ..., but the diff removes the passphrase parameter from public Rust FFI (platform_wallet_info_create_from_mnemonic), changes the C ABI of platform_wallet_info_create_from_seed/get_identity_manager/set_identity_manager (dropping out_error, adding network, returning PlatformWalletFFIResult by value), and removes passphrase: from three Swift public APIs (Wallet.init, WalletManager.addWallet, PlatformWallet.fromMnemonic). Per Conventional Commits this is a breaking change for downstream FFI consumers and should be tagged chore!: (or feat!:) so it isn't silently rolled into a patch. Note that for externally distributed prebuilt libraries the same-symbol ABI swap on the four platform_wallet_info_* functions is not just a source break — callers built against the previous header will pass the wrong number/layout of arguments to the same symbol.

source: ['claude-general', 'codex-ffi-engineer']

🤖 Fix this with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `Cargo.toml`:
- [SUGGESTION] lines 52-60: Breaking FFI changes shipped under a `chore:` PR title
  The PR title is `chore: bump rust-dashcore ...`, but the diff removes the `passphrase` parameter from public Rust FFI (`platform_wallet_info_create_from_mnemonic`), changes the C ABI of `platform_wallet_info_create_from_seed`/`get_identity_manager`/`set_identity_manager` (dropping `out_error`, adding `network`, returning `PlatformWalletFFIResult` by value), and removes `passphrase:` from three Swift public APIs (`Wallet.init`, `WalletManager.addWallet`, `PlatformWallet.fromMnemonic`). Per Conventional Commits this is a breaking change for downstream FFI consumers and should be tagged `chore!:` (or `feat!:`) so it isn't silently rolled into a patch. Note that for externally distributed prebuilt libraries the same-symbol ABI swap on the four `platform_wallet_info_*` functions is not just a source break — callers built against the previous header will pass the wrong number/layout of arguments to the same symbol.


# Optimize heavy crypto crates even in dev/test builds so that
# Halo 2 proof generation and verification run at near-release speed.
Expand Down
30 changes: 5 additions & 25 deletions packages/rs-platform-wallet-ffi/src/platform_wallet_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ pub unsafe extern "C" fn platform_wallet_info_create_from_seed(
pub unsafe extern "C" fn platform_wallet_info_create_from_mnemonic(
network: FFINetwork,
mnemonic: *const c_char,
passphrase: *const c_char,
out_handle: *mut Handle,
) -> PlatformWalletFFIResult {
check_ptr!(mnemonic);
Expand All @@ -65,31 +64,13 @@ pub unsafe extern "C" fn platform_wallet_info_create_from_mnemonic(
let mnemonic_str =
unwrap_result_or_return!(unsafe { std::ffi::CStr::from_ptr(mnemonic).to_str() });

let passphrase_str = if passphrase.is_null() {
None
} else {
Some(unwrap_result_or_return!(unsafe {
std::ffi::CStr::from_ptr(passphrase).to_str()
}))
};

let mnemonic_obj = unwrap_result_or_return!(mnemonic_str.parse::<key_wallet::Mnemonic>());

// Create wallet from mnemonic with or without passphrase
let wallet = if let Some(pass) = passphrase_str {
unwrap_result_or_return!(key_wallet::Wallet::from_mnemonic_with_passphrase(
mnemonic_obj,
pass.to_string(),
network,
WalletAccountCreationOptions::None,
))
} else {
unwrap_result_or_return!(key_wallet::Wallet::from_mnemonic(
mnemonic_obj,
network,
WalletAccountCreationOptions::None,
))
};
let wallet = unwrap_result_or_return!(key_wallet::Wallet::from_mnemonic(
mnemonic_obj,
network,
WalletAccountCreationOptions::None,
));

// Create PlatformWalletInfo from the wallet
let platform_wallet = PlatformWalletInfo::from_wallet(&wallet, 0);
Expand Down Expand Up @@ -186,7 +167,6 @@ mod tests {
let result = platform_wallet_info_create_from_mnemonic(
FFINetwork::Testnet,
mnemonic.as_ptr(),
std::ptr::null(),
&mut handle,
);

Expand Down
1 change: 1 addition & 0 deletions packages/rs-platform-wallet/src/wallet/asset_lock/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ impl<B: TransactionBroadcaster + ?Sized> AssetLockManager<B> {
let result = info
.core_wallet
.build_asset_lock(wallet, account_index, vec![funding], DEFAULT_FEE_PER_KB)
.await
.map_err(|e| {
PlatformWalletError::AssetLockTransaction(format!(
"Asset lock builder failed: {}",
Expand Down
Loading
Loading