Skip to content

Implement SubmitError variants #422

Description

@AbelOsaretin

Description

Define all SubmitError variants with Display implementations for the transaction submission pipeline. These variants cover every failure mode in the send+poll lifecycle.

Current Behavior

SubmitError in submit.rs has the required variants but needs to be comprehensive and have proper Display impls for logging and error propagation.

Desired Behavior

All variants must be defined with correct Display output:

pub enum SubmitError {
    Rpc(RpcError),           // "RPC error: {inner}"
    JsonError(String),       // "JSON parse error: {msg}"
    Rejected { status },     // "transaction rejected: {status}"
    TransactionFailed { events }, // "transaction failed on-chain; diagnostic events: {events:?}"
    PollTimeout,             // "transaction not confirmed after {MAX_POLL_ATTEMPTS} attempts"
}

Implementation Details

  • Each variant wraps the appropriate inner type
  • Rpc wraps crate::stellar_rpc::RpcError
  • TransactionFailed holds Vec<String> of diagnostic event XDRs
  • PollTimeout is a unit variant (no data needed)
  • Display must produce human-readable messages for logging
  • Add From<RpcError> impl for ergonomic error propagation

Acceptance Criteria

  • All 5 variants defined: Rpc, JsonError, Rejected, TransactionFailed, PollTimeout
  • Each variant has a Display implementation
  • From<RpcError> conversion implemented
  • SubmitError derives Debug, PartialEq, Eq, Clone
  • Unit test: verify Display output for each variant

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 program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions