Fix TON transaction status from traces#1111
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request integrates TON traces into the transaction status logic to improve state accuracy. It adds new trace models, implements an RPC method to fetch traces, and updates the mapping logic to derive transaction states from trace actions. A review comment suggests optimizing the trace action iteration in the map_trace_state function to improve efficiency.
fcbb3a0 to
9cdf81c
Compare
2ae8ef5 to
d0f63f6
Compare
1109628 to
49f73e7
Compare
49f73e7 to
fcacdd0
Compare
Switch get_transactions_by_address, get_transaction_by_hash, and get_transactions_by_block to /api/v3/traces, emit one Transaction per trace (the root), and base64-decode the on-chain hash to hex so it matches what every other chain stores and what Tonscan/Tonviewer expect. Dedupes the activity feed (one row per swap instead of one per internal jetton-wallet hop) and aligns with the broadcast hash format already produced by map_transaction_broadcast.
get_transaction_by_hash now queries /api/v3/traces?tx_hash= so that callers (e.g. /v1/chain/transactions/ton/<hash>) can pass the actual transaction hash users see on Tonscan/Tonviewer. msg_hash is still used for get_transaction_status since that path tracks the inbound external message returned by the broadcast endpoint.
Wire ChainTransactionState through ChainProviders and ChainClient so the API can return the provider's TransactionUpdate (state + fee/block changes) for a given hash, e.g. to confirm or fail an in-flight TON swap via traces.
Single helper that accepts either the inbound message hash from broadcast or the on-chain transaction hash from an explorer. Used by both get_transaction_status and get_transaction_by_hash so the two call sites do not duplicate fallback logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
Note