You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
platform-wallet-ffi: a bad address in key reveal is reported as ErrorUnknown #5739
A malformed or wrong-network address passed to platform_wallet_address_private_key comes back to Swift and Kotlin as ErrorUnknown, not ErrorInvalidParameter. PlatformWallet::derive_core_address_private_key reports both cases as PlatformWalletError::AddressOperation, and the FFI error conversion has no arm for that variant, so it falls through to ErrorUnknown. A host cannot tell "you passed a bad address" apart from an internal failure.
Evidence
origin/v5.1-dev: packages/rs-platform-wallet/src/wallet/core_address_key.rs, the Address::from_str and require_network error mappings in derive_core_address_private_key, both PlatformWalletError::AddressOperation(..).
origin/v5.1-dev: packages/rs-platform-wallet-ffi/src/error.rs, test unmapped_variants_fall_through_to_unknown pins AddressOperation → ErrorUnknown.
The rest of the FFI reports the same input as ErrorInvalidParameter. Once #5727 lands, platform_wallet_address_validate returns ErrorInvalidParameter for a string that platform_wallet_address_private_key and the new platform_wallet_find_bip44_address_path report as ErrorUnknown.
Fix
Report an unparsable or wrong-network address as PlatformWalletError::InvalidParameter in one shared parse function in rs-platform-wallet. #5727 adds parse_address in core_address_key.rs, which is the natural owner. Have platform_wallet_address_validate call that function as well, so address validation lives in one place. Pin the resulting ErrorInvalidParameter code in the FFI tests for the key reveal and the scan.
Activity