Skip to content

Conversation

@krebernisak
Copy link
Collaborator

No description provided.

@krebernisak krebernisak requested a review from a team as a code owner January 19, 2026 17:53
Copilot AI review requested due to automatic review settings January 19, 2026 17:53
@github-actions
Copy link

👋 krebernisak, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

Copy link
Contributor

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

This PR introduces a reusable ExtractOpcode utility function in the pkg/ton/tvm package to consolidate opcode extraction logic across the codebase.

Changes:

  • Added ExtractOpcode function in a new pkg/ton/tvm/cell.go file
  • Refactored pkg/ton/message/message.go to use the new utility function
  • Removed duplicate extractOpcode function from deployment/pkg/ops/ton/send.go in favor of the shared utility

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pkg/ton/tvm/cell.go New file introducing the shared ExtractOpcode utility function
pkg/ton/message/message.go Refactored to use the new tvm.ExtractOpcode function and improved error handling
deployment/pkg/ops/ton/send.go Removed duplicate implementation in favor of the shared utility
Comments suppressed due to low confidence (1)

pkg/ton/message/message.go:1

  • The slice s is created fresh from payload.BeginParse(), so it includes the opcode bits. Since the opcode was already extracted via tvm.ExtractOpcode(payload), this should skip the first 32 bits before checking BitsLeft(). The current logic incorrectly includes the opcode in the remaining body.
package message

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@krebernisak krebernisak enabled auto-merge (squash) January 19, 2026 18:27
@krebernisak krebernisak merged commit c9d69aa into main Jan 20, 2026
37 checks passed
@krebernisak krebernisak deleted the chore/extract-opcode branch January 20, 2026 14:47
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