Skip to content

feat: enhance Cosmos transaction parsing to handle fees and tips as ancillary transactions#93

Merged
anhthii merged 1 commit intomainfrom
fix/cosmos-txn-parser
Mar 27, 2026
Merged

feat: enhance Cosmos transaction parsing to handle fees and tips as ancillary transactions#93
anhthii merged 1 commit intomainfrom
fix/cosmos-txn-parser

Conversation

@vietddude
Copy link
Copy Markdown
Collaborator

Summary
Refine Cosmos semantic transaction parsing to focus on user-facing asset movements and stop emitting fee/tip side effects as standalone transactions.

What Changed

  • Added fee filtering in Cosmos semantic parsing so native fee outflows are no longer emitted as separate transactions.
  • Added tip filtering so tip_pay-related native transfers are also excluded from semantic transaction output.
  • Added handling for chains/transactions that emit a combined ancillary native outflow equal to fee + tip, and strip that transfer before building semantic transactions.
  • Kept TxFee populated from the real fee event; tip is not promoted to a separate semantic transaction.
  • Refactored real Cosmos integration cases into a shared helper for reuse across tests.

Tests

  • Added unit coverage for:
    • fee-only side-effect transfers
    • tip-only side-effect transfers
    • combined fee+tip ancillary transfers
  • Added real-RPC integration coverage for Cosmos testnet tx FCC7183F43F150CC5B01E9F79FF3BB30B04153944039DB5AD428B9F8979789AA.
  • Added a real-tx semantic count test across the current Cosmos sample hashes to verify each tx now resolves to exactly one semantic transaction.

Observed Real-Tx Results

  • 10C90080AF071736C71F55130D672CB885DAC12963C4319D005420EF580706B7: 1 semantic tx
  • A3264C9CA23F78669D4EF6C0ADC3178AF08F9B74E555B1E0480A716FF264B74E: 1 semantic tx
  • 69F40A5F4E9BD58D5A5F30DBC4C53086D9080E703E77A44543807978207706B8: 1 semantic tx
  • FCC7183F43F150CC5B01E9F79FF3BB30B04153944039DB5AD428B9F8979789AA: 1 semantic tx

Why
Cosmos events often include balance movements for fee and tip settlement. Those are valid low-level transfers, but they are not user-facing “big asset movement” transactions. This change narrows Cosmos semantic parsing so transaction history better reflects the primary asset movement while preserving fee metadata in TxFee.

@vietddude vietddude requested a review from anhthii March 27, 2026 10:34
@anhthii anhthii merged commit 9ac2c1b into main Mar 27, 2026
2 checks passed
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