arrow_backRetour aux issues
Wayfare-labs/wayfare
#1
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Add unit tests for the refrate package
ecoDébutant
help wanted
good first issue
area:tests
difficulty:easy
descriptionDescription
### What
The `refrate` package (reference mid-market rates) has no direct test file — it's only exercised indirectly through `route`. Add focused unit tests.
### Why it matters
`refrate` is a **required** dependency of the engine: without a reference rate the monitor can rank routes but can't tell a good deal from a disaster. That is the single assumption this project exists to check, so its parsing and error paths need direct coverage — a regression should be caught here, not three packages downstream in `route`.
### Where to start
- Read [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) for the invariants, then skim `route/route.go` to see how `refrate` is consumed.
- `refrate/refrate.go` — the `Provider` interface, `Rate` (`Pair()` / `Age()`), the `Static` provider, `ErrNoRate`, and the `Checked` wrapper. `Static` needs no network, so start there.
- `refrate/exchangerate.go` — the live `ExchangeRateAPI`. Test its response parsing with an `httptest.Server` serving canned JSON, never a live call.
- Match the existing test style in `route/route_test.go` and `sep38/sep38_test.go`.
### Acceptance criteria
- [ ] `refrate/refrate_test.go` (and/or `exchangerate_test.go`), table-driven
- [ ] `Static.Rate` returns the right rate for a known pair, and `ErrNoRate` for an unknown one
- [ ] `Rate.Pair()` and `Rate.Age()` covered
- [ ] `ExchangeRateAPI` parsing tested via `httptest.Server`, including a malformed/error path — **no live network in unit tests**
- [ ] `Checked` wrapper behaviour covered
- [ ] Money assertions use `decimal.Decimal`, never `float64`
- [ ] `make test` green; `go test -race ./refrate/...` clean
### Verify before you build
None external — pure Go testing against existing code.
**Difficulty:** easy
Issues similaires
medik8s/fence-agents-remediation
star18
Poids du dépôt moyen
v0.8.0 starts a cluster-scoped Secret informer despite namespace-scoped Secret RBAC
## Description While testing Fence Agents Remediation (FAR) v0.8.0, I observed the manager repeatedly attempting to li…
Go
good first issue
Wayfare-labs/wayfare
star1
Poids du dépôt léger
Check that an issuer's home_domain round-trips to the same stellar.toml
Written to the standard set by #33 — read that issue first for the expected level of detail and the acceptance criteria…
Go
help wanted
area:corridor
Wayfare-labs/wayfare
star1
Poids du dépôt léger
Report auth_immutable: whether an issuer's flags can still change
> **This issue is the reference standard.** Every other check issue links back here for the expected level of detail. I…
Go
help wanted
good first issue