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

Patch practical usability issues with Society #4651

Merged
merged 4 commits into from
Jan 17, 2020

Conversation

shawntabrizi
Copy link
Member

@shawntabrizi shawntabrizi commented Jan 16, 2020

This PR makes the following changes:

  1. Currently, if you try to call found on the Society pallet on a running chain, it will fail since the MaxMembers storage item is default 0. This introduces a second parameter to the found extrinsic, max_members which will set this value to some non-zero value.

  2. The Polkadot JS API does not recognize a storage item with type Option<()> as ever isSome. I change the use of Option<()> to Option<bool> for tracking suspended members. Option<()> returns isNone true when Some(()) polkadot-js/api#1724

  3. This also updates the Substrate node so that Society has a genesis configuration, and thus running a new Substrate node will make society enabled and usable.

@@ -295,6 +295,11 @@ pub fn testnet_genesis(
}),
pallet_membership_Instance1: Some(Default::default()),
pallet_treasury: Some(Default::default()),
pallet_society: Some(SocietyConfig {
members: endowed_accounts[0..3].to_vec(),
pot: 100000,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check this number

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pot should probably just be zero.

@shawntabrizi shawntabrizi changed the title Founding a society sets max_members Patch practical issues with Society Jan 17, 2020
@shawntabrizi shawntabrizi changed the title Patch practical issues with Society Patch practical usability issues with Society Jan 17, 2020
@gavofyork
Copy link
Member

to Option<bool>

why not to a straight bool? it's more ergonomic and doesn't provide a dead state to the developer.

@@ -72,6 +72,7 @@ pallet-transaction-payment = { version = "2.0.0", path = "../../../frame/transac
frame-support = { version = "2.0.0", default-features = false, path = "../../../frame/support" }
pallet-im-online = { version = "2.0.0", default-features = false, path = "../../../frame/im-online" }
pallet-authority-discovery = { version = "2.0.0", path = "../../../frame/authority-discovery" }
pallet-society = { version = "2.0.0", path = "../../../frame/society" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this dependency?

@gavofyork gavofyork merged commit 083ada5 into paritytech:master Jan 17, 2020
@shawntabrizi shawntabrizi deleted the shawntabrizi-society-patch branch March 12, 2020 15:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants