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

update mb-sessions, add unit tests #141

Closed
wants to merge 9 commits into from
Closed

Conversation

4meta5
Copy link
Contributor

@4meta5 4meta5 commented Dec 17, 2020

What does it do?

  • some small changes to improve readability i.e. replacing tuples (anonymous structs) with named structs
  • move some constants to be in the module's Config instead of imported from the runtime (so still configured in the runtime, just in a more intuitive location)
  • adds mock runtime

TODO (in-progress)

  • unit test mb-session
  • may change Treasury storage item and also remove the Vec<AccountId> for validators to use IterableStorageMap api instead to get the same functionality without the additional storage item

What important points reviewers should know?

I changed the crypto module in mb-sessions to only use sp_core::ecdsa as per the changes in #127 (I made this change in this commit: d732df2 ).

Is there something left for follow-up PRs?

I'll add unit tests to the other pallets as well. It is a good exercise for reviewing the runtime code.

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

Adding unit tests to each pallet allow us to isolate and catch errors in the runtime instead of relying on integration testing or production to alert us after the fact.

Checklist

  • Does it require a purge of the network?
  • You bumped the runtime version if there are breaking changes in the runtime ?
  • Does it require changes in documentation/tutorials ?

@tgmichel
Copy link
Contributor

So cool to see this rise from the ashes, but we are not using this pallet right?

@4meta5
Copy link
Contributor Author

4meta5 commented Dec 17, 2020

@tgmichel Good point, I wasn't aware that mb-session and mb-core were not used.

Would it be better for me to start our chain governance pallets from scratch instead of working off this code? I think so, I guess I'll close this branch.

@4meta5 4meta5 closed this Dec 17, 2020
@4meta5 4meta5 deleted the amar-session-changes branch December 17, 2020 20:55
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

Successfully merging this pull request may close these issues.

2 participants