0xMiden / 0xMiden/protocol

Allow users to extend `SchemaTypeRegistry`

Abierto
#2,210 3 comentarios 0 reacciones 0 asignados Ver en GitHub
standards
Lenguaje dominante
Rust
Estrellas
132
Forks
167
Merge medio
1 d 23 h
PR fusionados (30 d)
110

Descripción

`SchemaTypeRegistry` provides a way to register data types (either `Word` or `Felt` sized) that can later be parsed from string or displayed in a human readable form. This is mostly based on whether the types implement a specific trait which defines this functionality.

[Currently](https://github.com/0xMiden/miden-base/blob/next/crates/miden-protocol/src/account/component/storage/type_registry.rs#L20), types are hardcoded and the registry itself is not extensible. We need to find a way to let users extend the registry with their own types so that applications can interpret storage data and display it accordingly. Some things to keep in mind:

- We'll need to pass a reference to `SchemaTypeRegistry` around when serializing/deserializing account component metadata
- Not sure whether leveraging https://github.com/0xMiden/compiler/issues/789 is possible, but for user-compiled types this would be great to have

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.