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
fix(platform-wallet): map not-found errors to NotFound at FFI #5742
impl From<PlatformWalletError> for PlatformWalletFFIResult in rs-platform-wallet-ffi/src/error.rs has no arm for PlatformWalletError::WalletNotFound or PlatformWalletError::AddressNotFound, so both reach the host as ErrorUnknown. Hosts cannot tell an expected absence from an unclassified failure without parsing the message. Related absences already map to NotFound: a missing registry handle, WalletRemovedBeforeSend, DpnsNameNotFound and DecisionProposalNotFound.
On v5.1-dev, platform_wallet_address_private_key already returns AddressNotFound as ErrorUnknown for an address outside the wallet's pools. #5727 adds two more paths with the same result: platform_wallet_find_bip44_address_path and platform_wallet_bip44_address_private_key return WalletNotFound once the wallet was removed, and the BIP-44 reveal returns AddressNotFound when the scan does not reach the address.
Proposed direction
Add WalletNotFound and AddressNotFound arms that map to NotFound, and pin the boundary codes in tests.
WalletNotFound is used in about 140 places in platform-wallet, so the change alters the code hosts see on many existing calls. Before it lands, check the Swift and Kotlin error mapping for anything that branches on ErrorUnknown for these cases, and check classify_preflight_error in platform_addresses/withdrawal.rs, which treats WalletNotFound as structural.
Activity