Skip to content

Add structured CBOR error parsing for LocalTxSubmission rejections#134

Open
satran004 wants to merge 3 commits into
mainfrom
feat/tx_submit_error_parsing
Open

Add structured CBOR error parsing for LocalTxSubmission rejections#134
satran004 wants to merge 3 commits into
mainfrom
feat/tx_submit_error_parsing

Conversation

@satran004
Copy link
Copy Markdown
Member

Parse the CBOR-encoded error payload from MsgRejectTx into structured TxSubmissionError trees with era, rule, error name, human-readable message, and optional detail maps. Covers all eras (Byron through Conway) with ~72 error types. Gracefully degrades to raw CBOR on unknown errors.

  • Add era-specific parsers: Conway, Babbage, Alonzo, Shelley/Allegra/Mary
  • Add TxSubmissionError tree model with getLeafErrors() and toFullMessage()
  • Add TxSubmissionErrorParser entry point with HFC envelope unwrapping
  • Extend MsgRejectTx with errors list, era mismatch, and getErrorMessage()
  • Extend TxResult with errors and errorMessage fields
  • Add unit tests with programmatically constructed CBOR
  • Add DevKit integration tests (fee, witness, validity, value, script errors)
  • Add preprod integration test for stale tx error parsing

satran004 and others added 2 commits March 4, 2026 19:51
  Parse the CBOR-encoded error payload from MsgRejectTx into structured TxSubmissionError trees with era, rule, error name, human-readable message, and optional detail maps. Covers all eras (Byron through Conway) with ~72 error types. Gracefully degrades to raw CBOR on unknown errors.

  - Add era-specific parsers: Conway, Babbage, Alonzo, Shelley/Allegra/Mary
  - Add TxSubmissionError tree model with getLeafErrors() and toFullMessage()
  - Add TxSubmissionErrorParser entry point with HFC envelope unwrapping
  - Extend MsgRejectTx with errors list, era mismatch, and getErrorMessage()
  - Extend TxResult with errors and errorMessage fields
  - Add 20 unit tests with programmatically constructed CBOR
  - Add 6 DevKit integration tests (fee, witness, validity, value, script errors)
  - Add preprod integration test for stale tx error parsing
…c error parsers

Move common UTXO (tags 1-20), UTXOW witness (tags 1-9), and UTXOW
script/datum (tags 10-15) parsing into ErrorParserUtil shared methods.
Conway and Alonzo delegate UTXO parsing, Conway and Shelley delegate
UTXOW witness parsing, while keeping era-specific tags and recursion
in each parser. Reduces ~160 lines of duplicated code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 4, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
20.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

# Conflicts:
#	helper/src/integrationTest/java/com/bloxbean/cardano/yaci/helper/BaseTest.java
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
20.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

1 participant