Skip to content

Conversation

@krebernisak
Copy link
Collaborator

@krebernisak krebernisak commented Oct 23, 2025

This PR simplifies and makes TL-B - JSON decoding dynamic, and adds a new chainlink-ton-extras Nix pkg to host the explorer bin and other extras (tools) we'd want to package.

nix shell .#chainlink-ton-extras \
  -c explorer https://testnet.tonscan.org/tx/<TXID>

Try this branch directly:

nix shell 'github:smartcontractkit/chainlink-ton?ref=feat/json-decode'#chainlink-ton-extras \
  -c explorer https://testnet.tonscan.org/tx/<TXID> --max-pages 1000

@krebernisak krebernisak requested a review from a team as a code owner October 23, 2025 11:30
@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!

@krebernisak krebernisak changed the title Dynamic msg TL-B - JSON decoding + chainlink-ton-extras pkg (/bin/explorer) Dynamic msg TL-B - JSON decoding + chainlink-ton-extras pkg Oct 23, 2025
Copy link
Collaborator

@patricios-space patricios-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work you did here. The only mistake I noticed is what Nico already pointed out about the error message.

huangzhen1997
huangzhen1997 previously approved these changes Oct 24, 2025

type decoder struct{}

func NewDecoder() lib.ContractDecoder {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll rethink the lib.ContractDecoder as the decoding becomes more dynamic, for now keeping it in this PR to match existing infra.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lib.ContractDecoder implementations are now simplified and made dynamic from bindings TLB types and error code definitions. It's now a thin layer that can potentially be removed in a followup.

I've left it in this PR as the explorer util depends on it - to not introduce more breaking changes.

There's still some custom event decoding left in specific lib.ContractDecoder implementations, but this can also be generalized and removed in a followup.

cc @patricios-space

@krebernisak krebernisak force-pushed the feat/json-decode branch 4 times, most recently from 11293f4 to ef3d01a Compare October 28, 2025 10:59
jadepark-dev
jadepark-dev previously approved these changes Oct 28, 2025
Copy link
Collaborator

@jadepark-dev jadepark-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome, I wonder if we'll need a diff check for generated files

Copy link
Collaborator

@patricios-space patricios-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like some documentation on how to update the generated code, and we need to get rid of the binary. Otherwise, looks good! Explorer decoding is working again 🚀

@krebernisak krebernisak force-pushed the feat/json-decode branch 3 times, most recently from 2d29e83 to 1a32c9a Compare October 29, 2025 20:26
@krebernisak krebernisak force-pushed the feat/json-decode branch 2 times, most recently from 944521d to 261a1ca Compare November 4, 2025 15:21
patricios-space

This comment was marked as duplicate.

Copy link
Collaborator

@patricios-space patricios-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@patricios-space patricios-space merged commit c9212b5 into main Nov 5, 2025
35 checks passed
@patricios-space patricios-space deleted the feat/json-decode branch November 5, 2025 12:44
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.

5 participants