Commit Graph

64 Commits

Author SHA1 Message Date
Gav Wood 1d8a9a6dd3 Make Polkadot use the Substrate traity libraries (#105)
* Initial stuff.

* Various fixes.

* Fix tests.

* Fix another test

* Fix another test.

* Docs in polkadot runtime.

* Fix up ser/de tests.

* Update god keys

* Syntax

* Fix

* Merge remote-tracking branch 'origin/master' into gav-merge-runtime

* Permissions on init.sh

* Port-over the whitespace from @rphmeier

* Rename

* Merge branch 'master' into gav-merge-runtime

* Fix typo.

* Fix grumbles.

* Make more idiomatic.

* Move `Ed25519Signature` out of traits.
2018-04-05 17:13:12 +02:00
Gav Wood bd066e27a6 Traitify Runtime (#104)
* Factor out safe-mix and dispatch

* Refactor dispatch into something more modular.

* Fix wasm build.

* Fix up timestamp

* fix warnings.

* Borked timestamp example

* Fix build

* Timestamp as skeleton for traity runtime.

* New storage macro.

* Dispatch module has traity API.

* Move consensus module to new API

* Refactoring and outer dispatch

* Avoid unnecessary derives.

* Abstract the low-level half of system.

* nicer outer dispatch syntax.

* Make runtime compile again (albeit in a heavily simplified state)

* Reworking runtime and the upper levels of system.

* Initial reworking of runtime:

- Introduced executive module;
- Introduced trait primitives module;
- Provided an API endpoint.

* Expose an additional function in system

* Another couple of functions traitified in executive.

* another function in executive traitified.

* One more function traitified.

* Finish traitifying executive!

* Traitify session module.

* Cleanups and ensure session gets run.

* First part of traitification of staking module.

* Bit more of staking traitified.

* Additional stuff in staking. Fix up session.

* Penultimate part of staking module.

* Final part of staking (code)

* Update demo runtime to include staking.

* Final tweaks for staking integration.

* Remove old runtime files.

* Schedule staking.

* Minor fixes

* First bits of democracy.

* Democracy module integrated.

* Fix warning.

* Traitify and integrate council module

* Council voting.

* Runtime binary and tweaks.

* Binary update.

* Fix `*Type` grumble.

* Fix up genesis_map

* Remove NonTrivialSlicable

* Staking "test externalities" stuff along with refactor.

* Add session test externalities constructor

* Fixed executor tests.

* Make one test in executive module work.

* Remove test framework stuff into common module.

* Enable other tests in executive

* Session tests reinstated, minor refactoring of keyring.

* Fix staking tests.

* Fix up democracy tests.

* First few tests in council.

* Council tests reinstated :)

* Avoid hardcoding blake2 into Header.

* Fix last few tests.

* Make all primitives generic.

* Fix tests.

* Refactor runtime to remove genesismap.

* Streamline runtime more with macrofied config.

* Clean paths

* Fix warning.

* Consolidate demo runtime crate.

* Remove stale code.

* Refactor away dodgy trait.

* Add corresponding Aux type.

* Fixes

* Rename Digesty -> Digest

* Rename Headery -> Header

* Blocky -> Block

* Fix wasm build.

* kill warnings

* more docs

* minor cleanups
2018-04-04 12:06:39 +02:00
Gav Wood ad552cba4b A random beacon (#96)
* Completely rework dispatch mechanism into something modular.

Not yet complete but 75% there.

* Council vote tests.

* Fix tests.

* whitespace.

* Fix demo runtime tests.

* Fix up tests.

* Remove dead code.

* Initial util code for random beacon

* Timestamp uses new storage API.

* Move over system module to new API.

* Much nicer storage API, moved over staking module.

* More refactoring.

* Democracy uses new storage API.

* Council uses new RPC.

* Fix more tests.

* Use match for Id

* Generic mix.

* Integrate random beacon

* Update binaries.

* Fixes relating to with_ext removal.

* Remove dead code.

* Rework mixer into an iterator adaptor.

* Link to paper.

* Algorithm cleanups

* Merge and fix test.

* Docs.

* Fix typo.

* rename

* Fix tests.
2018-03-20 10:48:11 +08:00
Gav Wood 1ecd05dac9 Refactor all (demo) runtime modules to use new storage (#98)
* Completely rework dispatch mechanism into something modular.

Not yet complete but 75% there.

* Council vote tests.

* Fix tests.

* whitespace.

* Fix demo runtime tests.

* Fix up tests.

* Remove dead code.

* Timestamp uses new storage API.

* Move over system module to new API.

* Much nicer storage API, moved over staking module.

* More refactoring.

* Democracy uses new storage API.

* Council uses new RPC.

* Fix more tests.

* Use match for Id

* Use match for Id

* Make PrivPass better protected.

* Address other grumbles.

* Give PrivPass a private member.

* Testing PrivPass.

* Add docs.

* Recompile binaries after merge.

* Remove duplicated code.

* New binaries.

* Docs

* Docs

* avoid use of (arguably) confusing terminology.
2018-03-19 06:38:20 +01:00
Gav Wood f35763cc86 Modularised dispatch (#95)
* Completely rework dispatch mechanism into something modular.

Not yet complete but 75% there.

* Council vote tests.

* Fix tests.

* whitespace.

* Fix demo runtime tests.

* Fix up tests.

* Remove dead code.

* Use match for Id

* Make PrivPass better protected.

* Address other grumbles.

* Give PrivPass a private member.

* Testing PrivPass.

* Add docs.
2018-03-19 03:51:50 +01:00
Gav 0744e5a9a3 Merge branch 'master' into gav-demo 2018-03-14 12:03:44 +01:00
Gav c64d4980b4 Remove stray printlns. 2018-03-14 11:58:03 +01:00
Gav 550ec8cdf5 Cleanups and introduce all dispatchable endpoints. 2018-03-12 10:15:30 +01:00
Gav 873b579726 Minor typos. 2018-03-11 17:30:25 +01:00
Gav 80a95d843c Fix grumbles. 2018-03-11 17:27:59 +01:00
Gav 62f3bee9c1 Public function dispatching. 2018-03-10 19:23:10 +01:00
Gav aadf3e2493 Tests for staking reserved balances & slashing. 2018-03-10 18:42:50 +01:00
Gav 8c0c504997 Use a struct! 2018-03-07 19:36:13 +01:00
Gav 3ad3288508 Genesis map.
- fix warning
- remove more bare string ids
2018-03-07 12:16:12 +01:00
Gav 19424ce2ce Introduce stake reservation; make panicking tests better. 2018-03-06 21:09:41 +01:00
Gav a3ad686760 Move democracy module over no new Keyring API 2018-03-06 17:37:53 +01:00
Gav c055012028 Move council over to new Keyring API. 2018-03-06 17:33:19 +01:00
Gav fb61e2db32 Final tests. 2018-03-06 16:21:27 +01:00
Gav d12eee1164 Another few tests for council_vote. 2018-03-05 15:58:06 +01:00
Gav 0ab638928d council vetoing & tests. 2018-03-05 15:50:40 +01:00
Gav 7d378d3de3 More tests for council voting.
Also allow AsRef to be used for Public keys to simplify test code.
2018-03-05 12:11:56 +01:00
Gav 8d84ca8b48 Initial council vote logic. 2018-03-04 21:52:11 +01:00
Gav f056dea47e Ensure council always sorted by expiry. 2018-03-04 20:55:14 +01:00
Gav f7af45f95b remove string constants <-- @rphmeier 2018-03-04 19:36:26 +01:00
Gav 650e30d39c Tests for public referenda. 2018-03-04 13:47:36 +01:00
Gav 311337f5dc Tests for public referenda. 2018-03-04 13:17:53 +01:00
Gav 6476f26815 Introduce minimum deposit 2018-03-03 19:30:07 +01:00
Gav e8d38add64 cleanups. 2018-03-03 19:04:42 +01:00
Gav cf81e1dbb6 Deposits, not fees. 2018-03-03 19:01:39 +01:00
Gav e07aef7766 Introduce logic for deposits. 2018-03-03 14:36:37 +01:00
Gav 6cf236fb02 Simultaneous referendums and multiple voting variants. 2018-03-03 11:26:56 +01:00
Gav f5515ff673 Update docs 2018-03-02 20:11:16 +01:00
Gav c298331c3d test: against double presentations. 2018-03-02 19:18:54 +01:00
Gav f0699b9c8d Avoid allowing same accounts to be doubly-elected. 2018-03-02 19:14:35 +01:00
Gav b611881e8f Add one vote worth of time for voters to unregister before they become "inactive". 2018-03-02 18:43:15 +01:00
Gav 36bd7f0608 Additional docs & test. 2018-03-02 18:11:03 +01:00
Gav 60697d4402 tests: Retract inactive voter 2018-03-02 18:02:20 +01:00
Gav a633a257ef Merge branch 'master' into gav-demo 2018-03-02 14:59:32 +01:00
Gav d034f647f7 cleanups. 2018-03-02 14:41:20 +01:00
Gav d247a2e2b3 tests: presenting losers 2018-03-02 14:40:36 +01:00
Gav 826a06fc23 Tests: various error cases with present. 2018-03-02 14:33:03 +01:00
Gav 011a975363 test: second tally uses runners-up. 2018-03-02 14:19:44 +01:00
Gav d82e0fb6fa More tests, for runners-up. 2018-03-02 14:00:23 +01:00
Gav 9066313d18 Test for tally 2018-03-02 13:39:49 +01:00
Gav 4e19dc6ef1 More tests for voting. 2018-03-02 11:34:06 +01:00
Gav 4435d65206 More candidate tests. 2018-03-02 10:09:27 +01:00
Gav 9cd65e3372 Candidacy tests 2018-03-02 09:54:21 +01:00
Gav 209988a939 Space out votes by a minimum period. 2018-03-01 15:19:41 +01:00
Gav ced6eedead remove inactive voter. 2018-03-01 15:08:29 +01:00
Gav 6ee089b4be Final bit of core logic for the council. 2018-03-01 13:49:45 +01:00