Skip to content

deposit_handler: load_market_props raises DepositNotFound for an unregistered market during create_deposit #371

Description

@abayomicornelius

Problem

deposit_handler::load_market_props panics with Error::DepositNotFound when market keys are absent from data_store. This helper is called from create_deposit BEFORE any deposit exists — so a caller passing an unregistered/malformed market address gets DepositNotFound, which semantically means "no such deposit" (and is reused elsewhere for exactly that meaning). withdrawal_handler's equivalent correctly uses InvalidMarket for the same condition.

Why it matters

Any client, indexer, or wallet that branches on the handler's typed error code to distinguish "this deposit id doesn't exist" from "you passed a bad/unconfigured market" will misclassify the latter as the former when creating a deposit, producing a confusing error-handling path.

Suggested fix

Give deposit_handler its own InvalidMarket error variant (as withdrawal_handler already has) and use it in load_market_props, reserving DepositNotFound for lookups of an existing deposit key.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programbugSomething isn't workingpriority:medium

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions