Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

TryState: automatically execute after each migration #12130

Closed

Description

@kianenigma

Not automatically yet, I think it is okay to leave it up to the pallet to do so, which is what you are seeing here.

We can make a follow-up and once try_state is a bit more standard, make it execute upon all migrations.

Originally posted by @kianenigma in #10174 (comment)


Ofc, IFF feature = try-runtime

Activity

  1. changed the title [-]`TryState`: automatically execute after each mogration[/-] [+]`TryState`: automatically execute after each migration[/+] on Aug 29, 2022
  2. kianenigma commented on Oct 11, 2022

    @kianenigma
    ContributorAuthor

    wild dream: have a standard testing framework, call it automatically after each TEST.

  3. kianenigma commented on Oct 18, 2022

    @kianenigma
    ContributorAuthor

    To achieve executing this after each test:

    have a new macro construct_runtime_with_ext_builder.

    This generates, per pallet (e.g. staking)

    1. For each filed of GenesisBuild, a struct StakingBuilder { genesis_field_1, genesis_filed_2, .. }
    2. For each type in Config that's Get<u32>, a parameter_types! { static Config1: _ = .., Config2: _ = .. }
    3. And setter functions for all of the above.

    lastly, it implements functions such as build and execute_with on Runtime, so at the end we would do:

    Runtime::build().exeucte_with(|| {
      
    }) 
    

    in each test.

    and this Runtime::execute_with would execute try_state() of the pallet after each test.

    I really like this idea. It solves legacy issues like paritytech/polkadot-sdk#367. The shitty thing about this is more hidden code, more magic, flying in the face of paritytech/polkadot-sdk#32.

  4. Repository owner moved this from Backlog to Done in Runtime / FRAMEon Dec 14, 2022
  5. Repository owner moved this from 📕 Backlog to ✅ Done in (Nominated) Proof of Stakeon Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions