0xMiden / 0xMiden/protocol

Implement `TryFrom<PartialAccount>` for standard components

Offen
#2,456 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
132
Forks
167
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
110

Beschreibung

Standard components implement `TryFrom` to ease the extraction of components from an account.

As it is right now, some standard components do not require the full account for this and could just implement conversions from storage headers or any related struct (like `PartialAccount`). This applies to any component that does not use storage maps, as `AccountStorageHeader` will have all the necessary storage slots data (ie, all the value slots).

This would allow users to easily extract things like token metadata from the network without having to download the full `Account`, which may have extra roundtrips and data (right now, you can get the header storage with a single `GetAccount` call). Of course, this is doable right now but slots need to be read and parsed manually.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.