separate `WebClient` and `MockWebClient` in the rust section
- Lenguaje dominante
- TypeScript
- Estrellas
- 1
- Forks
- 21
- Merge medio
- 12 h 14 min
- PR fusionados (30 d)
- 41
Descripción
After merging 0xMiden/miden-client#1096, the access to the `MockRpcApi` is done via the functions in `crates/web-client/src/mock.rs` which belong to the `WebClient` struct. Ideally we would want these functions to only be accesible if the client uses a mocked RPC api.
This will require some refactoring, we should try to reduce code duplication, we wouldn't want all the logic to be copied twice.
> I wonder if this should be a fully separate class. I think this would allow for better separation (for example, the `serialize_mock_chain()` call would not be included for `WebClient`; and maybe we could have other helpers that are only available for the mocked client). Of course, this probably implies changing the service worker and some other parts f the JS side. If you agree, let's open an issue to track this.
_Originally posted by @igamigo in https://github.com/0xMiden/miden-client/pull/1096#discussion_r2271161967_
Guía de contribución
Línea de trabajo
The issue is about refactoring the Rust web client to separate `WebClient` and `MockWebClient`. Start by examining `crates/web-client/src/mock.rs` and the `WebClient` struct to understand the current coupling. Look for traits or conditional compilation to reduce duplication. Changes will also affect the JavaScript side, including the service worker. 'Done' means the mock-specific functions are only accessible when using a mocked RPC API, without significant code duplication.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust, typescript
- Área
- backend, tooling
- Tipo de issue
- Refactorización
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100