fix: repair three CI-broken native programs#631
Open
NikkiAung wants to merge 2 commits into
Open
Conversation
Comment on lines
138
to
143
| try { | ||
| await client.processTransaction(tx); | ||
| console.error("Expected the test to fail"); | ||
| assert(false, "Expected transaction to fail with wrong PDA seeds"); | ||
| } catch (_err) { | ||
| assert(true); | ||
| } |
There was a problem hiding this comment.
Negative test always passes — assertion swallowed by catch
assert(false, ...) inside the try block throws an AssertionError, but the catch (_err) clause catches it indiscriminately and then calls assert(true), so the test passes whether processTransaction succeeds or throws. If the program ever stops rejecting wrong seeds, this test will still show green. Consider restructuring to hoist the assertion outside the catch:
let failed = false;
try {
await client.processTransaction(tx);
} catch {
failed = true;
}
assert(failed, "Expected transaction to fail with wrong PDA seeds");
2 tasks
NikkiAung
force-pushed
the
fix/ci-broken-native-programs
branch
from
July 21, 2026 00:40
c137f1e to
10ca60c
Compare
Author
|
@dev-jodee All commits have been re-signed with an SSH signing key and now show as Verified on GitHub. Thanks for the heads up! |
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
borsh 1.5.7→1.6.1,borsh-derive 1.5.7→1.6.1,solana-program 3.0→4.0in hand and leverCargo.toml— the isolated workspace was pinning stale versions that conflict with the rest of the workspacets/from borsh v1 Map-based API to borsh v2{struct:...}schema; add missing"borsh": "^2.0.0"direct dependency (it was absent frompackage.json, making the import unresolvable); fixisSigner: false→trueon target account increateCreateInstruction(was causingMissingRequiredSignatureon thecreate_accountCPI); fix CJSrequire("node:fs")→ ESM import inutil.tsu64assertion (new BN(number as Buffer, "le")→Number(favoritesData.number)since borsh v2 deserializes u64 as bigint); fix "wrong seeds" test which was deriving the correct PDA and expecting failure — changed to use a genuinely wrong seed so the on-chain check actually rejects itTest plan
pnpm build-and-testforcross-program-invocation/native— Rust build with updated deps passes, TS test passespnpm build-and-testforrealloc/native— Rust build passes, borsh v2 serialization works at runtime,create_accountCPI succeeds with correct signer flagfavorites/nativetest logic fixes visible in diff; full CI validation pending.ghaignoreremoval once bankrun/SBF compatibility is confirmed on current platform-tools