Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
20db693
Introduce efficient Hash-based RNG streamer
gavofyork Nov 21, 2019
1433aaf
Initial draft of the society module
gavofyork Nov 21, 2019
44b26b1
Introduce a test
gavofyork Nov 21, 2019
efdc1b8
Dual-pot logic
gavofyork Nov 21, 2019
aeb53ee
Vouching
gavofyork Nov 21, 2019
41f1437
Merge remote-tracking branch 'origin/master' into gav-society
gavofyork Nov 22, 2019
3f105fa
Use chacha
gavofyork Nov 22, 2019
c6873e4
Merge remote-tracking branch 'origin/master' into gav-society
gavofyork Nov 28, 2019
36b026b
Half way through moving to cliff payout.
gavofyork Nov 28, 2019
8412af1
Merge remote-tracking branch 'origin/master' into gav-society
gavofyork Dec 4, 2019
4ce4cf2
Merge remote-tracking branch 'origin/master' into gav-society
gavofyork Dec 4, 2019
1a32d3a
Fixes
gavofyork Dec 4, 2019
cf7e3b9
Merge remote-tracking branch 'origin/master' into gav-society
gavofyork Dec 6, 2019
a67a09a
Add some tests
gavofyork Dec 6, 2019
1db3a2b
Remove printlns
gavofyork Dec 8, 2019
3378e66
Merge remote-tracking branch 'origin/master' into gav-society
gavofyork Dec 9, 2019
f286781
Merge remote-tracking branch 'origin/gav-verified-id' into gav-verifi…
gavofyork Dec 10, 2019
e4769ab
Merge remote-tracking branch 'origin/gav-verified-id' into gav-verifi…
gavofyork Dec 10, 2019
4abf6dd
Fix `slash_payout`, add test
shawntabrizi Dec 11, 2019
3ac3e65
Test for multi-slash_payout
shawntabrizi Dec 11, 2019
b60e51d
Add docs to `put_bid` function and `bidding_works` test
shawntabrizi Dec 11, 2019
b2fa20c
Add strikes to test
shawntabrizi Dec 11, 2019
a4da26e
Add comments to `rotate_period`
shawntabrizi Dec 12, 2019
7a9a37d
Implement `suspend_member`
shawntabrizi Dec 13, 2019
7b06280
Off chain iteration of suspended members using linked_map
shawntabrizi Dec 13, 2019
37c7401
Half of suspended candidate
shawntabrizi Dec 14, 2019
617d47e
Finish suspend_candidate, need tests
shawntabrizi Dec 14, 2019
e9f7864
Resolve mistakes and feedback, add `suspended_candidate_rejected` test
shawntabrizi Dec 14, 2019
08b3dc3
Remove logic which increases payout time after un-suspension
shawntabrizi Dec 14, 2019
e6ceb22
Fix error in `slash_suspended_candidates`, add member check to `vote`
shawntabrizi Dec 14, 2019
f979a26
Fix vouch rewards, dont create zero payouts, add tests for vouch
shawntabrizi Dec 15, 2019
d113f86
Test unvouch
shawntabrizi Dec 15, 2019
df10d41
Unbid tests
shawntabrizi Dec 15, 2019
76908b7
Add lifecycle events, fix `add_member` to update `MembershipChanged`
shawntabrizi Dec 16, 2019
1540cbd
Head cannot be removed from society
shawntabrizi Dec 16, 2019
1e2387e
Use `add_member` in `found` to ensure `MembershipChanged` is triggered
shawntabrizi Dec 16, 2019
37ac2fd
Use `Judgement` enum for suspended candidate judgement
shawntabrizi Dec 16, 2019
8d0e13c
Make society instantiable
shawntabrizi Dec 16, 2019
937e070
Implement challenges
shawntabrizi Dec 16, 2019
761e268
Remove extra text in test
shawntabrizi Dec 16, 2019
d52a46c
Remove `BlockNumber` return from `slash_payout`
shawntabrizi Dec 16, 2019
211b5b1
Add bad vote causes slash test
shawntabrizi Dec 16, 2019
a425461
Update frame/society/src/lib.rs
shawntabrizi Dec 16, 2019
52dfd06
Add consts to module metadata
shawntabrizi Dec 16, 2019
0345b90
Check `suspended_member` cant bid
shawntabrizi Dec 18, 2019
c76cb1d
Increase strength of payout check, **must** be a member.
shawntabrizi Dec 18, 2019
8550de5
Start pallet documentation
shawntabrizi Dec 18, 2019
bad454f
Finish docs
shawntabrizi Dec 19, 2019
bac1ebf
Merge remote-tracking branch 'upstream/master' into gav-society
shawntabrizi Dec 19, 2019
628c96e
Update library names, use decl_error
shawntabrizi Dec 20, 2019
c7fa078
Prevent double bids, add test
shawntabrizi Dec 20, 2019
34821d6
Use `map` for vouching member, and introduce banned vouchers
shawntabrizi Dec 21, 2019
1dda9b1
Remove leftover docs
shawntabrizi Dec 21, 2019
5a0d0fa
Vouching handles removed member lifecycles w/ tests
shawntabrizi Dec 26, 2019
f3e40c0
Merge remote-tracking branch 'upstream/master' into gav-society
shawntabrizi Dec 26, 2019
3c66127
`take` the votes when tallying, add comprehensive checks before vouch…
shawntabrizi Dec 26, 2019
ee94ada
Check votes are cleaned up
shawntabrizi Dec 26, 2019
4ad77eb
Check vote is for a valid candidate, add vote event
shawntabrizi Dec 26, 2019
89192c3
Defender vote event
shawntabrizi Dec 26, 2019
0c7160a
Fix `judge_suspended_candidate`, add weight docs
shawntabrizi Dec 26, 2019
38c2860
First pass fixes (blank lines, formatting, no operational)
shawntabrizi Jan 5, 2020
fc57003
Bump copyright year
shawntabrizi Jan 5, 2020
c5c0d27
Make `add_member` infallible
shawntabrizi Jan 5, 2020
ce36c5a
More feedback updates
shawntabrizi Jan 6, 2020
8b9caa6
Add storage access complexity
shawntabrizi Jan 6, 2020
810ff79
Fix logic for AutoUnbid
shawntabrizi Jan 6, 2020
e51fd45
Complete weight documentation
shawntabrizi Jan 6, 2020
1310a03
Optimize logic which used to result in double storage read.
shawntabrizi Jan 6, 2020
6472059
Use Bid struct rather than tuple
shawntabrizi Jan 6, 2020
86afc39
Introduce `MaxMembers` configuration constant
shawntabrizi Jan 6, 2020
d00fd57
Add comment about fringe scenario where `MaxMembers` could go over, NBD
shawntabrizi Jan 6, 2020
4cf8bfc
Change MaxMembership to configurable storage item with ability for ro…
shawntabrizi Jan 7, 2020
612d1ce
Make membership challenges skew toward failure.
shawntabrizi Jan 7, 2020
aeb8bf4
Refactor `is_candidate`as to avoid possible double storage reads in t…
shawntabrizi Jan 8, 2020
3987454
Blank lines
shawntabrizi Jan 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ members = [
"frame/randomness-collective-flip",
"frame/scored-pool",
"frame/session",
"frame/society",
"frame/staking",
"frame/staking/reward-curve",
"frame/sudo",
Expand Down
32 changes: 32 additions & 0 deletions frame/society/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "pallet-society"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

[dependencies]
serde = { version = "1.0.101", optional = true }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
sp-io ={ path = "../../primitives/io", default-features = false }
sp-runtime = { version = "2.0.0", default-features = false, path = "../../primitives/runtime" }
sp-std = { version = "2.0.0", default-features = false, path = "../../primitives/std" }
frame-support = { version = "2.0.0", default-features = false, path = "../support" }
frame-system = { version = "2.0.0", default-features = false, path = "../system" }
rand_chacha = { version = "0.2", default-features = false }

[dev-dependencies]
sp-core = { version = "2.0.0", path = "../../primitives/core" }
pallet-balances = { version = "2.0.0", path = "../balances" }

[features]
default = ["std"]
std = [
"codec/std",
"serde",
"sp-io/std",
"sp-runtime/std",
"rand_chacha/std",
"sp-std/std",
"frame-support/std",
"frame-system/std",
]
Loading