87 lines
2.8 KiB
Markdown
87 lines
2.8 KiB
Markdown
<!-- file: deltas/0.2.11/pre.004-fix.001.md -->
|
|
<!-- version: 1 -->
|
|
|
|
# Delta `0.2.11-pre.004-fix.001` — Gate statique, Clippy et fixture CoinMarketCap V2
|
|
|
|
## 1. Base requise
|
|
|
|
Ce correctif s'applique exclusivement après `0.2.11-pre.004`.
|
|
|
|
Version Cargo attendue à l'entrée :
|
|
|
|
```text
|
|
0.2.11-pre.4
|
|
```
|
|
|
|
Version Cargo de sortie :
|
|
|
|
```text
|
|
0.2.11-pre.4.fix.1
|
|
```
|
|
|
|
## 2. Motif du correctif
|
|
|
|
Le gate opérateur du `2026-08-25` a produit :
|
|
|
|
```text
|
|
cargo fmt --all exécuté
|
|
audit Rust workspace 1 x RUST-FMT-104
|
|
audit Markdown PASS, 118 tables / 108 files
|
|
cargo check --workspace PASS
|
|
cargo clippy --workspace --all-targets 2 warnings collapsible_if
|
|
cargo test -p ksp-offchain-transport-lib FAIL, 30 PASS / 1 FAIL
|
|
```
|
|
|
|
L'unique test en échec était `coinmarketcap_v2_fixture_normalizes_string_status_and_exact_price`.
|
|
|
|
## 3. Corrections
|
|
|
|
### Ordre des constantes
|
|
|
|
Le bloc `ERROR_CODE_*` de `src/error.rs` est remis dans l'ordre alphabétique complet attendu par `RUST-FMT-104`. Aucun code textuel ni domaine d'erreur ne change.
|
|
|
|
### Clippy
|
|
|
|
Les builders CoinGecko et CoinMarketCap remplacent les deux `if let` imbriqués par des `let`-chains. La logique reste identique : le header sensible n'est ajouté que lorsqu'une clé est présente et toute erreur d'insertion est retournée immédiatement.
|
|
|
|
### Fixture CoinMarketCap V2
|
|
|
|
La fixture concaténée omettait le guillemet ouvrant de la clé JSON `last_updated` :
|
|
|
|
```text
|
|
avant : ...,151.987654321012345678,last_updated...
|
|
après : ...,151.987654321012345678,"last_updated"...
|
|
```
|
|
|
|
Le parser CoinMarketCap, les DTOs wire, l'endpoint Simple Price V2 et le contrat exact du prix ne sont pas modifiés.
|
|
|
|
## 4. Fichiers modifiés
|
|
|
|
```text
|
|
Cargo.toml
|
|
crates/ksp-offchain-transport-lib/src/error.rs
|
|
crates/ksp-offchain-transport-lib/src/market_price_coingecko.rs
|
|
crates/ksp-offchain-transport-lib/src/market_price_coinmarketcap.rs
|
|
crates/ksp-offchain-transport-lib/unit_tests/market_price_coinmarketcap.rs
|
|
docs/plans/018-V0_2_11_OFFCHAIN_PRICE_TRANSPORT_PLAN.md
|
|
docs/validation/014-V0_2_11_OFFCHAIN_PRICE_TRANSPORT.md
|
|
deltas/0.2.11/pre.004-fix.001.md
|
|
```
|
|
|
|
## 5. Gate opérateur requis
|
|
|
|
```bash
|
|
cargo fmt --all
|
|
python3 scripts/audit_rust_workspace_rules.py
|
|
python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates deltas/0.2.11
|
|
cargo check --workspace
|
|
cargo clippy --workspace --all-targets
|
|
cargo test -p ksp-offchain-transport-lib
|
|
```
|
|
|
|
`cargo test --workspace` reste recommandé avant poursuite lorsque le temps opérateur le permet.
|
|
|
|
## 6. Hors scope
|
|
|
|
Aucun provider supplémentaire, registry, Config, refresh multiple, live smoke, changement d'endpoint ou changement de rate limit n'est introduit.
|