Skip to content

Implement TryFrom<PartialAccount> for standard components #2456

@igamigo

Description

@igamigo

Standard components implement TryFrom<Account> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions