{"action":"created","comment":{"url":"https://api.github.com/repos/paritytech/polkadot/pulls/comments/175178941","pull_request_review_id":104674297,"id":175178941,"diff_hunk":"@@ -16,79 +16,228 @@\n \n //! Dispatch system. Just dispatches calls.\n \n-use demo_primitives::{Function, Proposal, AccountId};\n-use runtime::{staking, system, session, democracy, council, council_vote, timestamp};\n-\n-/// Dispatch a proposal.\n-pub fn proposal(proposal: Proposal) {\n-\tmatch proposal {\n-\t\tProposal::SystemSetCode(ref a) =>\n-\t\t\tsystem::privileged::set_code(a),\n-\t\tProposal::SessionSetLength(a) =>\n-\t\t\tsession::privileged::set_length(a),\n-\t\tProposal::SessionForceNewSession =>\n-\t\t\tsession::privileged::force_new_session(),\n-\t\tProposal::StakingSetSessionsPerEra(a) =>\n-\t\t\tstaking::privileged::set_sessions_per_era(a),\n-\t\tProposal::StakingSetBondingDuration(a) =>\n-\t\t\tstaking::privileged::set_bonding_duration(a),\n-\t\tProposal::StakingSetValidatorCount(a) =>\n-\t\t\tstaking::privileged::set_validator_count(a),\n-\t\tProposal::StakingForceNewEra =>\n-\t\t\tstaking::privileged::force_new_era(),\n-\t\tProposal::DemocracyCancelReferendum(a) =>\n-\t\t\tdemocracy::privileged::cancel_referendum(a),\n-\t\tProposal::DemocracyStartReferendum(a, b) =>\n-\t\t\tdemocracy::privileged::start_referendum(*a, b),\n-\t\tProposal::CouncilSetDesiredSeats(a) =>\n-\t\t\tcouncil::privileged::set_desired_seats(a),\n-\t\tProposal::CouncilRemoveMember(a) =>\n-\t\t\tcouncil::privileged::remove_member(&a),\n-\t\tProposal::CouncilSetPresentationDuration(a) =>\n-\t\t\tcouncil::privileged::set_presentation_duration(a),\n-\t\tProposal::CouncilSetTermDuration(a) =>\n-\t\t\tcouncil::privileged::set_term_duration(a),\n-\t\tProposal::CouncilVoteSetCooloffPeriod(a) =>\n-\t\t\tcouncil_vote::privileged::set_cooloff_period(a),\n-\t\tProposal::CouncilVoteSetVotingPeriod(a) =>\n-\t\t\tcouncil_vote::privileged::set_voting_period(a),\n+use runtime::{staking, system};\n+pub use rstd::prelude::Vec;\n+pub use codec::{Slicable, Input, NonTrivialSlicable};\n+\n+#[macro_export]\n+macro_rules! impl_dispatch {\n+\t(\n+\t\tpub mod $mod_name:ident;\n+\t\t$(\n+\t\t\tfn $fn_name:ident(\n+\t\t\t\t$(\n+\t\t\t\t\t$param_name:ident : $param:ty\n+\t\t\t\t),*\n+\t\t\t)\n+\t\t\t= $id:expr ;\n+\t\t)*\n+\t) => {\n+\t\tpub mod $mod_name {","path":"demo/runtime/src/dispatch.rs","position":57,"original_position":57,"commit_id":"faa0a44bfdb89049ed13e251ccf8e758bcf01b75","original_commit_id":"7cece3ba3d92d541e2e3a56ef8b2516a8bf4e61d","user":{"login":"gavofyork","id":138296,"avatar_url":"https://avatars0.githubusercontent.com/u/138296?v=4","gravatar_id":"","url":"https://api.github.com/users/gavofyork","html_url":"https://github.com/gavofyork","followers_url":"https://api.github.com/users/gavofyork/followers","following_url":"https://api.github.com/users/gavofyork/following{/other_user}","gists_url":"https://api.github.com/users/gavofyork/gists{/gist_id}","starred_url":"https://api.github.com/users/gavofyork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavofyork/subscriptions","organizations_url":"https://api.github.com/users/gavofyork/orgs","repos_url":"https://api.github.com/users/gavofyork/repos","events_url":"https://api.github.com/users/gavofyork/events{/privacy}","received_events_url":"https://api.github.com/users/gavofyork/received_events","type":"User","site_admin":false},"body":"isn't it better to keep them focussed? suppressing at module level might let accidental errors get through.","created_at":"2018-03-16T18:29:53Z","updated_at":"2018-03-16T18:29:53Z","html_url":"https://github.com/paritytech/polkadot/pull/95#discussion_r175178941","pull_request_url":"https://api.github.com/repos/paritytech/polkadot/pulls/95","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/paritytech/polkadot/pulls/comments/175178941"},"html":{"href":"https://github.com/paritytech/polkadot/pull/95#discussion_r175178941"},"pull_request":{"href":"https://api.github.com/repos/paritytech/polkadot/pulls/95"}},"in_reply_to_id":174913925},"pull_request":{"url":"https://api.github.com/repos/paritytech/polkadot/pulls/95","id":174631988,"html_url":"https://github.com/paritytech/polkadot/pull/95","diff_url":"https://github.com/paritytech/polkadot/pull/95.diff","patch_url":"https://github.com/paritytech/polkadot/pull/95.patch","issue_url":"https://api.github.com/repos/paritytech/polkadot/issues/95","number":95,"state":"open","locked":false,"title":"Modularised dispatch","user":{"login":"gavofyork","id":138296,"avatar_url":"https://avatars0.githubusercontent.com/u/138296?v=4","gravatar_id":"","url":"https://api.github.com/users/gavofyork","html_url":"https://github.com/gavofyork","followers_url":"https://api.github.com/users/gavofyork/followers","following_url":"https://api.github.com/users/gavofyork/following{/other_user}","gists_url":"https://api.github.com/users/gavofyork/gists{/gist_id}","starred_url":"https://api.github.com/users/gavofyork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavofyork/subscriptions","organizations_url":"https://api.github.com/users/gavofyork/orgs","repos_url":"https://api.github.com/users/gavofyork/repos","events_url":"https://api.github.com/users/gavofyork/events{/privacy}","received_events_url":"https://api.github.com/users/gavofyork/received_events","type":"User","site_admin":false},"body":"#92 and more.","created_at":"2018-03-13T11:35:26Z","updated_at":"2018-03-16T18:29:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8708a648f0d7cd3b1fdbd67dbb41814784728408","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":746560607,"url":"https://api.github.com/repos/paritytech/polkadot/labels/A0-pleasereview","name":"A0-pleasereview","color":"666666","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/paritytech/polkadot/pulls/95/commits","review_comments_url":"https://api.github.com/repos/paritytech/polkadot/pulls/95/comments","review_comment_url":"https://api.github.com/repos/paritytech/polkadot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paritytech/polkadot/issues/95/comments","statuses_url":"https://api.github.com/repos/paritytech/polkadot/statuses/faa0a44bfdb89049ed13e251ccf8e758bcf01b75","head":{"label":"paritytech:gav-dispatch","ref":"gav-dispatch","sha":"faa0a44bfdb89049ed13e251ccf8e758bcf01b75","user":{"login":"paritytech","id":14176906,"avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"repo":{"id":109872620,"name":"polkadot","full_name":"paritytech/polkadot","owner":{"login":"paritytech","id":14176906,"avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paritytech/polkadot","description":"Polkadot Node Implementation","fork":false,"url":"https://api.github.com/repos/paritytech/polkadot","forks_url":"https://api.github.com/repos/paritytech/polkadot/forks","keys_url":"https://api.github.com/repos/paritytech/polkadot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paritytech/polkadot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paritytech/polkadot/teams","hooks_url":"https://api.github.com/repos/paritytech/polkadot/hooks","issue_events_url":"https://api.github.com/repos/paritytech/polkadot/issues/events{/number}","events_url":"https://api.github.com/repos/paritytech/polkadot/events","assignees_url":"https://api.github.com/repos/paritytech/polkadot/assignees{/user}","branches_url":"https://api.github.com/repos/paritytech/polkadot/branches{/branch}","tags_url":"https://api.github.com/repos/paritytech/polkadot/tags","blobs_url":"https://api.github.com/repos/paritytech/polkadot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paritytech/polkadot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paritytech/polkadot/git/refs{/sha}","trees_url":"https://api.github.com/repos/paritytech/polkadot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paritytech/polkadot/statuses/{sha}","languages_url":"https://api.github.com/repos/paritytech/polkadot/languages","stargazers_url":"https://api.github.com/repos/paritytech/polkadot/stargazers","contributors_url":"https://api.github.com/repos/paritytech/polkadot/contributors","subscribers_url":"https://api.github.com/repos/paritytech/polkadot/subscribers","subscription_url":"https://api.github.com/repos/paritytech/polkadot/subscription","commits_url":"https://api.github.com/repos/paritytech/polkadot/commits{/sha}","git_commits_url":"https://api.github.com/repos/paritytech/polkadot/git/commits{/sha}","comments_url":"https://api.github.com/repos/paritytech/polkadot/comments{/number}","issue_comment_url":"https://api.github.com/repos/paritytech/polkadot/issues/comments{/number}","contents_url":"https://api.github.com/repos/paritytech/polkadot/contents/{+path}","compare_url":"https://api.github.com/repos/paritytech/polkadot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paritytech/polkadot/merges","archive_url":"https://api.github.com/repos/paritytech/polkadot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paritytech/polkadot/downloads","issues_url":"https://api.github.com/repos/paritytech/polkadot/issues{/number}","pulls_url":"https://api.github.com/repos/paritytech/polkadot/pulls{/number}","milestones_url":"https://api.github.com/repos/paritytech/polkadot/milestones{/number}","notifications_url":"https://api.github.com/repos/paritytech/polkadot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paritytech/polkadot/labels{/name}","releases_url":"https://api.github.com/repos/paritytech/polkadot/releases{/id}","deployments_url":"https://api.github.com/repos/paritytech/polkadot/deployments","created_at":"2017-11-07T18:08:53Z","updated_at":"2018-03-16T16:39:52Z","pushed_at":"2018-03-16T17:14:29Z","git_url":"git://github.com/paritytech/polkadot.git","ssh_url":"git@github.com:paritytech/polkadot.git","clone_url":"https://github.com/paritytech/polkadot.git","svn_url":"https://github.com/paritytech/polkadot","homepage":null,"size":17697,"stargazers_count":115,"watchers_count":115,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":34,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":16,"open_issues":34,"watchers":115,"default_branch":"master"}},"base":{"label":"paritytech:master","ref":"master","sha":"a70ac87090347018f5b95aad12a1f747ccdb9ec0","user":{"login":"paritytech","id":14176906,"avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"repo":{"id":109872620,"name":"polkadot","full_name":"paritytech/polkadot","owner":{"login":"paritytech","id":14176906,"avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paritytech/polkadot","description":"Polkadot Node Implementation","fork":false,"url":"https://api.github.com/repos/paritytech/polkadot","forks_url":"https://api.github.com/repos/paritytech/polkadot/forks","keys_url":"https://api.github.com/repos/paritytech/polkadot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paritytech/polkadot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paritytech/polkadot/teams","hooks_url":"https://api.github.com/repos/paritytech/polkadot/hooks","issue_events_url":"https://api.github.com/repos/paritytech/polkadot/issues/events{/number}","events_url":"https://api.github.com/repos/paritytech/polkadot/events","assignees_url":"https://api.github.com/repos/paritytech/polkadot/assignees{/user}","branches_url":"https://api.github.com/repos/paritytech/polkadot/branches{/branch}","tags_url":"https://api.github.com/repos/paritytech/polkadot/tags","blobs_url":"https://api.github.com/repos/paritytech/polkadot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paritytech/polkadot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paritytech/polkadot/git/refs{/sha}","trees_url":"https://api.github.com/repos/paritytech/polkadot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paritytech/polkadot/statuses/{sha}","languages_url":"https://api.github.com/repos/paritytech/polkadot/languages","stargazers_url":"https://api.github.com/repos/paritytech/polkadot/stargazers","contributors_url":"https://api.github.com/repos/paritytech/polkadot/contributors","subscribers_url":"https://api.github.com/repos/paritytech/polkadot/subscribers","subscription_url":"https://api.github.com/repos/paritytech/polkadot/subscription","commits_url":"https://api.github.com/repos/paritytech/polkadot/commits{/sha}","git_commits_url":"https://api.github.com/repos/paritytech/polkadot/git/commits{/sha}","comments_url":"https://api.github.com/repos/paritytech/polkadot/comments{/number}","issue_comment_url":"https://api.github.com/repos/paritytech/polkadot/issues/comments{/number}","contents_url":"https://api.github.com/repos/paritytech/polkadot/contents/{+path}","compare_url":"https://api.github.com/repos/paritytech/polkadot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paritytech/polkadot/merges","archive_url":"https://api.github.com/repos/paritytech/polkadot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paritytech/polkadot/downloads","issues_url":"https://api.github.com/repos/paritytech/polkadot/issues{/number}","pulls_url":"https://api.github.com/repos/paritytech/polkadot/pulls{/number}","milestones_url":"https://api.github.com/repos/paritytech/polkadot/milestones{/number}","notifications_url":"https://api.github.com/repos/paritytech/polkadot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paritytech/polkadot/labels{/name}","releases_url":"https://api.github.com/repos/paritytech/polkadot/releases{/id}","deployments_url":"https://api.github.com/repos/paritytech/polkadot/deployments","created_at":"2017-11-07T18:08:53Z","updated_at":"2018-03-16T16:39:52Z","pushed_at":"2018-03-16T17:14:29Z","git_url":"git://github.com/paritytech/polkadot.git","ssh_url":"git@github.com:paritytech/polkadot.git","clone_url":"https://github.com/paritytech/polkadot.git","svn_url":"https://github.com/paritytech/polkadot","homepage":null,"size":17697,"stargazers_count":115,"watchers_count":115,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":34,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":16,"open_issues":34,"watchers":115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paritytech/polkadot/pulls/95"},"html":{"href":"https://github.com/paritytech/polkadot/pull/95"},"issue":{"href":"https://api.github.com/repos/paritytech/polkadot/issues/95"},"comments":{"href":"https://api.github.com/repos/paritytech/polkadot/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/paritytech/polkadot/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/paritytech/polkadot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paritytech/polkadot/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/paritytech/polkadot/statuses/faa0a44bfdb89049ed13e251ccf8e758bcf01b75"}},"author_association":"OWNER"}}
{"actor":{"display_login":"gavofyork"}}