paritytech / paritytech/polkadot-cli

fix: show decoder context on dry-run decode fallback/failure

Open
#84 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
10
Forks
2
Avg merge
12h 35m
Merged PRs (30d)
4

Description

Summary

decodeCall in tx.ts (lines ~268-285) silently catches errors from both the primary and fallback decoders. When decoding fails, users see only (unable to decode) with no explanation of what went wrong.

Current Behavior

Call Data: 0x1f0003...
Decoded: (unable to decode)

Expected Behavior

Call Data: 0x1f0003...
Decoded: XcmPallet.reserve_transfer_assets(dest, beneficiary, assets, fee_asset_item)  (fallback decoder)

Or on complete failure:

Call Data: 0x1f0003...
Decoded: (unable to decode)
  Primary decoder: TypeNotFound: VersionedLocation not in registry
  Fallback decoder: IndexOutOfRange: pallet index 31 call index 8 not found

Proposed Changes

  • src/commands/tx.ts:
    • Capture error message from primary decoder (currently catch {} on line ~277)
    • Annotate output when fallback decoder succeeds: (fallback decoder)
    • When both decoders fail, show both error messages to aid debugging
    • Use --verbose flag to control whether full error details are shown (default: show brief hint)

Related Issues

  • #66 (dot decode command) — when decode is extracted to a shared module, this context logging carries over.

Priority

P2 — Small improvement to debuggability. Quick win (size S).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/commands/tx.ts at decodeCall, especially the primary and fallback decoder catches around lines 268-285. Trace the dry-run decode output and how --verbose is handled, then verify that fallback success identifies the fallback decoder and complete failure reports the relevant decoder context while the default remains brief.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.