Skip to content

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

Merged
merged 11 commits into from
Jul 29, 2025
Merged

Tgbtc #218

merged 11 commits into from
Jul 29, 2025

Conversation

verdigos
Copy link
Collaborator

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a 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 in ton-index-go
  • Implement parsing and model structs for tgbtc actions in ton-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
Copy link
Preview

Copilot AI Jun 16, 2025

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.

Suggested change
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)
Copy link
Preview

Copilot AI Jun 16, 2025

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.

Suggested change
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"`
Copy link
Preview

Copilot AI Jun 16, 2025

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.

Suggested change
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',
Copy link
Preview

Copilot AI Jun 16, 2025

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.

Suggested change
'tgbtc_new_key',
'tgbtc_new_key',
'tgbtc_dkg_log',
'tgbtc_dkg_log_fallback',

Copilot uses AI. Check for mistakes.

verdigos added 4 commits June 16, 2025 17:27
# 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
@kdimentionaltree kdimentionaltree merged commit 34efb39 into toncenter:master Jul 29, 2025
2 checks passed
@kdimentionaltree kdimentionaltree deleted the tgbtc branch July 29, 2025 09:34
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.

3 participants