Skip to content

view_functions namespace implementationΒ #6133

@valentinfernandez1

Description

@valentinfernandez1

With the introduction of Metadata V16 there is a new field part of the PalletMetadata, that is view_functions which allows pallets to expose specific query functions that don't change the storage.

They are fairly similar to RuntimeAPI in a sense with the core difference that they are defined directly on the pallet without the need of added the same boiler palte code to impl_runtime_apis! every time we want to add the pallet to a Runtime.

There needs to be a way to easily call such functions from the DAPP developer's perspective, that is why I propose for a new namespace view (e.g. api.view.templatePallet.some_query()) to be added to easily call view functions.

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