Skip to content

fix: wire reputation_badge to solver_registry, add webhook relay tests, generalize Makefile, complete CODEOWNERS (#512 #513 #514 #515) - #630

Merged
techisigu merged 1 commit into
stellar-vortex-protocol:mainfrom
Good-Coded:fix/issues-512-513-514-515
Oct 24, 2026
Merged

techisigu merged 1 commit into
stellar-vortex-protocol:mainfrom
Good-Coded:fix/issues-512-513-514-515

Conversation

@Good-Coded

Copy link
Copy Markdown

Closes #512
Closes #513
Closes #514
Closes #515

Summary

Resolves four self-documented gaps in a single pass.


#512 — Wire reputation_badge mint/burn to solver_registry tier computation

The crate's own module doc stated this work was deferred until solver_registry (issue #1) existed. Issue #1 is closed; this PR completes the follow-up.

reputation_badge/src/lib.rs:

  • mint_badge(caller, solver, tier) and burn_badge(caller, solver) now accept an explicit caller: Address and authorise it against either the admin or the registered solver_registry contract, replacing the admin-only placeholder.
  • New set_solver_registry(solver_registry) (admin-only) lets operators wire or rotate the registry address post-deploy without redeploying the badge contract.
  • New get_solver_registry() read view.
  • initialize accepts solver_registry: Option<Address> so the badge contract can be deployed before the registry is live.

reputation_badge/src/test.rs:

  • Tests for registry-driven mint, burn, and tier upgrade flows.
  • #[should_panic] guards verifying an unknown address is rejected by both entrypoints.
  • All pre-existing mutation-killing assertions retained and updated for the new signature.

#513 — Add test suite for examples/events-webhook-relay

The example shipped with zero tests despite 352 lines of non-trivial logic.

src/index.ts: export loadConfig, EventRelay, main; make stop() public; add expressApp getter; gate top-level main() behind an ESM entry-point check so importing the module in tests does not start the server.

src/__tests__/index.test.ts (new) — 6 describe blocks, ~30 assertions:

  • loadConfig — defaults, env-var overrides, numeric coercion
  • Constructor / validateConfig — rejects empty CONTRACT_ID, empty/invalid WEBHOOK_URL
  • Express routes — /health shape & cursor reflection; /stats contract/webhook fields
  • relayEvent — happy-path POST, retry on transient error, drop after max retries, retry on non-2xx
  • pollEvents — cursor advances on events, stays put on empty result, survives RPC failure
  • start/stop — flag transitions

vitest.config.ts (new): Node environment, targets src/**/__tests__/**/*.test.ts.

package.json: added test and test:watch scripts; added vitest, @vitest/coverage-v8, supertest, @types/supertest to devDependencies.


#514 — Generalize the Makefile beyond intent_settlement

make test previously silently only ran tests in one of twelve crates.

Makefile:

  • ALL_CRATES (all 12 workspace members) and WASM_CRATES (11 cdylib crates; vortex-common excluded from build).
  • Workspace-wide fmt, fmt-check, lint, test, build, audit, clean loop over every crate — make all is a genuine full-repo check.
  • Per-crate targets (<crate>-fmt, <crate>-lint, <crate>-test, <crate>-build, <crate>-audit, <crate>-clean, <crate>-all) auto-generated via define/eval macro; adding a new crate requires one line.
  • Removed the now-redundant hand-written proof-registry-* block.
  • All other targets (kani, proptest, local-network-*, integration-test, error-reference, deploy-testnet, help) unchanged.

#515 — Add CODEOWNERS entries for the eight previously uncovered crates

.github/CODEOWNERS:

Crate Reviewer team
reputation_badge/src/ solver-registry-reviewers
governor/src/ governance-reviewers
backstop_vault/src/ intent-settlement-reviewers
fee_router/src/ intent-settlement-reviewers
intent_periphery/src/ intent-settlement-reviewers
treasury_streams/src/ intent-settlement-reviewers
timelock/src/ governance-reviewers
vortex-common/src/ maintainers

Testing

  • reputation_badge: cd reputation_badge && cargo test
  • events-webhook-relay: cd examples/events-webhook-relay && npm install && npm test
  • Makefile: make fmt-check now iterates all 12 crates
  • CODEOWNERS: git check-attr -a -- reputation_badge/src/lib.rs

…ol#513 stellar-vortex-protocol#514 stellar-vortex-protocol#515

stellar-vortex-protocol#512 — Wire reputation_badge to solver_registry tier computation
- Add `caller` param to `mint_badge`/`burn_badge`; accept either the
  admin or the registered solver_registry contract as the caller.
- Add `set_solver_registry` (admin-only) and `get_solver_registry` view.
- `initialize` now takes an optional `solver_registry: Option<Address>`
  so the badge contract can be deployed before the registry is live.
- Update test.rs: registry-driven mint/burn, tier upgrade, unknown-caller
  panic guards, and all pre-existing mutation-killing assertions.

stellar-vortex-protocol#513 — Add test suite for examples/events-webhook-relay
- Export `loadConfig`, `EventRelay`, `main` from src/index.ts.
- Make `stop()` public; expose `expressApp` getter for route testing.
- Gate top-level `main()` call behind an ESM entry-point check so
  importing the module in tests does not start the server.
- Add src/__tests__/index.test.ts: 6 describe blocks (~30 assertions)
  covering loadConfig env-var parsing, constructor validation, Express
  /health and /stats routes, relayEvent retry/drop logic, pollEvents
  cursor advancement, and start/stop flag transitions.
- Add vitest.config.ts (Node environment, no DOM).
- Add `test`/`test:watch` scripts and vitest + supertest dev-deps to
  package.json.

stellar-vortex-protocol#514 — Generalize Makefile beyond intent_settlement
- Introduce ALL_CRATES (all 12 workspace members) and WASM_CRATES (the
  11 cdylib crates).
- Workspace-wide `fmt`, `fmt-check`, `lint`, `test`, `build`,
  `audit`, `clean` targets now loop over every crate — `make all`
  gives a genuine full-repo check.
- Per-crate targets (`<crate>-fmt`, `<crate>-lint`, etc.) generated
  automatically via a `define`/`eval` macro so adding a new crate
  requires only one line change.
- Remove the now-redundant hand-written `proof-registry-*` block.

stellar-vortex-protocol#515 — Add CODEOWNERS entries for the eight previously uncovered crates
- reputation_badge, governor, backstop_vault, fee_router, intent_periphery,
  treasury_streams, timelock, and vortex-common all now have explicit
  path-based entries routed to the appropriate reviewer team rather than
  falling through to the generic maintainers default.
@techisigu
techisigu merged commit dd33da3 into stellar-vortex-protocol:main Oct 24, 2026
0 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants