You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: fix all broken builds and tests across the repo
Native tests (16/16 passing):
- counter/native & escrow/native: add bn.js as explicit dependency.
pnpm's strict dependency resolution does not hoist transitive deps
(unlike npm), so bn.js from @solana/web3.js is not accessible directly.
- All native tests using borsh: migrate from borsh v0.7 class-based API
to borsh v2 object schema API. The v0.7 API (Map schemas, Assignable
classes, 3-arg deserialize) is incompatible with borsh v1+. Updated 19
test files and 14 package.json files. Introduced a shared
borshSerialize(schema, data) helper to replace the repeated
Buffer.from(borsh.serialize(...)) pattern. Removed per-schema typed
wrappers in favour of exporting schemas directly.
- create-account/native: replace litesvm with solana-bankrun. litesvm's
native binary crashes with SIGABRT on Linux x64
(LiteSVM/litesvm#171). This was the only
native test using litesvm — all others use solana-bankrun, the
recommended framework per CONTRIBUTING.md.
Anchor builds (39/39 passing):
- Set solana_version = "3.1.8" in all 49 Anchor.toml files. Anchor's
default BPF toolchain ships rustc 1.79, but anchor-lang 0.32.1's
dependency tree requires rustc 1.82+ (indexmap 2.13.0) and Cargo's
edition2024 feature. Solana 3.1.8 platform-tools v1.52 (rustc 1.89)
resolves both. All projects now use a consistent toolchain version.
- allow-block-list-token: bump spl-transfer-hook-interface 0.8.2 -> 2.1.0,
spl-tlv-account-resolution 0.8.1 -> 0.11.1, spl-discriminator 0.3 -> 0.5.1.
Old SPL versions used solana-program v1, causing type mismatches with
anchor-lang 0.32.1's v2 types. litesvm Rust test moved to tests-rs/
because litesvm pins solana-account-info =2.2.1 but anchor-lang 0.32.1
needs >=2.3.0 for AccountInfo::resize(). See tests-rs/README.md.
Compression projects (3/3 building):
- Rewrite cnft-burn, cnft-vault, cutils from anchor-lang 0.26.0 to 0.32.1.
Upgrade to mpl-bubblegum 2.1.1 + spl-account-compression 1.0.0 (both
use solana-program v2, matching anchor-lang 0.32.1). cnft-vault: manual
invoke_signed rewritten to TransferCpi. cutils verify: raw invoke because
spl-account-compression 1.0.0's CPI module is built against anchor-lang
0.31, which has incompatible traits with 0.32.1. Discriminator computed
from sha256("global:verify_leaf") rather than hardcoded. Comment
documents when this workaround can be removed.
Documentation:
- README: remove TypeScript/Poseidon references (none exist in repo),
Anchor before Native in badges, fix typos.
- CONTRIBUTING: remove Steel/Python/Solidity/Poseidon references (none
exist in repo), fix markdown, renumber sections.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-48Lines changed: 8 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ To ensure a smooth and effective contribution process, please take a moment to r
10
10
11
11
We welcome contributions in the form of code, documentation, bug reports, feature requests, and other forms of feedback. Here are some ways you can contribute:
12
12
13
-
-**Code Contributions:** You can contribute code examples in Rust, Python, or Solidity that demonstrate various Solana program functionalities. You can also contribute improvements to existing examples, such as bug fixes, optimizations, or additional features.
13
+
-**Code Contributions:** You can contribute code examples in Rust that demonstrate various Solana program functionalities. You can also contribute improvements to existing examples, such as bug fixes, optimizations, or additional features.
14
14
15
15
-**Bug Reports, Ideas or Feedback:** If you encounter any issues or have ideas for new examples, please submit a bug report or feature request. Your feedback is valuable and helps us improve the quality and relevance of the examples.
16
16
@@ -22,40 +22,13 @@ Specifically for code in this repo:
22
22
23
23
1. Use pnpm as the default package manager for the project. You can [install pnpm by following the instructions](https://pnpm.io/installation). Commit `pnpm-lock.yaml` to the repository.
24
24
25
-
2. Solana Programs written for Anchor framework should be in directory (`anchor`)[https://www.anchor-lang.com], Solana Native in (`native`)[https://solana.com/developers/guides/getstarted/intro-to-native-rust], Steel Framework in (`steel`)[https://github.com/regolith-labs/steel], TypeScript in (`poseidon`)[https://github.com/Turbin3/poseidon], respectively.
25
+
2. Solana Programs written for the Anchor framework should be in directory [`anchor`](https://www.anchor-lang.com), Solana Native in [`native`](https://solana.com/developers/guides/getstarted/intro-to-native-rust), respectively.
- Project path structure example for anchor: `/program-examples/category/example-name/anchor`
28
28
29
-
3. Tests for Solana native programs, steel framework programs, and Anchor should be written with [solana-bankrun](https://kevinheavey.github.io/solana-bankrun)
29
+
3. Tests for Anchor and Solana native programsshould be written with [solana-bankrun](https://kevinheavey.github.io/solana-bankrun).
30
30
31
-
4. Steel framework programs must be organized as a Cargo workspace with separate projects for API and program:
- Must be a Cargo workspace with two separate projects:
35
-
-`api`: Contains API-related code
36
-
-`program`: Contains the program implementation
37
-
- Steel projects should NOT be added in the root [`Cargo.toml` file](https://github.com/solana-developers/program-examples/blob/main/Cargo.toml)
38
-
39
-
This structure ensures proper organization and separation of concerns.
40
-
41
-
5. For Steel framework programs:
42
-
- Steel CLI is the recommended way to build and test programs:
43
-
```bash
44
-
# Install Steel CLI (one-time setup)
45
-
cargo install steel-cli
46
-
47
-
# Create a new Steel project
48
-
steel new <name>
49
-
50
-
# Build the program
51
-
steel build
52
-
53
-
# Run tests
54
-
steel test
55
-
```
56
-
- Alternatively, you can use package.json scripts if you need custom build/test configurations as Solana native one described below.
57
-
58
-
6. For Solana native programs ensure adding these mandatory pnpm run scripts to your `package.json` file for successful CI/CD builds:
31
+
4. For Solana native programs ensure adding these mandatory pnpm run scripts to your `package.json` file for successful CI/CD builds:
59
32
60
33
```json
61
34
"scripts": {
@@ -66,35 +39,22 @@ Specifically for code in this repo:
66
39
},
67
40
```
68
41
69
-
Alternatively, You can add `steel test` and `steel build` as commands according to your project.
70
-
71
-
"scripts": {
72
-
"test": "steel test",
73
-
"build-and-test": "steel build && steel test",
74
-
"build": "steel build",
75
-
"deploy": "solana program deploy ./program/target/so/program.so"
76
-
},
77
-
78
-
7. Test commandforAnchor should execute `pnpm test` instead of `yarn run test` for anchor programs. Replace `yarn` with `pnpm`in`[script]` table inside [Anchor.toml file.](https://www.anchor-lang.com/docs/manifest#scripts-required-for-testing)
42
+
5. Test command for Anchor should execute `pnpm test` instead of `yarn run test` for anchor programs. Replace `yarn` with `pnpm` in `[script]` table inside [Anchor.toml file.](https://www.anchor-lang.com/docs/manifest#scripts-required-for-testing)
79
43
80
44
```
81
45
[scripts]
82
46
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
83
47
```
84
48
85
-
8. TypeScript, JavaScript and JSON files are formatted and linted using
49
+
6. TypeScript, JavaScript and JSON files are formatted and linted using
86
50
[Biome](https://biomejs.dev/). Execute the following command to format and lint your code at the root of this project before submitting a pull request:
87
51
88
-
8. Some projects can be ignored from the building and testing process by adding the project name to the `.ghaignore` file.
89
-
When removing or updating an example, please ensure that the example is removed from the `.ghaignore` file
90
-
and there's a change in that example's directory.
91
-
92
52
```bash
93
53
pnpm fix
94
54
```
95
55
96
-
9. Some projects can be ignored from the building and testing process by adding the project name to the `.gitignore` file.
97
-
When removing or updating an example, please ensure that the example is removed from the `.gitignore` file
56
+
7. Some projects can be ignored from the building and testing process by adding the project name to the `.ghaignore` file.
57
+
When removing or updating an example, please ensure that the example is removed from the `.ghaignore` file
0 commit comments