Skip to content

Commit 1e7edbf

Browse files
fix(key-wallet-ffi): include all account variants in managed_wallet_get_account_count
The count was only summing standard / coinjoin / identity_registration / identity_topup buckets — every other variant `managed_wallet_get_account` can return (identity_topup_not_bound, identity_invitation, asset-lock, provider, dashpay, platform-payment) was excluded. Pre-existing miscount, made more visible by the keys-account split now exposing those getters through the variant-aware FFI surface. `provider_operator_keys` (BLS) and `provider_platform_keys` (EdDSA) are feature-gated on the immutable `AccountCollection` and counted only when the corresponding feature is enabled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e68ee5a commit 1e7edbf

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

key-wallet-ffi/src/managed_account.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,36 @@ pub unsafe extern "C" fn managed_wallet_get_account_count(
11291129
+ accounts.standard_bip32_accounts.len()
11301130
+ accounts.coinjoin_accounts.len()
11311131
+ accounts.identity_registration.is_some() as usize
1132-
+ accounts.identity_topup.len();
1132+
+ accounts.identity_topup.len()
1133+
+ accounts.identity_topup_not_bound.is_some() as usize
1134+
+ accounts.identity_invitation.is_some() as usize
1135+
+ accounts.asset_lock_address_topup.is_some() as usize
1136+
+ accounts.asset_lock_shielded_address_topup.is_some() as usize
1137+
+ accounts.provider_voting_keys.is_some() as usize
1138+
+ accounts.provider_owner_keys.is_some() as usize
1139+
+ {
1140+
#[cfg(feature = "bls")]
1141+
{
1142+
accounts.provider_operator_keys.is_some() as usize
1143+
}
1144+
#[cfg(not(feature = "bls"))]
1145+
{
1146+
0
1147+
}
1148+
}
1149+
+ {
1150+
#[cfg(feature = "eddsa")]
1151+
{
1152+
accounts.provider_platform_keys.is_some() as usize
1153+
}
1154+
#[cfg(not(feature = "eddsa"))]
1155+
{
1156+
0
1157+
}
1158+
}
1159+
+ accounts.dashpay_receival_accounts.len()
1160+
+ accounts.dashpay_external_accounts.len()
1161+
+ accounts.platform_payment_accounts.len();
11331162

11341163
// Clean up the wallet pointer
11351164
crate::wallet::wallet_free_const(wallet_ptr);

0 commit comments

Comments
 (0)