Skip to content

Use structured error types for fee denom validation in CreateChainletStack#76

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/sub-pr-75
Draft

Use structured error types for fee denom validation in CreateChainletStack#76
Copilot wants to merge 4 commits intomainfrom
copilot/sub-pr-75

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 6, 2025

The error handling for unsupported fee denominations was inconsistent between CreateChainletStack (using fmt.Errorf) and updateChainletStackFees (using cosmossdkerrors.Wrapf with types.ErrInvalidDenom).

Changes

  • Added cosmossdkerrors import to msg_server_create_chainlet_stack.go
  • Replaced fmt.Errorf with cosmossdkerrors.Wrapf(types.ErrInvalidDenom, ...) for denom validation errors

This enables programmatic error type checking and aligns with the existing pattern:

// Before
if !ok {
    return nil, fmt.Errorf("denom %s not supported for escrow deposits, supported %v", msg.Fees.Denom, denoms)
}

// After
if !ok {
    return nil, cosmossdkerrors.Wrapf(
        types.ErrInvalidDenom,
        "denom %s not supported for escrow deposits",
        msg.Fees.Denom,
    )
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: lukitsbrian <45702419+lukitsbrian@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on fee denom support in escrow Use structured error types for fee denom validation in CreateChainletStack Nov 6, 2025
Copilot AI requested a review from lukitsbrian November 6, 2025 19:00
Base automatically changed from feautre/escrow-order-of-ops to main November 7, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants