-
Notifications
You must be signed in to change notification settings - Fork 43
Tgbtc #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tgbtc #218
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for tgbtc
actions across parsing, models, block serialization, event processing, and tests.
- Introduce
tgbtc
shortcuts inton-index-go
- Implement parsing and model structs for
tgbtc
actions inton-index-go
- Extend the indexer's block-to-action logic, serializers, matchers, and tests for
tgbtc
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
ton-index-go/index/utils.go | Added "tgbtc" to ActionTypeShortcuts |
ton-index-go/index/parse.go | Parsing logic for tgbtc_* action types |
ton-index-go/index/models.go | Added ActionDetailsTgbtc* structs |
indexer/tests/test_cases/tgbtc.yaml | Test cases for tgbtc workflows |
indexer/tests/test_actions.py | Registered TestTgBTCActions |
indexer/indexer/events/event_processing.py | Registered tgbtc block matchers |
indexer/indexer/events/blocks/utils/block_tree_serializer.py | Fillers and cases for tgbtc actions |
indexer/indexer/events/blocks/messages/tgbtc.py | Definitions for tgbtc message parsers |
details.Pubkey = (*string)(raw.SourceSecondary) | ||
details.Coordinator = raw.Destination | ||
details.Pegout = raw.DestinationSecondary | ||
details.Amount = raw.Amount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new-key parser never assigns details.Asset
even though ActionDetailsTgbtcNewKey
defines that field. Either remove the unused field from the struct or add details.Asset = raw.Asset
before setting act.Details
.
details.Amount = raw.Amount | |
details.Amount = raw.Amount | |
details.Asset = raw.Asset |
Copilot uses AI. Check for mistakes.
case "tgbtc_dkg_log_fallback": | ||
var details ActionDetailsDkgLogFallback | ||
details.Coordinator = raw.Source | ||
details.Pubkey = (*string)(raw.Asset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the DKG fallback case you cast raw.Asset
to *string
, but the pubkey comes from the secondary field. Use raw.AssetSecondary
(or the correct raw field) instead of raw.Asset
.
details.Pubkey = (*string)(raw.Asset) | |
details.Pubkey = (*string)(raw.AssetSecondary) |
Copilot uses AI. Check for mistakes.
Coordinator *AccountAddress `json:"coordinator"` | ||
Pegout *AccountAddress `json:"pegout"` | ||
Amount *string `json:"amount"` | ||
Asset *AccountAddress `json:"asset"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The Asset
field in ActionDetailsTgbtcNewKey
is never set by the parser. If this field is not intended for new-key actions, remove it or document its purpose; otherwise, populate it in ParseRawAction
.
Asset *AccountAddress `json:"asset"` |
Copilot uses AI. Check for mistakes.
@@ -739,6 +791,9 @@ def block_to_action(block: Block, trace_id: str, trace: Trace | None = None) -> | |||
'tonstakers_deposit', | |||
'tonstakers_withdraw_request', | |||
'tonstakers_withdraw', | |||
'tgbtc_mint', | |||
'tgbtc_burn', | |||
'tgbtc_new_key', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list of serialized action types omits tgbtc_dkg_log
(and/or its _fallback
variant). Add it here so that DKG fallback events are included in the output.
'tgbtc_new_key', | |
'tgbtc_new_key', | |
'tgbtc_dkg_log', | |
'tgbtc_dkg_log_fallback', |
Copilot uses AI. Check for mistakes.
# Conflicts: # indexer/indexer/events/blocks/utils/block_tree_serializer.py # indexer/indexer/events/event_processing.py # indexer/tests/test_actions.py # ton-index-go/index/parse.go
# Conflicts: # indexer/indexer/events/blocks/utils/block_tree_serializer.py # indexer/tests/test_actions.py # ton-index-go/index/models.go
# Conflicts: # indexer/tests/test_actions.py # indexer/tests/traces/k4j3bwj6FjSeLcdN8t4usf2Dq4qWpHkNDm2WH8_qeq4=.lz4 # ton-index-go/index/utils.go
No description provided.