|
2 | 2 |
|
3 | 3 | > **Note:** These guidelines primarily apply to the `gas-benchmarks/` package but can serve as general standards for TypeScript code across the repository. |
4 | 4 |
|
5 | | -## Benchmarks definitions |
6 | | - |
7 | | -- **Shield**: Converting public assets into private ones by depositing them into a privacy pool or protocol. (e.g. shield, bridge, encrypt, etc) |
8 | | -- **Unshield**: Converting private assets back into public ones by withdrawing them from a privacy pool or protocol. (e.g. unshield, bridge, decrypt, etc) |
9 | | -- **Transfer**: Moving private assets from one address to another within the privacy pool or protocol. (e.g. transfer, send, etc) |
10 | | - |
11 | 5 | ## 1. Clean and Concise Code |
12 | 6 |
|
13 | 7 | - Write clean, short code with minimal boilerplate |
|
18 | 12 | - Validated by `src/__tests__/constants.test.ts` |
19 | 13 | - Minimize inline comments - code should be self-explanatory |
20 | 14 | - No `console.log` (prohibited by ESLint) |
| 15 | +- Give space around operators for readability, but avoid unnecessary blank lines |
21 | 16 |
|
22 | 17 | ## 2. Use examples and references in comments |
23 | 18 |
|
|
43 | 38 |
|
44 | 39 | ## 6. Testing Requirements |
45 | 40 |
|
46 | | -- **ALWAYS** run `pnpm run test` and `pnpm run benchmark` after changes |
47 | 41 | - Do NOT complete work without running these verification steps |
48 | 42 | - Fix all test failures and benchmark errors before finalizing |
49 | 43 |
|
| 44 | +# Specific Guidelines for the gas-benchmarks directory |
| 45 | + |
| 46 | +## Rules |
| 47 | + |
| 48 | +- Follow the general guidelines above, with a focus on clarity and maintainability in benchmark code |
| 49 | +- **ALWAYS** run `pnpm run test` and `pnpm run benchmark` after changes in the gas-benchmarks directory |
| 50 | + |
| 51 | +## Benchmarks definitions |
| 52 | + |
| 53 | +- **Shield**: Converting public assets into private ones by depositing them into a privacy pool or protocol. (e.g. shield, bridge, encrypt, etc) |
| 54 | +- **Unshield**: Converting private assets back into public ones by withdrawing them from a privacy pool or protocol. (e.g. unshield, bridge, decrypt, etc) |
| 55 | +- **Transfer**: Moving private assets from one address to another within the privacy pool or protocol. (e.g. transfer, send, etc) |
| 56 | + |
50 | 57 | ## Examples |
51 | 58 |
|
52 | 59 | - Protocol patterns: `src/railgun/index.ts`, `src/tornado-cash/index.ts`, `src/privacy-pools/index.ts` |
53 | 60 | - Protocol specific constants to interact with: `src/railgun/constants.ts`, `src/tornado-cash/constants.ts`, `src/privacy-pools/constants.ts` |
54 | 61 | - Functional programming: `src/utils/utils.ts`, `src/utils/rpc.ts`, `src/index.ts` |
55 | 62 | - Type organization: `src/utils/types.ts`, `src/__tests__/types.ts` |
| 63 | + |
| 64 | +# Specific Guidelines for the project-evaluations directory |
| 65 | + |
| 66 | +## Rules |
| 67 | + |
| 68 | +- Follow the general guidelines above, with a focus on clarity and maintainability in evaluation code |
| 69 | +- **ALWAYS** run `pnpm run build` after changes in the project-evaluations directory unless these are changes only to project-evaluations/data/evaluations.json |
0 commit comments