Commit cfcbbde
apollo_l1_gas_price_types,apollo_l1_gas_price: expose get_strk_to_usd_rate
Goal: PR 3 of 6 in the stack moving the STRK/USD oracle into
L1GasPriceProvider. Surfaces the inherent method added in PR 2 on
the client trait so cross-process callers (notably the consensus
orchestrator in PR 5) can request a STRK/USD rate without holding
their own oracle.
Change summary:
- New `L1GasPriceRequest::GetStrkToUsdRate(u64)` variant.
- New `L1GasPriceResponse::GetStrkToUsdRate(L1GasPriceProviderResult<u128>)`
variant.
- New `L1GasPriceProviderClient::get_strk_to_usd_rate` trait method,
implemented on the blanket impl mirroring `get_rate`.
- Server-side dispatch arm in `apollo_l1_gas_price::communication`
routes to `L1GasPriceProvider::strk_to_usd_rate`.
Decision points:
- Did not rename the existing `get_rate` (which dispatches to
`GetEthToFriRate`) for symmetry; out of scope per the stack plan
and would churn unrelated call sites in consensus orchestrator.
The trait now has slightly asymmetric naming: `get_rate` (ETH/FRI)
vs `get_strk_to_usd_rate`. Renaming is a separate cleanup if
desired.
- `MockL1GasPriceProviderClient` is automock-generated and picks up
the new method automatically.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c997caa commit cfcbbde
2 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| |||
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
174 | 191 | | |
175 | 192 | | |
176 | 193 | | |
| |||
0 commit comments