Skip to content

Update examples with input JSON files for ledger tool#43

Merged
failfmi merged 18 commits intoLimeChain:mainfrom
ERoydev:add/input-instruction-files
Aug 15, 2025
Merged

Update examples with input JSON files for ledger tool#43
failfmi merged 18 commits intoLimeChain:mainfrom
ERoydev:add/input-instruction-files

Conversation

@ERoydev
Copy link
Copy Markdown
Collaborator

@ERoydev ERoydev commented Aug 13, 2025

What

  • I have added the input JSON files for the examples.
  • I have added test cases in every example that show how our npm package approach is used.
  • This is just a proposal because:
    • I have tried to avoid the npm package approach, but it's not possible to invoke instructions from our VS Code extension.
    • I cannot call vscode.command from a Node test (the Anchor ts-mocha tests) because Node doesn’t provide the VS Code extension host environment.
    • Its not good approach either to make user to copy paste the code locally.
    • The npm package looks more appropriate

Note

  • All these JSON examples are generated using this npm package.
  • In Anchor tests, we can generate the instruction data using Anchor commands, which handle all the Borsh serialization.
    This ensures there will be no mistakes.
  • This approach of automatic input generation works only for Anchor projects.

Overall

  • I think this approach is fine since i have tested in on anchor-example where we have different PDA code logic and it works without any errors (even the agave-ledger-tool Violation ones).
  • I still should try to test it on even more complicated code.

@ERoydev ERoydev requested a review from failfmi August 13, 2025 12:26
@ERoydev ERoydev force-pushed the add/input-instruction-files branch from 5271191 to e17737d Compare August 15, 2025 07:11
@failfmi failfmi merged commit bd4cc6f into LimeChain:main Aug 15, 2025
@ERoydev ERoydev deleted the add/input-instruction-files branch October 6, 2025 10:03
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