CLI: Add --export-encoding instruction-list mode#53
Open
aoikurokawa wants to merge 3 commits intosolana-program:mainfrom
Open
CLI: Add --export-encoding instruction-list mode#53aoikurokawa wants to merge 3 commits intosolana-program:mainfrom
--export-encoding instruction-list mode#53aoikurokawa wants to merge 3 commits intosolana-program:mainfrom
Conversation
--export-encoding instruction-list mode--export-encoding instruction-list mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
instruction-listas a new value for the--export-encodingCLI option, alongside the existingnone|utf8|base58|base64choices.--export-encoding instruction-list, output remains exactly the raw encoded transaction so downstream tooling that consumes the bytes is not affected.Motivation
Per review feedback, the instruction-list view is useful for humans inspecting what a
--exported transaction will do, but it pollutes output for users who only need the raw transaction bytes (e.g. piping into another tool). Making it a separate export mode lets each use case stay clean.Changes
clients/js/src/cli/options.ts: introduceExportEncoding = Encoding | 'instruction-list', addinstruction-listto--export-encodingchoices, and update the parser.clients/js/src/cli/utils.ts: branch inexportTransactionPlan— print the instruction list wheninstruction-listis selected, otherwise print only the encoded transaction (no instruction list).clients/js/src/cli/logs.ts:logExportsaccepts the newExportEncodingtype and renders"... as an instruction list"vs."... in <encoding>".node bin/cli.cjs write \ idl ... \ --buffer ... \ --export ... \ --export-encoding instruction-list \ --close-buffer ...