Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to change a pallet's constant? #594

Closed
laurogripa opened this issue Dec 13, 2023 · 4 comments
Closed

Is it possible to change a pallet's constant? #594

laurogripa opened this issue Dec 13, 2023 · 4 comments

Comments

@laurogripa
Copy link

Hey, folks!

I'm working on adapting Kusama's interfaces to reflect the changes done to the Society pallet (see Gav's PR)

I'm experimenting with Chopsticks lately to make my life easier and I think it's great!

But I think I hit a roadblock... I'm trying to create my own config to set some initial state for the society, I managed to change the storage fairly easily but now I need to change some constants too, both VotingPeriod and ChallengePeriod, but they seem to be hardcoded on the runtime ☹️

What are my options here?

  • Is there an easy way to change constants through Chopsticks without a runtime upgrade?
  • If no, is there an easy way to do a runtime upgrade?
  • I thought about adding Sudo, but when I tried this I got this error: Error: Cannot find pallet Sudo. Is there a way to load the Sudo pallet again on Kusama?

Thanks!

@ermalkaleci
Copy link
Collaborator

  • unfortunately constants are part of the runtime so can't be changed
  • you can use option --wasm-override to run your custom runtime
  • you can't added storage for a module that doesn't exists

@ermalkaleci
Copy link
Collaborator

@laurogripa you don't really need sudo when you can modify storage or use --mock-signature-host

@xlc
Copy link
Member

xlc commented Dec 13, 2023

You can use scheduler to dispatch root origin call to perform runtime upgrade https://hackmd.io/6bKd532rTdaxVX0hmGXX7g#Dispatch-Call

but 99% of the time wasm override is enough

@laurogripa
Copy link
Author

@ermalkaleci @xlc

Oh, perfect!

I read the docs and the code looking for something with runtime but ended up overlooking the wasm-override parameter. It worked like a charm, just had to build my own custom runtime and point to it.

you can't added storage for a module that doesn't exists

I know, I know, what I meant is if there was a way to use Chopsticks to load a module that was removed, but wasm-override did the trick anyway :)

I'm going to close this issue as it's solved for me.

Thanks a lot for you attention in such a short time.
This project is awesome! 💟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants