refactor(token-2022/transfer-fee): encode instruction data with kit codecs - #681
Conversation
…odecs Build the CreateToken instruction data with @solana/kit codecs (getStructEncoder + getU8Encoder) instead of the borsh package, and drop the borsh dependency. Matches the approach used in default-account-state (solana-foundation#675) and pda-mint-authority, keeping the pinocchio token-2022 examples consistent. No on-chain change; the litesvm test passes unchanged.
Greptile SummaryThe PR replaces Borsh serialization of the one-byte
Confidence Score: 4/5The code change appears behaviorally safe, but the unsigned commit must be re-signed and verified before merging. The Kit encoder emits the same single-byte decimals argument consumed by the program, and the dependency cleanup is consistent; the remaining merge blocker is that the only pull-request commit has no signature. Important Files Changed
Reviews (1): Last reviewed commit: "refactor(token-2022/transfer-fee): encod..." | Re-trigger Greptile |
| @@ -11,7 +11,6 @@ | |||
| "@solana-program/token-2022": "^0.12.0", | |||
| "@solana/kit": "^7.0.0", | |||
| "@solana/sysvars": "^6.10.0", | |||
There was a problem hiding this comment.
Commit fc36eed0976c4e1d3b8c4809c34a393980b83692 has no cryptographic signature, so this pull request does not satisfy the repository requirement that every commit be signed and verified. Re-sign the commit before merging.
Context Used: Request changes if the commits are not signed (ver... (source)
There was a problem hiding this comment.
This is a false positive — the commit is signed and GitHub reports it verified. gh api repos/solana-foundation/program-examples/pulls/681/commits returns verification.verified = true, reason = valid for fc36eed0, signed with my registered ED25519 SSH key (SHA256:UVyyOf24fM8y73sfUoms0okbKMJobxlKQjwweQs4BhU); the commit shows a Verified badge in the PR. No re-sign needed.
There was a problem hiding this comment.
You're right, I apologize for the false positive. GitHub confirms fc36eed carries a valid ED25519 SSH signature (verification.verified = true, reason = valid), and the Verified badge on the commit reflects that. My original comment was incorrect — no action needed.
Follow-up consistency cleanup on the merged
token-2022/transfer-fee/pinocchioexample.Builds the
CreateTokeninstruction data with@solana/kitcodecs (getStructEncoder+getU8Encoder) instead of theborshnpm package, and drops theborshdependency. This matches the pattern applied indefault-account-state(#675, @amilz) andpda-mint-authority, keeping the pinocchio token-2022 examples consistent.No on-chain change — the litesvm test passes unchanged (verified on the Linux/SBF path).