Skip to content

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

Closed
GoodnessJohn wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
GoodnessJohn:fix/issues-512-513-514-515
Closed

GoodnessJohn wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
GoodnessJohn:fix/issues-512-513-514-515

Conversation

@GoodnessJohn

Copy link
Copy Markdown
Contributor

Summary

Resolves four self-documented gaps in a single pass: #512, #513, #514, #515.


#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.

Changes — 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.

Changes — reputation_badge/src/test.rs:

  • Added tests for registry-driven mint, burn, and tier upgrade flows.
  • Added #[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.

Changes — examples/events-webhook-relay/:

  • 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 covering:
    • loadConfig — defaults, env-var overrides, numeric coercion
    • Constructor / validateConfig — rejects empty CONTRACT_ID, empty WEBHOOK_URL, invalid URL
    • Express routes — /health shape, cursor reflection, running flag; /stats contract/webhook fields
    • relayEvent — happy path POST, retry on transient error, drop after max retries, no retry on 2xx, retry on non-2xx status
    • pollEvents — cursor advances on events, stays put on empty result, survives RPC failure
    • start/stop — flag transitions
  • vitest.config.ts (new): Node environment, includes 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.

Changes — Makefile:

  • Introduce ALL_CRATES (all 12 workspace members) and WASM_CRATES (the 11 cdylib crates; vortex-common excluded from build).
  • Workspace-wide fmt, fmt-check, lint, test, build, audit, clean now 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) generated automatically via define/eval macro; adding a new crate requires only one line in ALL_CRATES.
  • Removed the now-redundant hand-written proof-registry-* block (replaced by auto-generated proof_registry-* rules).
  • All other targets (kani, proptest, local-network-*, integration-test, error-reference, deploy-testnet, help) are unchanged.

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

Changes — .github/CODEOWNERS:

Added explicit path-based entries for all eight crates that previously fell through to the generic * @stellar-vortex-protocol/maintainers default:

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: make reputation_badge-test (or cd reputation_badge && cargo test)
  • events-webhook-relay: cd examples/events-webhook-relay && npm test (after npm install)
  • Makefile smoke-check: make fmt-check now iterates all crates cleanly
  • CODEOWNERS: verify with git check-attr -a -- reputation_badge/src/lib.rs

Checklist

  • All changes are on a single branch (fix/issues-512-513-514-515)
  • One atomic commit with a conventional-commit message referencing all four issues
  • No new external dependencies added to Rust crates
  • Test additions follow existing conventions (soroban testutils for Rust, vitest for TS)

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant