Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,3 @@
*If yes, note details:*
> [Provide details here]

## Snapshot policy

- [ ] If snapshot files under `contracts/test_snapshots/` changed, I reviewed the diff and confirmed every change is intentional
- [ ] If snapshot drift was reported in CI, I either regenerated snapshots or marked the drift as expected in the PR description
14 changes: 0 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,6 @@ jobs:
- name: Benchmark report (cost/gas regression guardrails)
run: cargo test --package xelma-contract cost_benchmarks --locked -- --nocapture

- name: Snapshot drift detection
run: |
if [ -d "contracts/test_snapshots" ] && ls contracts/test_snapshots/*.snap 1>/dev/null 2>&1; then
echo "--- Snapshot drift check ---"
echo "Snapshot golden files exist. To regenerate intentionally:"
echo " ./scripts/update_snapshots.sh"
echo ""
echo "If you did not intend to change snapshots, check for accidental"
echo "storage or event mutations in your branch."
echo "---"
else
echo "No snapshot golden files to check."
fi

- name: Run cargo clippy
run: cargo clippy --workspace --all-targets --locked -- -D warnings

Expand Down
27 changes: 0 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,33 +110,6 @@ cd Xelma-Blockchain
pip install pre-commit
pre-commit install
```
## Snapshot Tests

The project uses storage-snapshot golden files (`contracts/test_snapshots/`) to detect
unintentional changes to contract state, event emissions, and error behavior.

### When snapshots should change

- You modified contract logic, storage keys, event payloads, or error variants.
- You made non-semantic refactors that still cause snapshot output to differ (rare).

### When snapshots should NOT change

- Your change is in an unrelated module, test infrastructure, or documentation.
- CI reports snapshot drift that you did not intend — investigate before regenerating.

### Updating snapshots

After an intentional behavior change, regenerate golden files from the repo root:

```bash
./scripts/update_snapshots.sh
```

Then review the diff, run the full suite, and commit the updated snapshots alongside
your logic change. See [`contracts/test_snapshots/README.md`](./contracts/test_snapshots/README.md)
for a step-by-step guide.

## Security Checks (local)

The CI `security-audit` job runs two checks that maintainers and contributors can reproduce locally.
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ Xelma-Blockchain/
│ │ ├── ttl_tests.rs
│ │ └── windows.rs
│ │ └── ... (20+ test files total — see docs/CONTRIBUTOR_MAP.md)
│ ├── Cargo.toml # Rust dependencies
│ └── test_snapshots/ # Test execution records
│ └── Cargo.toml # Rust dependencies
├── bindings/ # TypeScript bindings (auto-generated)
│ ├── src/
Expand Down Expand Up @@ -770,7 +769,6 @@ This repository contains both source files and generated artifacts. Understandin
- **`target/`** - Rust build outputs (WASM binaries, compiled Rust)
- **`bindings/dist/`** - Compiled TypeScript output (JavaScript + type definitions)
- **`node_modules/`** - npm dependencies
- **`contracts/test_snapshots/`** - Test execution records (generated during tests)
- **`contracts/proptest-regressions/`** - Property test regression files (generated during tests)
- **`.soroban/`** - Soroban CLI artifacts

Expand Down Expand Up @@ -806,14 +804,14 @@ cd ../contracts
cargo test
```

> **Note:** Test snapshots and proptest regressions are automatically generated when running tests. These files help ensure test consistency but should not be committed.
> **Note:** Proptest regression files are automatically generated when running tests. These files help ensure test consistency but should not be committed.

#### Before Submitting a PR:

1. **Verify no build artifacts are staged:**
```bash
git status
# Ensure target/, bindings/dist/, node_modules/, test_snapshots/, proptest-regressions/ are not listed
# Ensure target/, bindings/dist/, node_modules/, proptest-regressions/ are not listed
```

2. **If you modified the contract**, regenerate bindings:
Expand Down
63 changes: 0 additions & 63 deletions scripts/update_snapshots.sh

This file was deleted.