Browse Source

Merge pull request #2348 from conectado/sumer-new-substrate

Sumer upgrade substrate version to 2.0.1
Mokhtar Naamani 3 years ago
parent
commit
cba4d7d9d2
94 changed files with 2474 additions and 1450 deletions
  1. 390 170
      Cargo.lock
  2. 51 50
      node/Cargo.toml
  3. 34 12
      node/src/chain_spec/mod.rs
  4. 44 10
      node/src/cli.rs
  5. 112 24
      node/src/command.rs
  6. 35 19
      node/src/node_rpc.rs
  7. 503 401
      node/src/service.rs
  8. 9 9
      runtime-modules/common/Cargo.toml
  9. 4 3
      runtime-modules/common/src/currency.rs
  10. 3 3
      runtime-modules/common/src/lib.rs
  11. 3 3
      runtime-modules/common/src/origin.rs
  12. 5 4
      runtime-modules/common/src/storage.rs
  13. 12 12
      runtime-modules/content/Cargo.toml
  14. 60 60
      runtime-modules/content/src/lib.rs
  15. 2 2
      runtime-modules/content/src/permissions/mod.rs
  16. 10 6
      runtime-modules/content/src/tests/mock.rs
  17. 12 12
      runtime-modules/forum/Cargo.toml
  18. 4 4
      runtime-modules/forum/src/lib.rs
  19. 16 14
      runtime-modules/forum/src/mock.rs
  20. 13 13
      runtime-modules/governance/Cargo.toml
  21. 19 16
      runtime-modules/governance/src/council.rs
  22. 31 22
      runtime-modules/governance/src/election.rs
  23. 9 5
      runtime-modules/governance/src/mock.rs
  24. 12 12
      runtime-modules/hiring/Cargo.toml
  25. 21 26
      runtime-modules/hiring/src/lib.rs
  26. 8 5
      runtime-modules/hiring/src/mock.rs
  27. 4 3
      runtime-modules/hiring/src/test/mod.rs
  28. 13 13
      runtime-modules/membership/Cargo.toml
  29. 1 1
      runtime-modules/membership/src/genesis.rs
  30. 10 10
      runtime-modules/membership/src/lib.rs
  31. 11 7
      runtime-modules/membership/src/mock.rs
  32. 8 8
      runtime-modules/memo/Cargo.toml
  33. 4 4
      runtime-modules/memo/src/lib.rs
  34. 16 16
      runtime-modules/proposals/codex/Cargo.toml
  35. 9 8
      runtime-modules/proposals/codex/src/lib.rs
  36. 2 2
      runtime-modules/proposals/codex/src/proposal_types/mod.rs
  37. 16 9
      runtime-modules/proposals/codex/src/tests/mock.rs
  38. 3 1
      runtime-modules/proposals/codex/src/tests/mod.rs
  39. 12 12
      runtime-modules/proposals/discussion/Cargo.toml
  40. 6 6
      runtime-modules/proposals/discussion/src/lib.rs
  41. 11 7
      runtime-modules/proposals/discussion/src/tests/mock.rs
  42. 2 2
      runtime-modules/proposals/discussion/src/tests/mod.rs
  43. 13 13
      runtime-modules/proposals/engine/Cargo.toml
  44. 14 14
      runtime-modules/proposals/engine/src/lib.rs
  45. 11 7
      runtime-modules/proposals/engine/src/tests/mock/mod.rs
  46. 1 1
      runtime-modules/proposals/engine/src/tests/mock/proposals.rs
  47. 9 4
      runtime-modules/proposals/engine/src/tests/mod.rs
  48. 6 5
      runtime-modules/proposals/engine/src/types/mod.rs
  49. 10 10
      runtime-modules/recurring-reward/Cargo.toml
  50. 4 4
      runtime-modules/recurring-reward/src/lib.rs
  51. 7 4
      runtime-modules/recurring-reward/src/mock/mod.rs
  52. 13 13
      runtime-modules/stake/Cargo.toml
  53. 10 6
      runtime-modules/stake/src/lib.rs
  54. 8 5
      runtime-modules/stake/src/mock.rs
  55. 12 12
      runtime-modules/storage/Cargo.toml
  56. 9 9
      runtime-modules/storage/src/data_directory.rs
  57. 2 2
      runtime-modules/storage/src/data_object_storage_registry.rs
  58. 2 2
      runtime-modules/storage/src/data_object_type_registry.rs
  59. 1 1
      runtime-modules/storage/src/tests/data_directory.rs
  60. 1 1
      runtime-modules/storage/src/tests/data_object_type_registry.rs
  61. 10 24
      runtime-modules/storage/src/tests/mock.rs
  62. 10 10
      runtime-modules/token-minting/Cargo.toml
  63. 4 4
      runtime-modules/token-minting/src/lib.rs
  64. 7 4
      runtime-modules/token-minting/src/mock.rs
  65. 13 13
      runtime-modules/working-group/Cargo.toml
  66. 26 23
      runtime-modules/working-group/src/lib.rs
  67. 1 1
      runtime-modules/working-group/src/tests/fixtures.rs
  68. 1 1
      runtime-modules/working-group/src/tests/hiring_workflow.rs
  69. 10 6
      runtime-modules/working-group/src/tests/mock.rs
  70. 4 4
      runtime-modules/working-group/src/tests/mod.rs
  71. 47 47
      runtime/Cargo.toml
  72. 1 1
      runtime/build.rs
  73. 11 8
      runtime/src/integration/proposals/council_origin_validator.rs
  74. 10 7
      runtime/src/integration/proposals/membership_origin_validator.rs
  75. 1 1
      runtime/src/integration/proposals/proposal_encoder.rs
  76. 4 3
      runtime/src/integration/proposals/staking_events_handler.rs
  77. 12 28
      runtime/src/integration/transactions.rs
  78. 86 25
      runtime/src/lib.rs
  79. 1 2
      runtime/src/primitives.rs
  80. 37 13
      runtime/src/runtime_api.rs
  81. 1 1
      runtime/src/tests/mod.rs
  82. 8 8
      runtime/src/tests/proposals_integration/mod.rs
  83. 55 53
      runtime/src/tests/proposals_integration/working_group_proposals.rs
  84. 41 0
      runtime/src/weights/frame_system.rs
  85. 27 0
      runtime/src/weights/mod.rs
  86. 47 0
      runtime/src/weights/pallet_balances.rs
  87. 20 0
      runtime/src/weights/pallet_session.rs
  88. 166 0
      runtime/src/weights/pallet_staking.rs
  89. 34 0
      runtime/src/weights/pallet_timestamp.rs
  90. 17 0
      runtime/src/weights/substrate_utility.rs
  91. 8 18
      setup.sh
  92. 64 0
      tests/network-tests/run-local-node-test.sh
  93. 6 6
      utils/chain-spec-builder/Cargo.toml
  94. 1 0
      utils/chain-spec-builder/src/main.rs

File diff suppressed because it is too large
+ 390 - 170
Cargo.lock


+ 51 - 50
node/Cargo.toml

@@ -3,7 +3,7 @@ authors = ['Joystream contributors']
 build = 'build.rs'
 edition = '2018'
 name = 'joystream-node'
-version = '3.7.2'
+version = '5.2.0'
 default-run = "joystream-node"
 
 [[bin]]
@@ -17,79 +17,80 @@ crate-type = ["cdylib", "rlib"]
 # third-party dependencies
 serde = { version = "1.0.102", features = ["derive"] }
 futures = { version = "0.3.1", features = ["compat"] }
-jsonrpc-core = "14.2.0"
+jsonrpc-core = "15.0.0"
 structopt = { version = "0.3.8", optional = true}
 serde_json = '1.0'
-codec = { package = "parity-scale-codec", version = "1.3.1" }
+codec = { package = "parity-scale-codec", version = "1.3.4" }
 hex = { package = "hex", version = "0.4.2" }
 
 # primitives
-sp-authority-discovery = { package = 'sp-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-consensus-babe = { package = 'sp-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-finality-grandpa = { package = 'sp-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-core = { package = 'sp-core', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-runtime = { package = 'sp-runtime', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-finality-tracker = { package = 'sp-finality-tracker', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-inherents = { package = 'sp-inherents', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-consensus = { package = 'sp-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-transaction-pool = { package = 'sp-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-api = { package = 'sp-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-blockchain = { package = 'sp-blockchain', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-block-builder = { package = 'sp-block-builder', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
+sp-authority-discovery = { package = 'sp-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-consensus-babe = { package = 'sp-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-finality-grandpa = { package = 'sp-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-core = { package = 'sp-core', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-runtime = { package = 'sp-runtime', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-finality-tracker = { package = 'sp-finality-tracker', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-inherents = { package = 'sp-inherents', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-consensus = { package = 'sp-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-transaction-pool = { package = 'sp-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-api = { package = 'sp-api', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-blockchain = { package = 'sp-blockchain', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-block-builder = { package = 'sp-block-builder', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
 
 # client dependencies
-sc-client-api = { package = 'sc-client-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-chain-spec = { package = 'sc-chain-spec', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-consensus = { package = 'sc-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-transaction-pool = { package = 'sc-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-network = { package = 'sc-network', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-consensus-babe = { package = 'sc-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sc-finality-grandpa = { package = 'sc-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-basic-authorship = { package = 'sc-basic-authorship', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-service = { package = 'sc-service', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-authority-discovery = { package = 'sc-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-consensus-epochs = { package = 'sc-consensus-epochs', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-keystore = { package = 'sc-keystore', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-consensus-babe-rpc = { package = 'sc-consensus-babe-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-finality-grandpa-rpc = { package = 'sc-finality-grandpa-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-rpc-api = { package = 'sc-rpc-api', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-executor = { package = 'sc-executor', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
+sc-client-api = { package = 'sc-client-api', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-chain-spec = { package = 'sc-chain-spec', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-consensus = { package = 'sc-consensus', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-transaction-pool = { package = 'sc-transaction-pool', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-network = { package = 'sc-network', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-consensus-babe = { package = 'sc-consensus-babe', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sc-finality-grandpa = { package = 'sc-finality-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-basic-authorship = { package = 'sc-basic-authorship', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-service = { package = 'sc-service', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-authority-discovery = { package = 'sc-authority-discovery', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-consensus-epochs = { package = 'sc-consensus-epochs', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-keystore = { package = 'sc-keystore', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-consensus-babe-rpc = { package = 'sc-consensus-babe-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-finality-grandpa-rpc = { package = 'sc-finality-grandpa-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-rpc-api = { package = 'sc-rpc-api', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-rpc = { package = 'sc-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-executor = { package = 'sc-executor', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
 
 # frame dependencies
-pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-pallet-transaction-payment-rpc = { package = 'pallet-transaction-payment-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-substrate-frame-rpc-system = { package = 'substrate-frame-rpc-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-frame-benchmarking = { package = 'frame-benchmarking', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
+pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+pallet-transaction-payment-rpc = { package = 'pallet-transaction-payment-rpc', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+substrate-frame-rpc-system = { package = 'substrate-frame-rpc-system', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+frame-benchmarking = { package = 'frame-benchmarking', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
 
 # node-specific dependencies
 node-runtime = { package= "joystream-node-runtime", path = "../runtime" }
 
 # CLI-specific dependencies
-sc-cli = { package = 'sc-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }
-frame-benchmarking-cli = { package = 'frame-benchmarking-cli', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }
-node-inspect = { package = 'node-inspect', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }
+sc-cli = { package = 'sc-cli', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true }
+frame-benchmarking-cli = { package = 'frame-benchmarking-cli', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true }
+node-inspect = { package = 'node-inspect', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true }
 
 # WASM-specific dependencies
 wasm-bindgen = { version = "0.2.57", optional = true }
 wasm-bindgen-futures = { version = "0.4.7", optional = true }
-browser-utils = { package = 'substrate-browser-utils', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true}
+browser-utils = { package = 'substrate-browser-utils', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true}
 
 [dev-dependencies]
 tempfile = "3.1.0"
-sp-timestamp = { package = 'sp-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-keyring = { package = 'sp-keyring', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-consensus-babe = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', features = ["test-helpers"]}
-sc-service-test = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-frame-system = { package = 'frame-system', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-pallet-transaction-payment = { package = 'pallet-transaction-payment', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-pallet-grandpa = { package = 'pallet-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
+sp-timestamp = { package = 'sp-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-keyring = { package = 'sp-keyring', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-consensus-babe = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', features = ["test-helpers"]}
+sc-service-test = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+frame-system = { package = 'frame-system', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+pallet-transaction-payment = { package = 'pallet-transaction-payment', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+pallet-grandpa = { package = 'pallet-grandpa', git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
 
 [build-dependencies]
 structopt = { version = "0.3.8", optional = true }
-node-inspect = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true}
-sc-cli = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true}
-frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }
-substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', optional = true }
+node-inspect = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true}
+sc-cli = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true}
+frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true }
+substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', optional = true }
 
 [features]
 default = [ "cli" ]

+ 34 - 12
node/src/chain_spec/mod.rs

@@ -29,13 +29,13 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
 use sp_runtime::Perbill;
 
 use node_runtime::{
-    membership, AuthorityDiscoveryConfig, BabeConfig, Balance, BalancesConfig, ContentConfig,
-    ContentDirectoryWorkingGroupConfig, CouncilConfig, CouncilElectionConfig, DataDirectoryConfig,
-    DataObjectStorageRegistryConfig, DataObjectTypeRegistryConfig, ElectionParameters, ForumConfig,
-    GatewayWorkingGroupConfig, GrandpaConfig, ImOnlineConfig, MembersConfig, Moment,
-    OperationsWorkingGroupConfig, ProposalsCodexConfig, SessionConfig, SessionKeys, Signature,
-    StakerStatus, StakingConfig, StorageWorkingGroupConfig, SudoConfig, SystemConfig, DAYS,
-    WASM_BINARY,
+    membership, wasm_binary_unwrap, AuthorityDiscoveryConfig, BabeConfig, Balance, BalancesConfig,
+    ContentConfig, ContentDirectoryWorkingGroupConfig, CouncilConfig, CouncilElectionConfig,
+    DataDirectoryConfig, DataObjectStorageRegistryConfig, DataObjectTypeRegistryConfig,
+    ElectionParameters, ForumConfig, GatewayWorkingGroupConfig, GrandpaConfig, ImOnlineConfig,
+    MembersConfig, Moment, OperationsWorkingGroupConfig, ProposalsCodexConfig, SessionConfig,
+    SessionKeys, Signature, StakerStatus, StakingConfig, StorageWorkingGroupConfig, SudoConfig,
+    SystemConfig, DAYS,
 };
 
 // Exported to be used by chain-spec-builder
@@ -229,8 +229,8 @@ pub fn testnet_genesis(
         node_runtime::working_group::default_storage_size_constraint();
 
     GenesisConfig {
-        system: Some(SystemConfig {
-            code: WASM_BINARY.to_vec(),
+        frame_system: Some(SystemConfig {
+            code: wasm_binary_unwrap().to_vec(),
             changes_trie_config: Default::default(),
         }),
         pallet_balances: Some(BalancesConfig {
@@ -407,7 +407,7 @@ pub fn testnet_genesis(
 #[cfg(test)]
 pub(crate) mod tests {
     use super::*;
-    use crate::service::{new_full, new_light};
+    use crate::service::{new_full_base, new_light_base, NewFullBase};
     use sc_service_test;
 
     fn local_testnet_genesis_instant_single() -> GenesisConfig {
@@ -477,8 +477,30 @@ pub(crate) mod tests {
     fn test_connectivity() {
         sc_service_test::connectivity(
             integration_test_config_with_two_authorities(),
-            |config| new_full(config),
-            |config| new_light(config),
+            |config| {
+                let NewFullBase {
+                    task_manager,
+                    client,
+                    network,
+                    transaction_pool,
+                    ..
+                } = new_full_base(config, |_, _| ())?;
+                Ok(sc_service_test::TestNetComponents::new(
+                    task_manager,
+                    client,
+                    network,
+                    transaction_pool,
+                ))
+            },
+            |config| {
+                let (keep_alive, _, client, network, transaction_pool) = new_light_base(config)?;
+                Ok(sc_service_test::TestNetComponents::new(
+                    keep_alive,
+                    client,
+                    network,
+                    transaction_pool,
+                ))
+            },
         );
     }
 }

+ 44 - 10
node/src/cli.rs

@@ -1,20 +1,22 @@
-// Copyright 2019 Joystream Contributors
-// This file is part of Joystream node.
+// This file is part of Substrate.
 
-// Joystream node is free software: you can redistribute it and/or modify
+// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 // the Free Software Foundation, either version 3 of the License, or
 // (at your option) any later version.
 
-// Joystream node is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 // GNU General Public License for more details.
 
 // You should have received a copy of the GNU General Public License
-// along with Joystream node.  If not, see <http://www.gnu.org/licenses/>.
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
 
-use sc_cli::RunCmd;
+use sc_cli::{KeySubcommand, RunCmd, SignCmd, VanityCmd, VerifyCmd};
 use structopt::StructOpt;
 
 /// An overarching CLI command definition.
@@ -31,9 +33,8 @@ pub struct Cli {
 /// Possible subcommands of the main binary.
 #[derive(Debug, StructOpt)]
 pub enum Subcommand {
-    /// A set of base subcommands handled by `sc_cli`.
-    #[structopt(flatten)]
-    Base(sc_cli::Subcommand),
+    /// Key management cli utilities
+    Key(KeySubcommand),
 
     /// The custom inspect subcommmand for decoding blocks and extrinsics.
     #[structopt(
@@ -45,4 +46,37 @@ pub enum Subcommand {
     /// The custom benchmark subcommmand benchmarking runtime pallets.
     #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
     Benchmark(frame_benchmarking_cli::BenchmarkCmd),
+
+    /// Verify a signature for a message, provided on STDIN, with a given (public or secret) key.
+    Verify(VerifyCmd),
+
+    /// Generate a seed that provides a vanity address.
+    Vanity(VanityCmd),
+
+    /// Sign a message, with a given (secret) key.
+    Sign(SignCmd),
+
+    /// Build a chain specification.
+    BuildSpec(sc_cli::BuildSpecCmd),
+
+    /// Build a chain specification with a light client sync state.
+    BuildSyncSpec(sc_cli::BuildSyncSpecCmd),
+
+    /// Validate blocks.
+    CheckBlock(sc_cli::CheckBlockCmd),
+
+    /// Export blocks.
+    ExportBlocks(sc_cli::ExportBlocksCmd),
+
+    /// Export the state of a given block into a chain spec.
+    ExportState(sc_cli::ExportStateCmd),
+
+    /// Import blocks.
+    ImportBlocks(sc_cli::ImportBlocksCmd),
+
+    /// Remove the whole chain.
+    PurgeChain(sc_cli::PurgeChainCmd),
+
+    /// Revert the chain to a previous state.
+    Revert(sc_cli::RevertCmd),
 }

+ 112 - 24
node/src/command.rs

@@ -16,41 +16,45 @@
 
 use crate::cli::{Cli, Subcommand};
 use crate::node_executor;
-use crate::node_rpc;
 use crate::{chain_spec, service};
 
+use crate::service::{new_full_base, new_partial, NewFullBase};
 use node_executor::Executor;
 use node_runtime::{opaque::Block, RuntimeApi};
-use sc_cli::{Result, SubstrateCli};
-use sc_finality_grandpa::{self as grandpa};
+use sc_cli::{ChainSpec, Result, Role, RuntimeVersion, SubstrateCli};
+use sc_service::PartialComponents;
 
 impl SubstrateCli for Cli {
-    fn impl_name() -> &'static str {
-        "Joystream Node"
+    fn impl_name() -> String {
+        "Joystream Node".into()
     }
 
-    fn support_url() -> &'static str {
-        "https://www.joystream.org/"
+    fn support_url() -> String {
+        "https://www.joystream.org/".into()
     }
 
     fn copyright_start_year() -> i32 {
         2019
     }
 
-    fn executable_name() -> &'static str {
-        "joystream-node"
+    fn executable_name() -> String {
+        "joystream-node".into()
     }
 
-    fn impl_version() -> &'static str {
-        env!("SUBSTRATE_CLI_IMPL_VERSION")
+    fn impl_version() -> String {
+        env!("SUBSTRATE_CLI_IMPL_VERSION").into()
     }
 
-    fn description() -> &'static str {
-        env!("CARGO_PKG_DESCRIPTION")
+    fn description() -> String {
+        env!("CARGO_PKG_DESCRIPTION").into()
     }
 
-    fn author() -> &'static str {
-        env!("CARGO_PKG_AUTHORS")
+    fn author() -> String {
+        env!("CARGO_PKG_AUTHORS").into()
+    }
+
+    fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
+        &node_runtime::VERSION
     }
 
     fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
@@ -71,7 +75,10 @@ pub fn run() -> Result<()> {
     match &cli.subcommand {
         None => {
             let runner = cli.create_runner(&cli.run)?;
-            runner.run_node(service::new_light, service::new_full, node_runtime::VERSION)
+            runner.run_node_until_exit(|config| match config.role {
+                Role::Light => service::new_light(config),
+                _ => service::new_full(config),
+            })
         }
         Some(Subcommand::Inspect(cmd)) => {
             let runner = cli.create_runner(cmd)?;
@@ -84,17 +91,98 @@ pub fn run() -> Result<()> {
 
                 runner.sync_run(|config| cmd.run::<Block, Executor>(config))
             } else {
-                println!(
-                    "Benchmarking wasn't enabled when building the node. \
+                Err("Benchmarking wasn't enabled when building the node. \
 				You can enable it with `--features runtime-benchmarks`."
-                );
-                Ok(())
+                    .into())
             }
         }
-        Some(Subcommand::Base(subcommand)) => {
-            let runner = cli.create_runner(subcommand)?;
-
-            runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0))
+        Some(Subcommand::Key(cmd)) => cmd.run(),
+        Some(Subcommand::Sign(cmd)) => cmd.run(),
+        Some(Subcommand::Verify(cmd)) => cmd.run(),
+        Some(Subcommand::Vanity(cmd)) => cmd.run(),
+        Some(Subcommand::BuildSpec(cmd)) => {
+            let runner = cli.create_runner(cmd)?;
+            runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
+        }
+        Some(Subcommand::BuildSyncSpec(cmd)) => {
+            let runner = cli.create_runner(cmd)?;
+            runner.async_run(|config| {
+                let chain_spec = config.chain_spec.cloned_box();
+                let network_config = config.network.clone();
+                let NewFullBase {
+                    task_manager,
+                    client,
+                    network_status_sinks,
+                    ..
+                } = new_full_base(config, |_, _| ())?;
+
+                Ok((
+                    cmd.run(chain_spec, network_config, client, network_status_sinks),
+                    task_manager,
+                ))
+            })
+        }
+        Some(Subcommand::CheckBlock(cmd)) => {
+            let runner = cli.create_runner(cmd)?;
+            runner.async_run(|config| {
+                let PartialComponents {
+                    client,
+                    task_manager,
+                    import_queue,
+                    ..
+                } = new_partial(&config)?;
+                Ok((cmd.run(client, import_queue), task_manager))
+            })
+        }
+        Some(Subcommand::ExportBlocks(cmd)) => {
+            let runner = cli.create_runner(cmd)?;
+            runner.async_run(|config| {
+                let PartialComponents {
+                    client,
+                    task_manager,
+                    ..
+                } = new_partial(&config)?;
+                Ok((cmd.run(client, config.database), task_manager))
+            })
+        }
+        Some(Subcommand::ExportState(cmd)) => {
+            let runner = cli.create_runner(cmd)?;
+            runner.async_run(|config| {
+                let PartialComponents {
+                    client,
+                    task_manager,
+                    ..
+                } = new_partial(&config)?;
+                Ok((cmd.run(client, config.chain_spec), task_manager))
+            })
+        }
+        Some(Subcommand::ImportBlocks(cmd)) => {
+            let runner = cli.create_runner(cmd)?;
+            runner.async_run(|config| {
+                let PartialComponents {
+                    client,
+                    task_manager,
+                    import_queue,
+                    ..
+                } = new_partial(&config)?;
+                Ok((cmd.run(client, import_queue), task_manager))
+            })
+        }
+        Some(Subcommand::PurgeChain(cmd)) => {
+            let runner = cli.create_runner(cmd)?;
+            runner.sync_run(|config| cmd.run(config.database))
+        }
+        Some(Subcommand::Revert(cmd)) => {
+            let runner = cli.create_runner(cmd)?;
+            runner.async_run(|config| {
+                let PartialComponents {
+                    client,
+                    task_manager,
+                    backend,
+                    ..
+                } = new_partial(&config)?;
+                Ok((cmd.run(client, backend), task_manager))
+            })
         }
     }
 }

+ 35 - 19
node/src/node_rpc.rs

@@ -30,23 +30,24 @@
 
 #![warn(missing_docs)]
 
-use std::sync::Arc;
-
-use node_runtime::UncheckedExtrinsic;
 use node_runtime::{opaque::Block, AccountId, Balance, BlockNumber, Hash, Index};
 use sc_consensus_babe::{Config, Epoch};
 use sc_consensus_babe_rpc::BabeRpcHandler;
 use sc_consensus_epochs::SharedEpochChanges;
-use sc_finality_grandpa::{SharedAuthoritySet, SharedVoterState};
+use sc_finality_grandpa::{
+    FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState,
+};
 use sc_finality_grandpa_rpc::GrandpaRpcHandler;
 use sc_keystore::KeyStorePtr;
-use sc_rpc_api::DenyUnsafe;
+use sc_rpc::SubscriptionTaskExecutor;
+pub use sc_rpc_api::DenyUnsafe;
 use sp_api::ProvideRuntimeApi;
 use sp_block_builder::BlockBuilder;
 use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
 use sp_consensus::SelectChain;
 use sp_consensus_babe::BabeApi;
 use sp_transaction_pool::TransactionPool;
+use std::sync::Arc;
 
 /// Light client extra dependencies.
 pub struct LightDeps<C, F, P> {
@@ -71,15 +72,21 @@ pub struct BabeDeps {
 }
 
 /// Extra dependencies for GRANDPA
-pub struct GrandpaDeps {
+pub struct GrandpaDeps<B> {
     /// Voting round info.
     pub shared_voter_state: SharedVoterState,
     /// Authority set info.
     pub shared_authority_set: SharedAuthoritySet<Hash, BlockNumber>,
+    /// Receives notifications about justification events from Grandpa.
+    pub justification_stream: GrandpaJustificationStream<Block>,
+    /// Executor to drive the subscription manager in the Grandpa RPC handler.
+    pub subscription_executor: SubscriptionTaskExecutor,
+    /// Finality proof provider.
+    pub finality_provider: Arc<FinalityProofProvider<B, Block>>,
 }
 
 /// Full client dependencies.
-pub struct FullDeps<C, P, SC> {
+pub struct FullDeps<C, P, SC, B> {
     /// The client instance to use.
     pub client: Arc<C>,
     /// Transaction pool instance.
@@ -91,26 +98,28 @@ pub struct FullDeps<C, P, SC> {
     /// BABE specific dependencies.
     pub babe: BabeDeps,
     /// GRANDPA specific dependencies.
-    pub grandpa: GrandpaDeps,
+    pub grandpa: GrandpaDeps<B>,
 }
 
+/// A IO handler that uses all Full RPC extensions.
+pub type IoHandler = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
+
 /// Instantiate all Full RPC extensions.
-pub fn create_full<C, P, M, SC>(deps: FullDeps<C, P, SC>) -> jsonrpc_core::IoHandler<M>
+pub fn create_full<C, P, SC, B>(
+    deps: FullDeps<C, P, SC, B>,
+) -> jsonrpc_core::IoHandler<sc_rpc_api::Metadata>
 where
     C: ProvideRuntimeApi<Block>,
     C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,
     C: Send + Sync + 'static,
     C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
-    C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<
-        Block,
-        Balance,
-        UncheckedExtrinsic,
-    >,
+    C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
     C::Api: BabeApi<Block>,
     C::Api: BlockBuilder<Block>,
     P: TransactionPool + 'static,
-    M: jsonrpc_core::Metadata + Default,
     SC: SelectChain<Block> + 'static,
+    B: sc_client_api::Backend<Block> + Send + Sync + 'static,
+    B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,
 {
     use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
     use substrate_frame_rpc_system::{FullSystem, SystemApi};
@@ -124,6 +133,7 @@ where
         babe,
         grandpa,
     } = deps;
+
     let BabeDeps {
         keystore,
         babe_config,
@@ -132,6 +142,9 @@ where
     let GrandpaDeps {
         shared_voter_state,
         shared_authority_set,
+        justification_stream,
+        subscription_executor,
+        finality_provider,
     } = grandpa;
 
     io.extend_with(SystemApi::to_delegate(FullSystem::new(
@@ -139,9 +152,6 @@ where
         pool,
         deny_unsafe,
     )));
-    // Making synchronous calls in light client freezes the browser currently,
-    // more context: https://github.com/paritytech/substrate/pull/3480
-    // These RPCs should use an asynchronous caller instead.
     io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(
         client.clone(),
     )));
@@ -156,7 +166,13 @@ where
         ),
     ));
     io.extend_with(sc_finality_grandpa_rpc::GrandpaApi::to_delegate(
-        GrandpaRpcHandler::new(shared_authority_set, shared_voter_state),
+        GrandpaRpcHandler::new(
+            shared_authority_set,
+            shared_voter_state,
+            justification_stream,
+            subscription_executor,
+            finality_provider,
+        ),
     ));
 
     io

File diff suppressed because it is too large
+ 503 - 401
node/src/service.rs


+ 9 - 9
runtime-modules/common/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = 'pallet-common'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
@@ -8,13 +8,13 @@ edition = '2018'
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
 strum = {version = "0.19", optional = true}
 strum_macros = {version = "0.19", optional = true}
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = 'a200cdb93c6af5763b9c7bf313fa708764ac88ca'}
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
 
 [features]
 default = ['std']
@@ -27,6 +27,6 @@ std = [
 	'sp-arithmetic/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'pallet-timestamp/std',
 ]

+ 4 - 3
runtime-modules/common/src/currency.rs

@@ -1,14 +1,15 @@
 use frame_support::traits::{Currency, LockableCurrency, ReservableCurrency};
 use sp_runtime::traits::Convert;
 
-pub trait GovernanceCurrency: system::Trait + Sized {
+pub trait GovernanceCurrency: frame_system::Trait + Sized {
     type Currency: Currency<Self::AccountId>
         + ReservableCurrency<Self::AccountId>
         + LockableCurrency<Self::AccountId, Moment = Self::BlockNumber>;
 }
 
-pub type BalanceOf<T> =
-    <<T as GovernanceCurrency>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+pub type BalanceOf<T> = <<T as GovernanceCurrency>::Currency as Currency<
+    <T as frame_system::Trait>::AccountId,
+>>::Balance;
 
 /// A structure that converts the currency type into a lossy u64
 /// And back from u128

+ 3 - 3
runtime-modules/common/src/lib.rs

@@ -26,7 +26,7 @@ pub type ActorId<T> = <T as MembershipTypes>::ActorId;
 pub type Url = Vec<u8>;
 
 /// Generic trait for membership dependent pallets.
-pub trait MembershipTypes: system::Trait {
+pub trait MembershipTypes: frame_system::Trait {
     /// Describes the common type for the members.
     type MemberId: Parameter
         + Member
@@ -105,10 +105,10 @@ pub struct BlockAndTime<BlockNumber, Moment> {
 /// Gathers current block and time information for the runtime.
 /// If this function is used inside a config() at genesis the timestamp will be 0
 /// because the timestamp is actually produced by validators.
-pub fn current_block_time<T: system::Trait + pallet_timestamp::Trait>(
+pub fn current_block_time<T: frame_system::Trait + pallet_timestamp::Trait>(
 ) -> BlockAndTime<T::BlockNumber, T::Moment> {
     BlockAndTime {
-        block: <system::Module<T>>::block_number(),
+        block: <frame_system::Module<T>>::block_number(),
         time: <pallet_timestamp::Module<T>>::now(),
     }
 }

+ 3 - 3
runtime-modules/common/src/origin.rs

@@ -1,4 +1,4 @@
-use system::RawOrigin;
+use frame_system::RawOrigin;
 
 /// Abstract validator for the origin(account_id) and actor_id (eg.: thread author id).
 pub trait ActorOriginValidator<Origin, ActorId, AccountId> {
@@ -8,9 +8,9 @@ pub trait ActorOriginValidator<Origin, ActorId, AccountId> {
 
 // TODO: delete when T::Origin will support the clone()
 /// Multiplies the T::Origin.
-/// In our current substrate version system::Origin doesn't support clone(),
+/// In our current substrate version frame_system::Origin doesn't support clone(),
 /// but it will be supported in latest up-to-date substrate version.
-pub fn double_origin<T: system::Trait>(origin: T::Origin) -> (T::Origin, T::Origin) {
+pub fn double_origin<T: frame_system::Trait>(origin: T::Origin) -> (T::Origin, T::Origin) {
     let coerced_origin = origin.into().ok().unwrap_or(RawOrigin::None);
 
     let (cloned_origin1, cloned_origin2) = match coerced_origin {

+ 5 - 4
runtime-modules/common/src/storage.rs

@@ -19,8 +19,9 @@ pub struct ContentParameters<ContentId, DataObjectTypeId> {
 pub enum StorageObjectOwner<MemberId, ChannelId, DAOId> {
     Member(MemberId),
     Channel(ChannelId), // acts through content directory module, where again DAOs can own channels for example
-    DAO(DAOId),         // acts through upcoming `content_finance` module
-    Council,            // acts through proposal system
+    #[allow(clippy::upper_case_acronyms)]
+    DAO(DAOId), // acts through upcoming `content_finance` module
+    Council,            // acts through proposal frame_system
     WorkingGroup(WorkingGroup), // acts through new extrinsic in working group
 }
 
@@ -37,7 +38,7 @@ pub trait StorageSystem<T: crate::StorageOwnership + crate::MembershipTypes> {
         content_parameters: Vec<ContentParameters<T::ContentId, T::DataObjectTypeId>>,
     ) -> DispatchResult;
 
-    // Checks if given owner can add provided content to the storage system
+    // Checks if given owner can add provided content to the storage frame_system
     fn can_add_content(
         owner: StorageObjectOwner<T::MemberId, T::ChannelId, T::DAOId>,
         content_parameters: Vec<ContentParameters<T::ContentId, T::DataObjectTypeId>>,
@@ -48,7 +49,7 @@ pub trait StorageSystem<T: crate::StorageOwnership + crate::MembershipTypes> {
         content_ids: &[T::ContentId],
     ) -> DispatchResult;
 
-    // Checks if given owner can remove content under given content ids from the storage system
+    // Checks if given owner can remove content under given content ids from the storage frame_system
     fn can_remove_content(
         owner: &StorageObjectOwner<T::MemberId, T::ChannelId, T::DAOId>,
         content_ids: &[T::ContentId],

+ 12 - 12
runtime-modules/content/Cargo.toml

@@ -1,24 +1,24 @@
 [package]
 name = 'pallet-content'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
 serde = {version = '1.0.101', features = ['derive'], optional = true}
 common = { package = 'pallet-common', default-features = false, path = '../common'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -26,7 +26,7 @@ std = [
 	'sp-std/std',
 	'sp-runtime/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'sp-arithmetic/std',
 	'codec/std',
 	'serde',

+ 60 - 60
runtime-modules/content/src/lib.rs

@@ -19,6 +19,7 @@ use codec::{Decode, Encode};
 use frame_support::{
     decl_event, decl_module, decl_storage, dispatch::DispatchResult, ensure, traits::Get, Parameter,
 };
+use frame_system::ensure_signed;
 #[cfg(feature = "std")]
 pub use serde::{Deserialize, Serialize};
 use sp_arithmetic::traits::{BaseArithmetic, One, Zero};
@@ -26,7 +27,6 @@ use sp_runtime::traits::{MaybeSerializeDeserialize, Member};
 use sp_std::collections::btree_set::BTreeSet;
 use sp_std::vec;
 use sp_std::vec::Vec;
-use system::ensure_signed;
 
 pub use common::storage::{
     ContentParameters as ContentParametersRecord, StorageObjectOwner as StorageObjectOwnerRecord,
@@ -76,7 +76,7 @@ impl NumericIdentifier for u64 {}
 
 /// Module configuration trait for Content Directory Module
 pub trait Trait:
-    system::Trait
+    frame_system::Trait
     + ContentActorAuthenticator
     + Clone
     + StorageOwnership
@@ -84,7 +84,7 @@ pub trait Trait:
     + GovernanceCurrency
 {
     /// The overarching event type.
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     /// Channel Transfer Payments Escrow Account seed for ModuleId to compute deterministic AccountId
     type ChannelOwnershipPaymentEscrowId: Get<[u8; 8]>;
@@ -113,7 +113,7 @@ pub trait Trait:
     /// The maximum number of curators per group constraint
     type MaxNumberOfCuratorsPerGroup: Get<MaxNumber>;
 
-    // Type that handles asset uploads to storage system
+    // Type that handles asset uploads to storage frame_system
     type StorageSystem: StorageSystem<Self>;
 }
 
@@ -122,7 +122,7 @@ pub trait Trait:
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
 pub enum NewAsset<ContentParameters> {
-    /// Upload to the storage system
+    /// Upload to the storage frame_system
     Upload(ContentParameters),
     /// Multiple url strings pointing at an asset
     Urls(Vec<Url>),
@@ -210,7 +210,7 @@ pub type Channel<T> = ChannelRecord<
     <T as MembershipTypes>::MemberId,
     <T as ContentActorAuthenticator>::CuratorGroupId,
     <T as StorageOwnership>::DAOId,
-    <T as system::Trait>::AccountId,
+    <T as frame_system::Trait>::AccountId,
     <T as Trait>::VideoId,
     <T as Trait>::PlaylistId,
     <T as Trait>::SeriesId,
@@ -240,7 +240,7 @@ pub type ChannelOwnershipTransferRequest<T> = ChannelOwnershipTransferRequestRec
     <T as ContentActorAuthenticator>::CuratorGroupId,
     <T as StorageOwnership>::DAOId,
     BalanceOf<T>,
-    <T as system::Trait>::AccountId,
+    <T as frame_system::Trait>::AccountId,
 >;
 
 /// Information about channel being created.
@@ -646,7 +646,7 @@ decl_module! {
             // The channel owner will be..
             let channel_owner = Self::actor_to_channel_owner(&actor)?;
 
-            // Pick out the assets to be uploaded to storage system
+            // Pick out the assets to be uploaded to storage frame_system
             let content_parameters: Vec<ContentParameters<T>> = Self::pick_content_parameters_from_assets(&params.assets);
 
             let channel_id = NextChannelId::<T>::get();
@@ -697,7 +697,7 @@ decl_module! {
                 &channel.owner,
             )?;
 
-            // Pick out the assets to be uploaded to storage system
+            // Pick out the assets to be uploaded to storage frame_system
             let new_assets = if let Some(assets) = &params.assets {
                 let upload_parameters: Vec<ContentParameters<T>> = Self::pick_content_parameters_from_assets(assets);
 
@@ -867,9 +867,9 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn request_channel_transfer(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            request: ChannelOwnershipTransferRequest<T>,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _request: ChannelOwnershipTransferRequest<T>,
         ) {
             // requester must be new_owner
             Self::not_implemented()?;
@@ -877,8 +877,8 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn cancel_channel_transfer_request(
-            origin,
-            request_id: T::ChannelOwnershipTransferRequestId,
+            _origin,
+            _request_id: T::ChannelOwnershipTransferRequestId,
         ) {
             // origin must be original requester (ie. proposed new channel owner)
             Self::not_implemented()?;
@@ -886,9 +886,9 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn accept_channel_transfer(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            request_id: T::ChannelOwnershipTransferRequestId,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _request_id: T::ChannelOwnershipTransferRequestId,
         ) {
             // only current owner of channel can approve
             Self::not_implemented()?;
@@ -910,7 +910,7 @@ decl_module! {
                 &channel.owner,
             )?;
 
-            // Pick out the assets to be uploaded to storage system
+            // Pick out the assets to be uploaded to storage frame_system
             let content_parameters: Vec<ContentParameters<T>> = Self::pick_content_parameters_from_assets(&params.assets);
 
             let video_id = NextVideoId::<T>::get();
@@ -967,7 +967,7 @@ decl_module! {
                 &Self::channel_by_id(channel_id).owner,
             )?;
 
-            // Pick out the assets to be uploaded to storage system
+            // Pick out the assets to be uploaded to storage frame_system
             let new_assets = if let Some(assets) = &params.assets {
                 let upload_parameters: Vec<ContentParameters<T>> = Self::pick_content_parameters_from_assets(assets);
 
@@ -1042,30 +1042,30 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn create_playlist(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            channel_id: T::ChannelId,
-            params: PlaylistCreationParameters,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _channel_id: T::ChannelId,
+            _params: PlaylistCreationParameters,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn update_playlist(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            playlist: T::PlaylistId,
-            params: PlaylistUpdateParameters,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _playlist: T::PlaylistId,
+            _params: PlaylistUpdateParameters,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn delete_playlist(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            channel_id: T::ChannelId,
-            playlist: T::PlaylistId,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _channel_id: T::ChannelId,
+            _playlist: T::PlaylistId,
         ) {
             Self::not_implemented()?;
         }
@@ -1150,47 +1150,47 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn create_person(
-            origin,
-            actor: PersonActor<T::MemberId, T::CuratorId>,
-            params: PersonCreationParameters<ContentParameters<T>>,
+            _origin,
+            _actor: PersonActor<T::MemberId, T::CuratorId>,
+            _params: PersonCreationParameters<ContentParameters<T>>,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn update_person(
-            origin,
-            actor: PersonActor<T::MemberId, T::CuratorId>,
-            person: T::PersonId,
-            params: PersonUpdateParameters<ContentParameters<T>>,
+            _origin,
+            _actor: PersonActor<T::MemberId, T::CuratorId>,
+            _person: T::PersonId,
+            _params: PersonUpdateParameters<ContentParameters<T>>,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn delete_person(
-            origin,
-            actor: PersonActor<T::MemberId, T::CuratorId>,
-            person: T::PersonId,
+            _origin,
+            _actor: PersonActor<T::MemberId, T::CuratorId>,
+            _person: T::PersonId,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn add_person_to_video(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            video_id: T::VideoId,
-            person: T::PersonId
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _video_id: T::VideoId,
+            _person: T::PersonId
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn remove_person_from_video(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            video_id: T::VideoId
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _video_id: T::VideoId
         ) {
             Self::not_implemented()?;
         }
@@ -1233,29 +1233,29 @@ decl_module! {
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn create_series(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            channel_id: T::ChannelId,
-            params: SeriesParameters<T::VideoId, ContentParameters<T>>,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _channel_id: T::ChannelId,
+            _params: SeriesParameters<T::VideoId, ContentParameters<T>>,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn update_series(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            channel_id: T::ChannelId,
-            params: SeriesParameters<T::VideoId, ContentParameters<T>>,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _channel_id: T::ChannelId,
+            _params: SeriesParameters<T::VideoId, ContentParameters<T>>,
         ) {
             Self::not_implemented()?;
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn delete_series(
-            origin,
-            actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
-            series: T::SeriesId,
+            _origin,
+            _actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
+            _series: T::SeriesId,
         ) {
             Self::not_implemented()?;
         }
@@ -1400,7 +1400,7 @@ decl_event!(
         Series = Series<<T as StorageOwnership>::ChannelId, <T as Trait>::VideoId>,
         Channel = Channel<T>,
         ContentParameters = ContentParameters<T>,
-        AccountId = <T as system::Trait>::AccountId,
+        AccountId = <T as frame_system::Trait>::AccountId,
         ContentId = ContentId<T>,
         IsCensored = bool,
     {

+ 2 - 2
runtime-modules/content/src/permissions/mod.rs

@@ -12,10 +12,10 @@ use frame_support::{ensure, Parameter};
 pub use serde::{Deserialize, Serialize};
 use sp_arithmetic::traits::BaseArithmetic;
 use sp_runtime::traits::{MaybeSerializeDeserialize, Member};
-// use system::ensure_root;
+// use frame_system::ensure_root;
 
 /// Model of authentication manager.
-pub trait ContentActorAuthenticator: system::Trait + MembershipTypes {
+pub trait ContentActorAuthenticator: frame_system::Trait + MembershipTypes {
     /// Curator identifier
     type CuratorId: Parameter
         + Member

+ 10 - 6
runtime-modules/content/src/tests/mock.rs

@@ -58,7 +58,7 @@ mod content {
 impl_outer_event! {
     pub enum MetaEvent for Test {
         content<T>,
-        system<T>,
+        frame_system<T>,
         balances<T>,
     }
 }
@@ -74,7 +74,7 @@ parameter_types! {
     pub const MinimumPeriod: u64 = 5;
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -95,16 +95,18 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type PalletInfo = ();
+    type SystemWeightInfo = ();
 }
 
 impl pallet_timestamp::Trait for Test {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 
 impl common::MembershipTypes for Test {
@@ -129,6 +131,8 @@ impl balances::Trait for Test {
     type Event = MetaEvent;
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl GovernanceCurrency for Test {
@@ -231,11 +235,11 @@ impl Trait for Test {
     /// The maximum number of curators per group constraint
     type MaxNumberOfCuratorsPerGroup = MaxNumberOfCuratorsPerGroup;
 
-    // Type that handles asset uploads to storage system
+    // Type that handles asset uploads to storage frame_system
     type StorageSystem = MockStorageSystem;
 }
 
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 pub type Content = Module<Test>;
 // #[derive (Default)]
 pub struct ExtBuilder {
@@ -268,7 +272,7 @@ impl Default for ExtBuilder {
 
 impl ExtBuilder {
     pub fn build(self) -> sp_io::TestExternalities {
-        let mut t = system::GenesisConfig::default()
+        let mut t = frame_system::GenesisConfig::default()
             .build_storage::<Test>()
             .unwrap();
 

+ 12 - 12
runtime-modules/forum/Cargo.toml

@@ -1,23 +1,23 @@
 [package]
 name = 'pallet-forum'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 common = { package = 'pallet-common', default-features = false, path = '../common'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -25,10 +25,10 @@ std = [
 	'serde',
 	'codec/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'sp-std/std',
 	'sp-arithmetic/std',
 	'sp-runtime/std',
 	'pallet-timestamp/std',
 	'common/std',
-]
+]

+ 4 - 4
runtime-modules/forum/src/lib.rs

@@ -64,7 +64,7 @@ const ERROR_CATEGORY_NOT_BEING_UPDATED: &str = "Category not being updated.";
 const ERROR_CATEGORY_CANNOT_BE_UNARCHIVED_WHEN_DELETED: &str =
     "Category cannot be unarchived when deleted.";
 
-use system::{ensure_root, ensure_signed};
+use frame_system::{ensure_root, ensure_signed};
 
 /// Represents a user in this forum.
 #[derive(Debug, Copy, Clone)]
@@ -261,8 +261,8 @@ impl<BlockNumber, Moment, AccountId> Category<BlockNumber, Moment, AccountId> {
 type CategoryTreePath<BlockNumber, Moment, AccountId> =
     Vec<Category<BlockNumber, Moment, AccountId>>;
 
-pub trait Trait: system::Trait + pallet_timestamp::Trait + Sized {
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+pub trait Trait: frame_system::Trait + pallet_timestamp::Trait + Sized {
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     type MembershipRegistry: ForumUserRegistry<Self::AccountId>;
 
@@ -329,7 +329,7 @@ decl_storage! {
 decl_event!(
     pub enum Event<T>
     where
-        <T as system::Trait>::AccountId,
+        <T as frame_system::Trait>::AccountId,
         <T as Trait>::ThreadId,
         <T as Trait>::PostId,
     {

+ 16 - 14
runtime-modules/forum/src/mock.rs

@@ -69,7 +69,7 @@ parameter_types! {
     pub const MinimumPeriod: u64 = 5;
 }
 
-impl system::Trait for Runtime {
+impl frame_system::Trait for Runtime {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -90,16 +90,18 @@ impl system::Trait for Runtime {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = ();
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type SystemWeightInfo = ();
+    type PalletInfo = ();
 }
 
 impl pallet_timestamp::Trait for Runtime {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 
 impl Trait for Runtime {
@@ -111,7 +113,7 @@ impl Trait for Runtime {
 
 #[derive(Clone)]
 pub enum OriginType {
-    Signed(<Runtime as system::Trait>::AccountId),
+    Signed(<Runtime as frame_system::Trait>::AccountId),
     //Inherent, <== did not find how to make such an origin yet
     Root,
 }
@@ -120,7 +122,7 @@ pub fn mock_origin(origin: OriginType) -> mock::Origin {
     match origin {
         OriginType::Signed(account_id) => Origin::signed(account_id),
         //OriginType::Inherent => Origin::inherent,
-        OriginType::Root => system::RawOrigin::Root.into(), //Origin::root
+        OriginType::Root => frame_system::RawOrigin::Root.into(), //Origin::root
     }
 }
 
@@ -455,25 +457,25 @@ pub fn default_genesis_config() -> GenesisConfig<Runtime> {
 
 pub type RuntimeMap<K, V> = std::vec::Vec<(K, V)>;
 pub type RuntimeCategory = Category<
-    <Runtime as system::Trait>::BlockNumber,
+    <Runtime as frame_system::Trait>::BlockNumber,
     <Runtime as pallet_timestamp::Trait>::Moment,
-    <Runtime as system::Trait>::AccountId,
+    <Runtime as frame_system::Trait>::AccountId,
 >;
 pub type RuntimeThread = Thread<
-    <Runtime as system::Trait>::BlockNumber,
+    <Runtime as frame_system::Trait>::BlockNumber,
     <Runtime as pallet_timestamp::Trait>::Moment,
-    <Runtime as system::Trait>::AccountId,
+    <Runtime as frame_system::Trait>::AccountId,
     RuntimeThreadId,
 >;
 pub type RuntimePost = Post<
-    <Runtime as system::Trait>::BlockNumber,
+    <Runtime as frame_system::Trait>::BlockNumber,
     <Runtime as pallet_timestamp::Trait>::Moment,
-    <Runtime as system::Trait>::AccountId,
+    <Runtime as frame_system::Trait>::AccountId,
     RuntimeThreadId,
     RuntimePostId,
 >;
 pub type RuntimeBlockchainTimestamp = BlockAndTime<
-    <Runtime as system::Trait>::BlockNumber,
+    <Runtime as frame_system::Trait>::BlockNumber,
     <Runtime as pallet_timestamp::Trait>::Moment,
 >;
 
@@ -487,7 +489,7 @@ pub fn genesis_config(
     next_thread_id: u64,
     post_by_id: &RuntimeMap<RuntimePostId, RuntimePost>,
     next_post_id: u64,
-    forum_sudo: <Runtime as system::Trait>::AccountId,
+    forum_sudo: <Runtime as frame_system::Trait>::AccountId,
     category_title_constraint: &InputValidationLengthConstraint,
     category_description_constraint: &InputValidationLengthConstraint,
     thread_title_constraint: &InputValidationLengthConstraint,
@@ -523,7 +525,7 @@ pub fn default_mock_forum_user_registry_genesis_config() -> registry::GenesisCon
 // Wanted to have payload: a: &GenesisConfig<Test>
 // but borrow checker made my life miserabl, so giving up for now.
 pub fn build_test_externalities(config: GenesisConfig<Runtime>) -> sp_io::TestExternalities {
-    let mut t = system::GenesisConfig::default()
+    let mut t = frame_system::GenesisConfig::default()
         .build_storage::<Runtime>()
         .unwrap();
 
@@ -537,7 +539,7 @@ pub fn build_test_externalities(config: GenesisConfig<Runtime>) -> sp_io::TestEx
     t.into()
 }
 
-// pub type System = system::Module<Runtime>;
+// pub type System = frame_system::Module<Runtime>;
 
 /// Export forum module on a test runtime
 pub type TestForumModule = Module<Runtime>;

+ 13 - 13
runtime-modules/governance/Cargo.toml

@@ -1,27 +1,27 @@
 [package]
 name = 'pallet-governance'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 membership = { package = 'pallet-membership', default-features = false, path = '../membership'}
 minting = { package = 'pallet-token-mint', default-features = false, path = '../token-minting'}
 recurringrewards = { package = 'pallet-recurring-reward', default-features = false, path = '../recurring-reward'}
 common = { package = 'pallet-common', default-features = false, path = '../common'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -30,7 +30,7 @@ std = [
 	'codec/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'sp-arithmetic/std',
 	'sp-runtime/std',
 	'pallet-timestamp/std',
@@ -38,4 +38,4 @@ std = [
 	'minting/std',
 	'recurringrewards/std',
 	'common/std',
-]
+]

+ 19 - 16
runtime-modules/governance/src/council.rs

@@ -1,8 +1,8 @@
 use frame_support::{debug, decl_event, decl_module, decl_storage, ensure};
+use frame_system::ensure_root;
 use sp_arithmetic::traits::{One, Zero};
 use sp_std::vec;
 use sp_std::vec::Vec;
-use system::ensure_root;
 
 pub use super::election::{self, CouncilElected, Seat, Seats};
 pub use common::currency::{BalanceOf, GovernanceCurrency};
@@ -22,8 +22,8 @@ impl<X: CouncilTermEnded> CouncilTermEnded for (X,) {
     }
 }
 
-pub trait Trait: system::Trait + recurringrewards::Trait + GovernanceCurrency {
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+pub trait Trait: frame_system::Trait + recurringrewards::Trait + GovernanceCurrency {
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     type CouncilTermEnded: CouncilTermEnded;
 }
@@ -32,7 +32,7 @@ decl_storage! {
     trait Store for Module<T: Trait> as Council {
         pub ActiveCouncil get(fn active_council) config(): Seats<T::AccountId, BalanceOf<T>>;
 
-        pub TermEndsAt get(fn term_ends_at) config() : T::BlockNumber = T::BlockNumber::from(1);
+        pub TermEndsAt get(fn term_ends_at) config() : T::BlockNumber = T::BlockNumber::from(1u32);
 
         /// The mint that funds council member rewards and spending proposals budget
         pub CouncilMint get(fn council_mint) : <T as minting::Trait>::MintId;
@@ -56,7 +56,7 @@ decl_storage! {
         build(|_config: &GenesisConfig<T>| {
             // Create the council mint.
             let mint_id_result = <minting::Module<T>>::add_mint(
-                minting::BalanceOf::<T>::from(0),
+                minting::BalanceOf::<T>::from(0u32),
                 None
             );
 
@@ -71,7 +71,7 @@ decl_storage! {
 
 // Event for this module.
 decl_event!(
-    pub enum Event<T> where <T as system::Trait>::BlockNumber {
+    pub enum Event<T> where <T as frame_system::Trait>::BlockNumber {
         CouncilTermEnded(BlockNumber),
         NewCouncilTermStarted(BlockNumber),
     }
@@ -81,7 +81,7 @@ impl<T: Trait> CouncilElected<Seats<T::AccountId, BalanceOf<T>>, T::BlockNumber>
     fn council_elected(seats: Seats<T::AccountId, BalanceOf<T>>, term: T::BlockNumber) {
         <ActiveCouncil<T>>::put(seats.clone());
 
-        let next_term_ends_at = <system::Module<T>>::block_number() + term;
+        let next_term_ends_at = <frame_system::Module<T>>::block_number() + term;
 
         <TermEndsAt<T>>::put(next_term_ends_at);
 
@@ -95,7 +95,7 @@ impl<T: Trait> CouncilElected<Seats<T::AccountId, BalanceOf<T>>, T::BlockNumber>
 
 impl<T: Trait> Module<T> {
     pub fn is_term_ended() -> bool {
-        <system::Module<T>>::block_number() >= Self::term_ends_at()
+        <frame_system::Module<T>>::block_number() >= Self::term_ends_at()
     }
 
     pub fn is_councilor(sender: &T::AccountId) -> bool {
@@ -107,7 +107,7 @@ impl<T: Trait> Module<T> {
 
         // When calculating when first payout occurs, add minimum of one block interval to ensure rewards module
         // has a chance to execute its on_finalize routine.
-        let next_payout_at = system::Module::<T>::block_number()
+        let next_payout_at = frame_system::Module::<T>::block_number()
             + Self::first_payout_after_reward_created()
             + T::BlockNumber::one();
 
@@ -229,7 +229,7 @@ decl_module! {
         #[weight = 10_000_000] // TODO: adjust weight
         fn set_term_ends_at(origin, ends_at: T::BlockNumber) {
             ensure_root(origin)?;
-            ensure!(ends_at > <system::Module<T>>::block_number(), "must set future block number");
+            ensure!(ends_at > <frame_system::Module<T>>::block_number(), "must set future block number");
             <TermEndsAt<T>>::put(ends_at);
         }
 
@@ -280,8 +280,11 @@ mod tests {
     use crate::DispatchResult;
     use frame_support::*;
 
-    fn add_council_member_as_root(account: <Test as system::Trait>::AccountId) -> DispatchResult {
-        Council::add_council_member(system::RawOrigin::Root.into(), account).map_err(|e| e.into())
+    fn add_council_member_as_root(
+        account: <Test as frame_system::Trait>::AccountId,
+    ) -> DispatchResult {
+        Council::add_council_member(frame_system::RawOrigin::Root.into(), account)
+            .map_err(|e| e.into())
     }
 
     #[test]
@@ -306,7 +309,7 @@ mod tests {
             assert_ok!(add_council_member_as_root(3));
 
             assert_ok!(Council::remove_council_member(
-                system::RawOrigin::Root.into(),
+                frame_system::RawOrigin::Root.into(),
                 2
             ));
 
@@ -320,7 +323,7 @@ mod tests {
     fn set_council_test() {
         initial_test_ext().execute_with(|| {
             assert_ok!(Council::set_council(
-                system::RawOrigin::Root.into(),
+                frame_system::RawOrigin::Root.into(),
                 vec![4, 5, 6]
             ));
             assert!(Council::is_councilor(&4));
@@ -334,7 +337,7 @@ mod tests {
         initial_test_ext().execute_with(|| {
             // Ensure a mint is created so we can create rewards
             assert_ok!(Council::set_council_mint_capacity(
-                system::RawOrigin::Root.into(),
+                frame_system::RawOrigin::Root.into(),
                 1000
             ));
 
@@ -356,7 +359,7 @@ mod tests {
                         backers: vec![],
                     },
                 ],
-                50 as u64, // <Test as system::Trait>::BlockNumber::from(50)
+                50 as u64, // <Test as frame_system::Trait>::BlockNumber::from(50)
             );
 
             assert!(Council::is_councilor(&5));

+ 31 - 22
runtime-modules/governance/src/election.rs

@@ -28,6 +28,7 @@
 
 // Clippy linter warning
 #![allow(clippy::redundant_closure_call)] // disable it because of the substrate lib design
+#![allow(clippy::match_like_matches_macro)]
 
 #[cfg(feature = "std")]
 use serde::{Deserialize, Serialize};
@@ -35,13 +36,13 @@ use serde::{Deserialize, Serialize};
 use codec::{Decode, Encode};
 use frame_support::traits::{Currency, ReservableCurrency};
 use frame_support::{decl_event, decl_module, decl_storage, ensure};
+use frame_system::{ensure_root, ensure_signed};
 use sp_arithmetic::traits::Zero;
 use sp_runtime::traits::Hash;
 use sp_std::collections::btree_map::BTreeMap;
 use sp_std::ops::Add;
 use sp_std::vec;
 use sp_std::vec::Vec;
-use system::{ensure_root, ensure_signed};
 
 use super::sealed_vote::SealedVote;
 use super::stake::Stake;
@@ -52,8 +53,10 @@ pub use common::currency::{BalanceOf, GovernanceCurrency};
 
 use crate::DispatchResult;
 
-pub trait Trait: system::Trait + council::Trait + GovernanceCurrency + membership::Trait {
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+pub trait Trait:
+    frame_system::Trait + council::Trait + GovernanceCurrency + membership::Trait
+{
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     type CouncilElected: CouncilElected<Seats<Self::AccountId, BalanceOf<Self>>, Self::BlockNumber>;
 }
@@ -183,9 +186,9 @@ decl_storage! {
 // Event for this module.
 decl_event!(
     pub enum Event<T> where
-    <T as system::Trait>::BlockNumber,
-    <T as system::Trait>::AccountId,
-    <T as system::Trait>::Hash  {
+    <T as frame_system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::AccountId,
+    <T as frame_system::Trait>::Hash  {
         /// A new election started
         ElectionStarted(),
         AnnouncingStarted(u32),
@@ -213,7 +216,7 @@ impl<T: Trait> Module<T> {
     }
 
     fn current_block_number_plus(length: T::BlockNumber) -> T::BlockNumber {
-        <system::Module<T>>::block_number() + length
+        <frame_system::Module<T>>::block_number() + length
     }
 
     fn can_participate(sender: &T::AccountId) -> bool {
@@ -255,7 +258,7 @@ impl<T: Trait> Module<T> {
         ensure!(Self::commitments().is_empty(), "commitments must be empty");
 
         // Take snapshot of seat and backing stakes of an existing council
-        // Its important to note that the election system takes ownership of these stakes, and is responsible
+        // Its important to note that the election frame_system takes ownership of these stakes, and is responsible
         // to return any unused stake to original owners at the end of the election.
         Self::initialize_transferable_stakes(current_council);
 
@@ -394,7 +397,9 @@ impl<T: Trait> Module<T> {
         let new_council = new_council.into_iter().map(|(_, seat)| seat).collect();
         T::CouncilElected::council_elected(new_council, Self::new_term_duration());
 
-        Self::deposit_event(RawEvent::CouncilElected(<system::Module<T>>::block_number()));
+        Self::deposit_event(RawEvent::CouncilElected(
+            <frame_system::Module<T>>::block_number(),
+        ));
     }
 
     fn teardown_election(
@@ -785,7 +790,11 @@ impl<T: Trait> Module<T> {
         let mut salt = salt;
 
         // Tries to unseal, if salt is invalid will return error
-        sealed_vote.unseal(vote_for, &mut salt, <T as system::Trait>::Hashing::hash)?;
+        sealed_vote.unseal(
+            vote_for,
+            &mut salt,
+            <T as frame_system::Trait>::Hashing::hash,
+        )?;
 
         // Update the revealed vote
         <Votes<T>>::insert(commitment, sealed_vote);
@@ -881,21 +890,21 @@ decl_module! {
         #[weight = 10_000_000] // TODO: adjust weight
         fn set_stage_announcing(origin, ends_at: T::BlockNumber) {
             ensure_root(origin)?;
-            ensure!(ends_at > <system::Module<T>>::block_number(), "must end at future block number");
+            ensure!(ends_at > <frame_system::Module<T>>::block_number(), "must end at future block number");
             <Stage<T>>::put(ElectionStage::Announcing(ends_at));
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         fn set_stage_revealing(origin, ends_at: T::BlockNumber) {
             ensure_root(origin)?;
-            ensure!(ends_at > <system::Module<T>>::block_number(), "must end at future block number");
+            ensure!(ends_at > <frame_system::Module<T>>::block_number(), "must end at future block number");
             <Stage<T>>::put(ElectionStage::Revealing(ends_at));
         }
 
         #[weight = 10_000_000] // TODO: adjust weight
         fn set_stage_voting(origin, ends_at: T::BlockNumber) {
             ensure_root(origin)?;
-            ensure!(ends_at > <system::Module<T>>::block_number(), "must end at future block number");
+            ensure!(ends_at > <frame_system::Module<T>>::block_number(), "must end at future block number");
             <Stage<T>>::put(ElectionStage::Voting(ends_at));
         }
 
@@ -961,7 +970,7 @@ mod tests {
     use codec::Encode;
     use frame_support::traits::OnFinalize;
     use frame_support::{assert_err, assert_ok};
-    use system::RawOrigin;
+    use frame_system::RawOrigin;
 
     #[test]
     fn election_starts_when_council_term_ends() {
@@ -1022,7 +1031,7 @@ mod tests {
         });
     }
 
-    fn assert_announcing_period(expected_period: <Test as system::Trait>::BlockNumber) {
+    fn assert_announcing_period(expected_period: <Test as frame_system::Trait>::BlockNumber) {
         assert!(
             Election::is_election_running(),
             "Election Stage was not set"
@@ -1388,7 +1397,7 @@ mod tests {
         initial_test_ext().execute_with(|| {
             let _ = Balances::deposit_creating(&20, 1000);
             let payload = vec![10u8];
-            let commitment = <Test as system::Trait>::Hashing::hash(&payload[..]);
+            let commitment = <Test as frame_system::Trait>::Hashing::hash(&payload[..]);
 
             assert!(Election::try_add_vote(20, 100, commitment).is_ok());
 
@@ -1424,7 +1433,7 @@ mod tests {
             );
 
             let payload = vec![10u8];
-            let commitment = <Test as system::Trait>::Hashing::hash(&payload[..]);
+            let commitment = <Test as frame_system::Trait>::Hashing::hash(&payload[..]);
 
             assert!(Election::try_add_vote(20, 100, commitment).is_ok());
 
@@ -1456,7 +1465,7 @@ mod tests {
             );
 
             let payload = vec![10u8];
-            let commitment = <Test as system::Trait>::Hashing::hash(&payload[..]);
+            let commitment = <Test as frame_system::Trait>::Hashing::hash(&payload[..]);
 
             assert!(Election::try_add_vote(20, 1000, commitment).is_err());
             assert_eq!(Election::commitments(), vec![]);
@@ -1479,7 +1488,7 @@ mod tests {
             );
 
             let payload = vec![10u8];
-            let commitment = <Test as system::Trait>::Hashing::hash(&payload[..]);
+            let commitment = <Test as frame_system::Trait>::Hashing::hash(&payload[..]);
 
             assert!(Election::try_add_vote(20, 100, commitment).is_ok());
 
@@ -1500,12 +1509,12 @@ mod tests {
     }
 
     fn make_commitment_for_applicant(
-        applicant: <Test as system::Trait>::AccountId,
+        applicant: <Test as frame_system::Trait>::AccountId,
         salt: &mut Vec<u8>,
-    ) -> <Test as system::Trait>::Hash {
+    ) -> <Test as frame_system::Trait>::Hash {
         let mut payload = applicant.encode();
         payload.append(salt);
-        <Test as system::Trait>::Hashing::hash(&payload[..])
+        <Test as frame_system::Trait>::Hashing::hash(&payload[..])
     }
 
     #[test]

+ 9 - 5
runtime-modules/governance/src/mock.rs

@@ -4,13 +4,13 @@ pub use super::{council, election};
 pub use common::currency::GovernanceCurrency;
 
 use frame_support::{impl_outer_origin, parameter_types};
+pub use frame_system;
 use sp_core::H256;
 use sp_runtime::{
     testing::Header,
     traits::{BlakeTwo256, IdentityLookup},
     BuildStorage, Perbill,
 };
-pub use system;
 
 impl_outer_origin! {
     pub enum Origin for Test {}
@@ -27,7 +27,7 @@ parameter_types! {
     pub const MinimumPeriod: u64 = 5;
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -48,16 +48,18 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type PalletInfo = ();
+    type SystemWeightInfo = ();
 }
 
 impl pallet_timestamp::Trait for Test {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 impl council::Trait for Test {
     type Event = ();
@@ -101,6 +103,8 @@ impl balances::Trait for Test {
     type Event = ();
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl GovernanceCurrency for Test {
@@ -112,7 +116,7 @@ impl GovernanceCurrency for Test {
 // This function basically just builds a genesis storage key/value store according to
 // our desired mockup.
 pub fn initial_test_ext() -> sp_io::TestExternalities {
-    let mut t = system::GenesisConfig::default()
+    let mut t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 
@@ -159,5 +163,5 @@ pub fn initial_test_ext() -> sp_io::TestExternalities {
 
 pub type Election = election::Module<Test>;
 pub type Council = council::Module<Test>;
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 pub type Balances = balances::Module<Test>;

+ 12 - 12
runtime-modules/hiring/Cargo.toml

@@ -1,24 +1,24 @@
 [package]
 name = 'pallet-hiring'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 stake = { package = 'pallet-stake', default-features = false, path = '../stake'}
 
 [dev-dependencies]
 mockall = "0.7.1"
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -27,8 +27,8 @@ std = [
 	'codec/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'sp-arithmetic/std',
 	'sp-runtime/std',
 	'stake/std',
-]
+]

+ 21 - 26
runtime-modules/hiring/src/lib.rs

@@ -13,6 +13,7 @@
 //!
 //! Dependency: Joystream stake module
 
+#![allow(clippy::collapsible_match)]
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
 // Do not delete! Cannot be uncommented by default, because of Parity decl_module! issue.
@@ -48,7 +49,7 @@ mod test;
 pub use hiring::*;
 
 /// Main trait of hiring substrate module
-pub trait Trait: system::Trait + stake::Trait + Sized {
+pub trait Trait: frame_system::Trait + stake::Trait + Sized {
     /// OpeningId type
     type OpeningId: Parameter
         + Member
@@ -179,7 +180,7 @@ impl<T: Trait> Module<T> {
         role_staking_policy: Option<StakingPolicy<BalanceOf<T>, T::BlockNumber>>,
         human_readable_text: Vec<u8>,
     ) -> Result<T::OpeningId, AddOpeningError> {
-        let current_block_height = <system::Module<T>>::block_number();
+        let current_block_height = <frame_system::Module<T>>::block_number();
 
         Self::ensure_can_add_opening(
             current_block_height,
@@ -240,7 +241,7 @@ impl<T: Trait> Module<T> {
         )?;
 
         //
-        let current_block_height = <system::Module<T>>::block_number(); // move later!
+        let current_block_height = <frame_system::Module<T>>::block_number(); // move later!
         let new_active_stage = active_stage.new_stage_on_cancelling(current_block_height)?;
 
         // Ensure unstaking periods are OK.
@@ -316,7 +317,7 @@ impl<T: Trait> Module<T> {
         // == MUTATION SAFE ==
         //
 
-        let current_block_height = <system::Module<T>>::block_number();
+        let current_block_height = <frame_system::Module<T>>::block_number();
 
         // Update state of opening
         let new_opening = opening.clone_with_new_active_opening_stage(
@@ -354,7 +355,7 @@ impl<T: Trait> Module<T> {
         // == MUTATION SAFE ==
         //
 
-        let current_block_height = <system::Module<T>>::block_number();
+        let current_block_height = <frame_system::Module<T>>::block_number();
 
         let new_opening =
             opening.clone_with_new_active_opening_stage(hiring::ActiveOpeningStage::ReviewPeriod {
@@ -494,7 +495,7 @@ impl<T: Trait> Module<T> {
         );
 
         // Grab current block height
-        let current_block_height = <system::Module<T>>::block_number();
+        let current_block_height = <frame_system::Module<T>>::block_number();
         // Get opening with updated counters
         let opening_needed_for_data = <OpeningById<T>>::get(opening_id);
 
@@ -650,7 +651,7 @@ impl<T: Trait> Module<T> {
         );
 
         // Grab current block height
-        let current_block_height = <system::Module<T>>::block_number();
+        let current_block_height = <frame_system::Module<T>>::block_number();
 
         // Compute index for this new application
         let application_index_in_opening =
@@ -794,7 +795,7 @@ impl<T: Trait> Module<T> {
 
         // Drop stake from stake to application map
         <ApplicationIdByStakingId<T>>::remove(stake_id);
-        let current_block_height = <system::Module<T>>::block_number();
+        let current_block_height = <frame_system::Module<T>>::block_number();
 
         // New application computed
         let mut new_application = application.clone();
@@ -944,11 +945,12 @@ pub enum ApplicationWouldGetAddedEvaluation<T: Trait> {
 
 /// Balance alias
 pub type BalanceOf<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as stake::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 /// Balance alias for staking
-pub type NegativeImbalance<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
+pub type NegativeImbalance<T> = <<T as stake::Trait>::Currency as Currency<
+    <T as frame_system::Trait>::AccountId,
+>>::NegativeImbalance;
 
 /*
  *  ======== ======== ======== ======== =======
@@ -966,7 +968,7 @@ type ApplicationBTreeMap<T> = BTreeMap<
     <T as Trait>::ApplicationId,
     hiring::Application<
         <T as Trait>::OpeningId,
-        <T as system::Trait>::BlockNumber,
+        <T as frame_system::Trait>::BlockNumber,
         <T as stake::Trait>::StakeId,
     >,
 >;
@@ -1144,7 +1146,7 @@ impl<T: Trait> Module<T> {
                 let was_unstaked = application_was_unstaked || role_was_unstaked;
 
                 // Grab current block height
-                let current_block_height = <system::Module<T>>::block_number();
+                let current_block_height = <frame_system::Module<T>>::block_number();
 
                 /*
                  * TODO:
@@ -1255,14 +1257,9 @@ impl<T: Trait> Module<T> {
         opt_imbalance: Option<NegativeImbalance<T>>,
         application_id: &T::ApplicationId,
     ) -> Option<T::StakeId> {
-        if let Some(imbalance) = opt_imbalance {
-            Some(Self::infallible_stake_initiation_on_application(
-                imbalance,
-                application_id,
-            ))
-        } else {
-            None
-        }
+        opt_imbalance.map(|imbalance| {
+            Self::infallible_stake_initiation_on_application(imbalance, application_id)
+        })
     }
 
     fn infallible_stake_initiation_on_application(
@@ -1397,11 +1394,9 @@ impl<T: Trait> Module<T> {
     pub(crate) fn create_stake_balance(
         opt_stake_imbalance: &Option<NegativeImbalance<T>>,
     ) -> Option<BalanceOf<T>> {
-        if let Some(ref imbalance) = opt_stake_imbalance {
-            Some(imbalance.peek())
-        } else {
-            None
-        }
+        opt_stake_imbalance
+            .as_ref()
+            .map(|imbalance| imbalance.peek())
     }
 
     /// Performs all necessary check before adding an opening

+ 8 - 5
runtime-modules/hiring/src/mock.rs

@@ -31,7 +31,7 @@ parameter_types! {
 #[derive(Clone, PartialEq, Eq, Debug)]
 pub struct Test;
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -52,10 +52,11 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type SystemWeightInfo = ();
+    type PalletInfo = ();
 }
 
 parameter_types! {
@@ -69,6 +70,8 @@ impl balances::Trait for Test {
     type Event = ();
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl Trait for Test {
@@ -87,7 +90,7 @@ impl stake::Trait for Test {
 }
 
 pub type Balances = balances::Module<Test>;
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 pub type Hiring = Module<Test>;
 
 // Intercepts panic method
@@ -141,7 +144,7 @@ pub(crate) fn test_expectation_and_clear_mock() {
 }
 
 pub fn build_test_externalities() -> sp_io::TestExternalities {
-    let t = system::GenesisConfig::default()
+    let t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 
@@ -195,4 +198,4 @@ impl TestApplicationDeactivatedHandler {
 }
 
 // Test fixtures starting block.
-pub(crate) static FIRST_BLOCK_HEIGHT: <Test as system::Trait>::BlockNumber = 0;
+pub(crate) static FIRST_BLOCK_HEIGHT: <Test as frame_system::Trait>::BlockNumber = 0;

+ 4 - 3
runtime-modules/hiring/src/test/mod.rs

@@ -15,10 +15,11 @@ use std::panic;
 
 pub(crate) type OpeningId = <Test as Trait>::OpeningId;
 pub(crate) type ApplicationId = <Test as Trait>::ApplicationId;
-pub(crate) type BlockNumber = <Test as system::Trait>::BlockNumber;
+pub(crate) type BlockNumber = <Test as frame_system::Trait>::BlockNumber;
 pub(crate) type StakeId = <Test as stake::Trait>::StakeId;
-pub(crate) type Balance =
-    <<Test as stake::Trait>::Currency as Currency<<Test as system::Trait>::AccountId>>::Balance;
+pub(crate) type Balance = <<Test as stake::Trait>::Currency as Currency<
+    <Test as frame_system::Trait>::AccountId,
+>>::Balance;
 
 // Debug test object content. Recurring temporary usage - do not delete.
 #[allow(dead_code)]

+ 13 - 13
runtime-modules/membership/Cargo.toml

@@ -1,24 +1,24 @@
 [package]
 name = 'pallet-membership'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 common = { package = 'pallet-common', default-features = false, path = '../common'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -26,10 +26,10 @@ std = [
 	'serde',
 	'codec/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'sp-std/std',
 	'sp-arithmetic/std',
 	'sp-runtime/std',
 	'pallet-timestamp/std',
 	'common/std',
-]
+]

+ 1 - 1
runtime-modules/membership/src/genesis.rs

@@ -59,7 +59,7 @@ impl<T: Trait> GenesisConfigBuilder<T> {
                 handle: (10000 + ix).to_string(),
                 avatar_uri: "".into(),
                 about: "".into(),
-                registered_at_time: T::Moment::from(0),
+                registered_at_time: T::Moment::from(0u32),
             })
             .collect()
     }

+ 10 - 10
runtime-modules/membership/src/lib.rs

@@ -13,16 +13,16 @@ use codec::{Codec, Decode, Encode};
 use frame_support::dispatch::DispatchResult;
 use frame_support::traits::{Currency, Get, LockableCurrency, WithdrawReason};
 use frame_support::{decl_error, decl_event, decl_module, decl_storage, ensure, Parameter};
+use frame_system::{ensure_root, ensure_signed};
 use sp_arithmetic::traits::{BaseArithmetic, One};
 use sp_runtime::traits::{MaybeSerialize, Member, Zero};
 use sp_std::borrow::ToOwned;
 use sp_std::vec;
 use sp_std::vec::Vec;
-use system::{ensure_root, ensure_signed};
 
 use common::currency::{BalanceOf, GovernanceCurrency};
-pub trait Trait: system::Trait + GovernanceCurrency + pallet_timestamp::Trait {
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+pub trait Trait: frame_system::Trait + GovernanceCurrency + pallet_timestamp::Trait {
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     type MemberId: Parameter
         + Member
@@ -80,11 +80,11 @@ const DEFAULT_MAX_ABOUT_TEXT_LENGTH: u32 = 2048;
 
 /// Public membership object alias.
 pub type Membership<T> = MembershipObject<
-    <T as system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::BlockNumber,
     <T as pallet_timestamp::Trait>::Moment,
     <T as Trait>::PaidTermId,
     <T as Trait>::SubscriptionId,
-    <T as system::Trait>::AccountId,
+    <T as frame_system::Trait>::AccountId,
 >;
 
 #[derive(Encode, Decode, Default)]
@@ -230,7 +230,7 @@ decl_storage! {
                     &member.controller_account,
                     &checked_user_info,
                     EntryMethod::Genesis,
-                    T::BlockNumber::from(1),
+                    T::BlockNumber::from(1u32),
                     member.registered_at_time
                 ).expect("Importing Member Failed");
 
@@ -243,7 +243,7 @@ decl_storage! {
 
 decl_event! {
     pub enum Event<T> where
-      <T as system::Trait>::AccountId,
+      <T as frame_system::Trait>::AccountId,
       <T as Trait>::MemberId,
       <T as Trait>::PaidTermId,
     {
@@ -292,7 +292,7 @@ decl_module! {
                 &who,
                 &user_info,
                 EntryMethod::Paid(paid_terms_id),
-                <system::Module<T>>::block_number(),
+                <frame_system::Module<T>>::block_number(),
                 <pallet_timestamp::Module<T>>::now()
             )?;
 
@@ -453,7 +453,7 @@ decl_module! {
                 );
 
                 ensure!(
-                    system::Module::<T>::account_nonce(&new_member_account).is_zero(),
+                    frame_system::Module::<T>::account_nonce(&new_member_account).is_zero(),
                     Error::<T>::OnlyNewAccountsCanBeUsedForScreenedMembers
                 );
 
@@ -479,7 +479,7 @@ decl_module! {
                 &new_member_account,
                 &user_info,
                 entry_method.clone(),
-                <system::Module<T>>::block_number(),
+                <frame_system::Module<T>>::block_number(),
                 <pallet_timestamp::Module<T>>::now()
             )?;
 

+ 11 - 7
runtime-modules/membership/src/mock.rs

@@ -4,13 +4,13 @@ pub use crate::{GenesisConfig, Trait, DEFAULT_PAID_TERM_ID};
 
 pub use frame_support::traits::Currency;
 use frame_support::{impl_outer_origin, parameter_types};
+pub use frame_system;
 use sp_core::H256;
 use sp_runtime::{
     testing::Header,
     traits::{BlakeTwo256, IdentityLookup},
     Perbill,
 };
-pub use system;
 
 pub use common::currency::GovernanceCurrency;
 
@@ -29,7 +29,7 @@ parameter_types! {
     pub const MinimumPeriod: u64 = 5;
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -50,16 +50,18 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type SystemWeightInfo = ();
+    type PalletInfo = ();
 }
 
 impl pallet_timestamp::Trait for Test {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 
 parameter_types! {
@@ -72,6 +74,8 @@ impl balances::Trait for Test {
     type Event = ();
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl GovernanceCurrency for Test {
@@ -92,7 +96,7 @@ impl Trait for Test {
 }
 
 pub struct TestExternalitiesBuilder<T: Trait> {
-    system_config: Option<system::GenesisConfig>,
+    system_config: Option<frame_system::GenesisConfig>,
     membership_config: Option<GenesisConfig<T>>,
 }
 
@@ -111,10 +115,10 @@ impl<T: Trait> TestExternalitiesBuilder<T> {
         self
     }
     pub fn build(self) -> sp_io::TestExternalities {
-        // Add system
+        // Add frame_system
         let mut t = self
             .system_config
-            .unwrap_or(system::GenesisConfig::default())
+            .unwrap_or(frame_system::GenesisConfig::default())
             .build_storage::<T>()
             .unwrap();
 
@@ -130,4 +134,4 @@ impl<T: Trait> TestExternalitiesBuilder<T> {
 
 pub type Balances = balances::Module<Test>;
 pub type Members = crate::Module<Test>;
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;

+ 8 - 8
runtime-modules/memo/Cargo.toml

@@ -1,15 +1,15 @@
 [package]
 name = 'pallet-memo'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 common = { package = 'pallet-common', default-features = false, path = '../common'}
 
 [features]
@@ -19,6 +19,6 @@ std = [
 	'sp-arithmetic/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'common/std',
-]
+]

+ 4 - 4
runtime-modules/memo/src/lib.rs

@@ -3,14 +3,14 @@
 
 use frame_support::traits::Currency;
 use frame_support::{decl_event, decl_module, decl_storage, ensure};
+use frame_system::ensure_signed;
 use sp_arithmetic::traits::Zero;
 use sp_std::vec::Vec;
-use system::ensure_signed;
 
 use common::currency::GovernanceCurrency;
 
-pub trait Trait: system::Trait + GovernanceCurrency {
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+pub trait Trait: frame_system::Trait + GovernanceCurrency {
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 }
 
 pub type MemoText = Vec<u8>;
@@ -23,7 +23,7 @@ decl_storage! {
 }
 
 decl_event! {
-    pub enum Event<T> where <T as system::Trait>::AccountId {
+    pub enum Event<T> where <T as frame_system::Trait>::AccountId {
         MemoUpdated(AccountId),
     }
 }

+ 16 - 16
runtime-modules/proposals/codex/Cargo.toml

@@ -1,20 +1,20 @@
 [package]
 name = 'pallet-proposals-codex'
-version = '3.0.0'
+version = '3.2.0'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-staking = { package = 'pallet-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+staking = { package = 'pallet-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 membership = { package = 'pallet-membership', default-features = false, path = '../../membership'}
 stake = { package = 'pallet-stake', default-features = false, path = '../../stake'}
 governance = { package = 'pallet-governance', default-features = false, path = '../../governance'}
@@ -26,10 +26,10 @@ proposals-engine = { package = 'pallet-proposals-engine', default-features = fal
 proposals-discussion = { package = 'pallet-proposals-discussion', default-features = false, path = '../discussion'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-staking = { package = 'sp-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-staking-reward-curve = { package = 'pallet-staking-reward-curve', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-staking = { package = 'sp-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-staking-reward-curve = { package = 'pallet-staking-reward-curve', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 recurring-rewards = { package = 'pallet-recurring-reward', default-features = false, path = '../../recurring-reward'}
 strum = {version = "0.19", default-features = false}
 
@@ -42,7 +42,7 @@ std = [
     'frame-support/std',
     'sp-arithmetic/std',
     'sp-runtime/std',
-    'system/std',
+    'frame-system/std',
     'staking/std',
     'pallet-timestamp/std',
     'balances/std',
@@ -55,4 +55,4 @@ std = [
     'common/std',
     'proposals-engine/std',
     'proposals-discussion/std',
-]
+]

+ 9 - 8
runtime-modules/proposals/codex/src/lib.rs

@@ -64,11 +64,11 @@ mod tests;
 use frame_support::dispatch::DispatchResult;
 use frame_support::traits::{Currency, Get};
 use frame_support::{decl_error, decl_module, decl_storage, ensure, print};
+use frame_system::ensure_root;
 use sp_arithmetic::traits::Zero;
 use sp_std::clone::Clone;
 use sp_std::str::from_utf8;
 use sp_std::vec::Vec;
-use system::ensure_root;
 
 use common::origin::ActorOriginValidator;
 use common::working_group::WorkingGroup;
@@ -134,7 +134,7 @@ struct CreateProposalParameters<T: Trait> {
 
 /// 'Proposals codex' substrate module Trait
 pub trait Trait:
-    system::Trait
+    frame_system::Trait
     + proposals_engine::Trait
     + proposals_discussion::Trait
     + membership::Trait
@@ -161,7 +161,7 @@ pub trait Trait:
 
 /// Balance alias for `stake` module
 pub type BalanceOf<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as stake::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 /// Currency alias for `stake` module
 pub type CurrencyOf<T> = <T as stake::Trait>::Currency;
@@ -169,16 +169,17 @@ pub type CurrencyOf<T> = <T as stake::Trait>::Currency;
 /// Balance alias for GovernanceCurrency from `common` module. TODO: replace with BalanceOf
 pub type BalanceOfGovernanceCurrency<T> =
     <<T as common::currency::GovernanceCurrency>::Currency as Currency<
-        <T as system::Trait>::AccountId,
+        <T as frame_system::Trait>::AccountId,
     >>::Balance;
 
 /// Balance alias for token mint balance from `token mint` module. TODO: replace with BalanceOf
 pub type BalanceOfMint<T> =
-    <<T as minting::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as minting::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 /// Negative imbalance alias for staking
-pub type NegativeImbalance<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
+pub type NegativeImbalance<T> = <<T as stake::Trait>::Currency as Currency<
+    <T as frame_system::Trait>::AccountId,
+>>::NegativeImbalance;
 
 type MemberId<T> = <T as membership::Trait>::MemberId;
 
@@ -804,7 +805,7 @@ decl_module! {
 
             print("Runtime upgrade proposal execution started.");
 
-            <system::Module<T>>::set_code(cloned_origin2, wasm)?;
+            <frame_system::Module<T>>::set_code(cloned_origin2, wasm)?;
 
             print("Runtime upgrade proposal execution finished.");
         }

+ 2 - 2
runtime-modules/proposals/codex/src/proposal_types/mod.rs

@@ -20,8 +20,8 @@ pub trait ProposalEncoder<T: crate::Trait> {
 pub type ProposalDetailsOf<T> = ProposalDetails<
     crate::BalanceOfMint<T>,
     crate::BalanceOfGovernanceCurrency<T>,
-    <T as system::Trait>::BlockNumber,
-    <T as system::Trait>::AccountId,
+    <T as frame_system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::AccountId,
     working_group::OpeningId<T>,
     working_group::ApplicationId<T>,
     crate::BalanceOf<T>,

+ 16 - 9
runtime-modules/proposals/codex/src/tests/mock.rs

@@ -1,6 +1,9 @@
 #![cfg(test)]
+// Internal substrate warning.
+#![allow(non_fmt_panic)]
 
 use frame_support::{impl_outer_dispatch, impl_outer_origin, parameter_types};
+pub use frame_system;
 use sp_core::H256;
 use sp_runtime::curve::PiecewiseLinear;
 use sp_runtime::{
@@ -9,7 +12,6 @@ use sp_runtime::{
     Perbill,
 };
 use sp_staking::SessionIndex;
-pub use system;
 
 use crate::{ProposalDetailsOf, ProposalEncoder};
 use proposals_engine::VotersParameters;
@@ -36,7 +38,7 @@ impl_outer_dispatch! {
         codex::ProposalCodex,
         proposals::ProposalsEngine,
         staking::Staking,
-        system::System,
+        frame_system::System,
     }
 }
 
@@ -67,6 +69,8 @@ impl balances::Trait for Test {
     type Event = ();
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl stake::Trait for Test {
@@ -118,7 +122,7 @@ impl governance::council::Trait for Test {
 
 impl common::origin::ActorOriginValidator<Origin, u64, u64> for () {
     fn ensure_actor_origin(origin: Origin, _: u64) -> Result<u64, &'static str> {
-        let account_id = system::ensure_signed(origin)?;
+        let account_id = frame_system::ensure_signed(origin)?;
 
         Ok(account_id)
     }
@@ -219,7 +223,7 @@ impl staking::Trait for Test {
     type SessionsPerEra = SessionsPerEra;
     type BondingDuration = BondingDuration;
     type SlashDeferDuration = ();
-    type SlashCancelOrigin = system::EnsureRoot<Self::AccountId>;
+    type SlashCancelOrigin = frame_system::EnsureRoot<Self::AccountId>;
     type SessionInterface = Self;
     type RewardCurve = RewardCurve;
     type NextNewSession = ();
@@ -229,9 +233,10 @@ impl staking::Trait for Test {
     type MinSolutionScoreBump = ();
     type MaxNominatorRewardedPerValidator = ();
     type UnsignedPriority = ();
+    type WeightInfo = ();
 }
 
-impl<LocalCall> system::offchain::SendTransactionTypes<LocalCall> for Test
+impl<LocalCall> frame_system::offchain::SendTransactionTypes<LocalCall> for Test
 where
     Call: From<LocalCall>,
 {
@@ -268,7 +273,7 @@ impl ProposalEncoder<Test> for () {
     }
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = Call;
@@ -289,20 +294,22 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type PalletInfo = ();
+    type SystemWeightInfo = ();
 }
 
 impl pallet_timestamp::Trait for Test {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 
 pub fn initial_test_ext() -> sp_io::TestExternalities {
-    let t = system::GenesisConfig::default()
+    let t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 
@@ -314,4 +321,4 @@ pub type ProposalCodex = crate::Module<Test>;
 pub type ProposalsEngine = proposals_engine::Module<Test>;
 pub type Balances = balances::Module<Test>;
 pub type Timestamp = pallet_timestamp::Module<Test>;
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;

+ 3 - 1
runtime-modules/proposals/codex/src/tests/mod.rs

@@ -3,7 +3,7 @@ mod mock;
 use frame_support::dispatch::{DispatchError, DispatchResult};
 use frame_support::storage::StorageMap;
 use frame_support::traits::Currency;
-use system::RawOrigin;
+use frame_system::RawOrigin;
 
 use common::working_group::WorkingGroup;
 use governance::election_params::ElectionParameters;
@@ -621,6 +621,8 @@ fn create_set_validator_count_proposal_common_checks_succeed() {
 #[test]
 fn create_set_validator_count_proposal_failed_with_invalid_validator_count() {
     initial_test_ext().execute_with(|| {
+        staking::MinimumValidatorCount::put(10);
+
         assert_eq!(
             ProposalCodex::create_set_validator_count_proposal(
                 RawOrigin::Signed(1).into(),

+ 12 - 12
runtime-modules/proposals/discussion/Cargo.toml

@@ -1,24 +1,24 @@
 [package]
 name = 'pallet-proposals-discussion'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 membership = { package = 'pallet-membership', default-features = false, path = '../../membership'}
 common = { package = 'pallet-common', default-features = false, path = '../../common'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -27,7 +27,7 @@ std = [
 	'codec/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
     'membership/std',
     'common/std',
-]
+]

+ 6 - 6
runtime-modules/proposals/discussion/src/lib.rs

@@ -1,6 +1,6 @@
 //! # Proposals discussion module
 //! Proposals `discussion` module for the Joystream platform. Version 2.
-//! It contains discussion subsystem of the proposals.
+//! It contains discussion system of the proposals.
 //!
 //! ## Overview
 //!
@@ -20,7 +20,7 @@
 //!
 //! ```
 //! use frame_support::decl_module;
-//! use system::ensure_root;
+//! use frame_system::ensure_root;
 //! use pallet_proposals_discussion::{self as discussions};
 //!
 //! pub trait Trait: discussions::Trait + membership::Trait {}
@@ -79,9 +79,9 @@ decl_event!(
 );
 
 /// 'Proposal discussion' substrate module Trait
-pub trait Trait: system::Trait + membership::Trait {
+pub trait Trait: frame_system::Trait + membership::Trait {
     /// Discussion event type.
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     /// Validates post author id and origin combination
     type PostAuthorOriginValidator: ActorOriginValidator<
@@ -329,9 +329,9 @@ impl<T: Trait> Module<T> {
 }
 
 impl<T: Trait> Module<T> {
-    // Wrapper-function over system::block_number()
+    // Wrapper-function over frame_system::block_number()
     fn current_block() -> T::BlockNumber {
-        <system::Module<T>>::block_number()
+        <frame_system::Module<T>>::block_number()
     }
 
     // returns incremented thread counter if last thread author equals with provided parameter

+ 11 - 7
runtime-modules/proposals/discussion/src/tests/mock.rs

@@ -1,6 +1,6 @@
 #![cfg(test)]
 
-pub use system;
+pub use frame_system;
 
 use frame_support::traits::{OnFinalize, OnInitialize};
 use frame_support::{impl_outer_event, impl_outer_origin, parameter_types};
@@ -49,7 +49,7 @@ impl_outer_event! {
         discussion<T>,
         balances<T>,
         membership_mod<T>,
-        system<T>,
+        frame_system<T>,
     }
 }
 
@@ -65,6 +65,8 @@ impl balances::Trait for Test {
     type Event = TestEvent;
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl common::currency::GovernanceCurrency for Test {
@@ -97,7 +99,7 @@ impl crate::Trait for Test {
 
 impl ActorOriginValidator<Origin, u64, u64> for () {
     fn ensure_actor_origin(origin: Origin, actor_id: u64) -> Result<u64, &'static str> {
-        if system::ensure_none(origin).is_ok() {
+        if frame_system::ensure_none(origin).is_ok() {
             return Ok(1);
         }
 
@@ -109,7 +111,7 @@ impl ActorOriginValidator<Origin, u64, u64> for () {
     }
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -130,20 +132,22 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type PalletInfo = ();
+    type SystemWeightInfo = ();
 }
 
 impl pallet_timestamp::Trait for Test {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 
 pub fn initial_test_ext() -> sp_io::TestExternalities {
-    let t = system::GenesisConfig::default()
+    let t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 
@@ -151,7 +155,7 @@ pub fn initial_test_ext() -> sp_io::TestExternalities {
 }
 
 pub type Discussions = crate::Module<Test>;
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 
 // Recommendation from Parity on testing on_finalize
 // https://substrate.dev/docs/en/next/development/module/tests

+ 2 - 2
runtime-modules/proposals/discussion/src/tests/mod.rs

@@ -1,8 +1,8 @@
 mod mock;
 
 use frame_support::dispatch::{DispatchError, DispatchResult};
-use system::RawOrigin;
-use system::{EventRecord, Phase};
+use frame_system::RawOrigin;
+use frame_system::{EventRecord, Phase};
 
 use crate::*;
 use mock::*;

+ 13 - 13
runtime-modules/proposals/engine/Cargo.toml

@@ -1,27 +1,27 @@
 [package]
 name = 'pallet-proposals-engine'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 membership = { package = 'pallet-membership', default-features = false, path = '../../membership'}
 stake = { package = 'pallet-stake', default-features = false, path = '../../stake'}
 common = { package = 'pallet-common', default-features = false, path = '../../common'}
 
 [dev-dependencies]
 mockall = "0.7.1"
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -30,11 +30,11 @@ std = [
 	'codec/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'pallet-timestamp/std',
 	'sp-arithmetic/std',
 	'sp-runtime/std',
     'membership/std',
     'stake/std',
     'common/std',
-]
+]

+ 14 - 14
runtime-modules/proposals/engine/src/lib.rs

@@ -58,7 +58,7 @@
 //!
 //! ```
 //! use frame_support::{decl_module, print};
-//! use system::ensure_signed;
+//! use frame_system::ensure_signed;
 //! use codec::Encode;
 //! use pallet_proposals_engine::{self as engine, ProposalParameters};
 //!
@@ -134,9 +134,9 @@ use frame_support::traits::{Currency, Get};
 use frame_support::{
     decl_error, decl_event, decl_module, decl_storage, ensure, print, Parameter, StorageDoubleMap,
 };
+use frame_system::{ensure_root, RawOrigin};
 use sp_arithmetic::traits::Zero;
 use sp_std::vec::Vec;
-use system::{ensure_root, RawOrigin};
 
 use common::origin::ActorOriginValidator;
 
@@ -144,10 +144,10 @@ type MemberId<T> = <T as membership::Trait>::MemberId;
 
 /// Proposals engine trait.
 pub trait Trait:
-    system::Trait + pallet_timestamp::Trait + stake::Trait + membership::Trait
+    frame_system::Trait + pallet_timestamp::Trait + stake::Trait + membership::Trait
 {
     /// Engine event type.
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     /// Validates proposer id and origin combination
     type ProposerOriginValidator: ActorOriginValidator<
@@ -193,8 +193,8 @@ decl_event!(
     where
         <T as Trait>::ProposalId,
         MemberId = MemberId<T>,
-        <T as system::Trait>::BlockNumber,
-        <T as system::Trait>::AccountId,
+        <T as frame_system::Trait>::BlockNumber,
+        <T as frame_system::Trait>::AccountId,
         <T as stake::Trait>::StakeId,
     {
         /// Emits on proposal creation.
@@ -587,9 +587,9 @@ impl<T: Trait> Module<T> {
 }
 
 impl<T: Trait> Module<T> {
-    // Wrapper-function over system::block_number()
+    // Wrapper-function over frame_system::block_number()
     fn current_block() -> T::BlockNumber {
-        <system::Module<T>>::block_number()
+        <frame_system::Module<T>>::block_number()
     }
 
     // Enumerates through active proposals. Tally Voting results.
@@ -819,28 +819,28 @@ impl<T: Trait> Module<T> {
 // Simplification of the 'FinalizedProposalData' type
 type FinalizedProposal<T> = FinalizedProposalData<
     <T as Trait>::ProposalId,
-    <T as system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::BlockNumber,
     MemberId<T>,
     types::BalanceOf<T>,
     <T as stake::Trait>::StakeId,
-    <T as system::Trait>::AccountId,
+    <T as frame_system::Trait>::AccountId,
 >;
 
 // Simplification of the 'ApprovedProposalData' type
 type ApprovedProposal<T> = ApprovedProposalData<
     <T as Trait>::ProposalId,
-    <T as system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::BlockNumber,
     MemberId<T>,
     types::BalanceOf<T>,
     <T as stake::Trait>::StakeId,
-    <T as system::Trait>::AccountId,
+    <T as frame_system::Trait>::AccountId,
 >;
 
 // Simplification of the 'Proposal' type
 type ProposalOf<T> = Proposal<
-    <T as system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::BlockNumber,
     MemberId<T>,
     types::BalanceOf<T>,
     <T as stake::Trait>::StakeId,
-    <T as system::Trait>::AccountId,
+    <T as frame_system::Trait>::AccountId,
 >;

+ 11 - 7
runtime-modules/proposals/engine/src/tests/mock/mod.rs

@@ -9,13 +9,13 @@
 #![cfg(test)]
 
 use frame_support::{impl_outer_event, impl_outer_origin, parameter_types};
+pub use frame_system;
 use sp_core::H256;
 use sp_runtime::{
     testing::Header,
     traits::{BlakeTwo256, IdentityLookup},
     Perbill,
 };
-pub use system;
 
 mod balance_manager;
 pub(crate) mod proposals;
@@ -46,7 +46,7 @@ impl_outer_event! {
         balances<T>,
         engine<T>,
         membership_mod<T>,
-        system<T>,
+        frame_system<T>,
     }
 }
 
@@ -60,6 +60,8 @@ impl balances::Trait for Test {
     type Event = TestEvent;
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl common::currency::GovernanceCurrency for Test {
@@ -120,7 +122,7 @@ impl Default for proposals::Call<Test> {
 
 impl common::origin::ActorOriginValidator<Origin, u64, u64> for () {
     fn ensure_actor_origin(origin: Origin, _account_id: u64) -> Result<u64, &'static str> {
-        let signed_account_id = system::ensure_signed(origin)?;
+        let signed_account_id = frame_system::ensure_signed(origin)?;
 
         Ok(signed_account_id)
     }
@@ -143,7 +145,7 @@ parameter_types! {
     pub const StakePoolId: [u8; 8] = *b"joystake";
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -164,20 +166,22 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type PalletInfo = ();
+    type SystemWeightInfo = ();
 }
 
 impl pallet_timestamp::Trait for Test {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 
 pub fn initial_test_ext() -> sp_io::TestExternalities {
-    let t = system::GenesisConfig::default()
+    let t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 
@@ -185,5 +189,5 @@ pub fn initial_test_ext() -> sp_io::TestExternalities {
 }
 
 pub type ProposalsEngine = crate::Module<Test>;
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 pub type Balances = balances::Module<Test>;

+ 1 - 1
runtime-modules/proposals/engine/src/tests/mock/proposals.rs

@@ -2,7 +2,7 @@
 
 use frame_support::decl_module;
 use sp_std::vec::Vec;
-pub trait Trait: system::Trait {}
+pub trait Trait: frame_system::Trait {}
 
 decl_module! {
     pub struct Module<T: Trait> for enum Call where origin: T::Origin {

+ 9 - 4
runtime-modules/proposals/engine/src/tests/mod.rs

@@ -7,9 +7,9 @@ use codec::Encode;
 use frame_support::dispatch::DispatchResult;
 use frame_support::traits::{Currency, OnFinalize, OnInitialize};
 use frame_support::{StorageDoubleMap, StorageMap, StorageValue};
+use frame_system::RawOrigin;
+use frame_system::{EventRecord, Phase};
 use sp_std::rc::Rc;
-use system::RawOrigin;
-use system::{EventRecord, Phase};
 
 pub(crate) fn increase_total_balance_issuance_using_account_id(account_id: u64, balance: u64) {
     let initial_balance = Balances::total_issuance();
@@ -240,7 +240,7 @@ impl VoteGenerator {
         }
 
         ProposalsEngine::vote(
-            system::RawOrigin::Signed(self.current_account_id).into(),
+            frame_system::RawOrigin::Signed(self.current_account_id).into(),
             self.current_voter_id,
             self.proposal_id,
             vote_kind,
@@ -305,7 +305,12 @@ fn vote_succeeds() {
 fn vote_fails_with_insufficient_rights() {
     initial_test_ext().execute_with(|| {
         assert_eq!(
-            ProposalsEngine::vote(system::RawOrigin::None.into(), 1, 1, VoteKind::Approve),
+            ProposalsEngine::vote(
+                frame_system::RawOrigin::None.into(),
+                1,
+                1,
+                VoteKind::Approve
+            ),
             Err(DispatchError::Other("Bad origin"))
         );
     });

+ 6 - 5
runtime-modules/proposals/engine/src/types/mod.rs

@@ -125,7 +125,7 @@ pub struct ActiveStake<StakeId, AccountId> {
     pub source_account_id: AccountId,
 }
 
-/// 'Proposal' contains information necessary for the proposal system functioning.
+/// 'Proposal' contains information necessary for the proposal frame_system functioning.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
 pub struct Proposal<BlockNumber, ProposerId, Balance, StakeId, AccountId> {
@@ -308,7 +308,7 @@ pub trait ProposalExecutable {
 }
 
 /// Proposal code binary converter
-pub trait ProposalCodeDecoder<T: system::Trait> {
+pub trait ProposalCodeDecoder<T: frame_system::Trait> {
     /// Converts proposal code binary to executable representation
     fn decode_proposal(
         proposal_type: u32,
@@ -318,11 +318,12 @@ pub trait ProposalCodeDecoder<T: system::Trait> {
 
 /// Balance alias
 pub type BalanceOf<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as stake::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 /// Balance alias for staking
-pub type NegativeImbalance<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
+pub type NegativeImbalance<T> = <<T as stake::Trait>::Currency as Currency<
+    <T as frame_system::Trait>::AccountId,
+>>::NegativeImbalance;
 
 /// Balance type of runtime
 pub type CurrencyOf<T> = <T as stake::Trait>::Currency;

+ 10 - 10
runtime-modules/recurring-reward/Cargo.toml

@@ -1,21 +1,21 @@
 [package]
 name = 'pallet-recurring-reward'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 minting = { package = 'pallet-token-mint', default-features = false, path = '../token-minting'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -24,6 +24,6 @@ std = [
 	'sp-arithmetic/std',
 	'sp-runtime/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'minting/std',
 ]

+ 4 - 4
runtime-modules/recurring-reward/src/lib.rs

@@ -4,7 +4,7 @@
 
 // Clippy linter warning. TODO: refactor the Option<Option<>>
 #![allow(clippy::option_option)] // disable it because of possible API break
-
+#![allow(clippy::result_unit_err)]
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
 
@@ -19,7 +19,7 @@ use minting::BalanceOf;
 mod mock;
 mod tests;
 
-pub trait Trait: system::Trait + minting::Trait {
+pub trait Trait: frame_system::Trait + minting::Trait {
     type PayoutStatusHandler: PayoutStatusHandler<Self>;
 
     /// Type of identifier for recipients.
@@ -199,7 +199,7 @@ impl<T: Trait> Module<T> {
             RewardsError::RecipientNotFound
         );
         ensure!(
-            next_payment_at_block > <system::Module<T>>::block_number(),
+            next_payment_at_block > <frame_system::Module<T>>::block_number(),
             RewardsError::NextPaymentNotInFuture
         );
 
@@ -300,7 +300,7 @@ impl<T: Trait> Module<T> {
         if let Some(next_payout_at_block) = new_next_payment_at {
             if let Some(blocknumber) = next_payout_at_block {
                 ensure!(
-                    blocknumber > <system::Module<T>>::block_number(),
+                    blocknumber > <frame_system::Module<T>>::block_number(),
                     RewardsError::NextPaymentNotInFuture
                 );
             }

+ 7 - 4
runtime-modules/recurring-reward/src/mock/mod.rs

@@ -30,7 +30,7 @@ parameter_types! {
     pub const MinimumPeriod: u64 = 5;
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -51,10 +51,11 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type SystemWeightInfo = ();
+    type PalletInfo = ();
 }
 
 parameter_types! {
@@ -67,6 +68,8 @@ impl balances::Trait for Test {
     type Event = ();
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl Trait for Test {
@@ -83,14 +86,14 @@ impl minting::Trait for Test {
 pub fn build_test_externalities() -> sp_io::TestExternalities {
     MockStatusHandler::reset();
 
-    let t = system::GenesisConfig::default()
+    let t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 
     t.into()
 }
 
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 pub type Balances = balances::Module<Test>;
 pub type Rewards = Module<Test>;
 pub type Minting = minting::Module<Test>;

+ 13 - 13
runtime-modules/stake/Cargo.toml

@@ -1,22 +1,22 @@
 [package]
 name = 'pallet-stake'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -24,7 +24,7 @@ std = [
 	'codec/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'sp-arithmetic/std',
 	'sp-runtime/std',
-]
+]

+ 10 - 6
runtime-modules/stake/src/lib.rs

@@ -18,12 +18,12 @@ mod mock;
 mod tests;
 
 pub type BalanceOf<T> =
-    <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 pub type NegativeImbalance<T> =
-    <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
+    <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::NegativeImbalance;
 
-pub trait Trait: system::Trait + Sized {
+pub trait Trait: frame_system::Trait + Sized {
     /// The currency that is managed by the module
     type Currency: Currency<Self::AccountId>;
 
@@ -744,7 +744,10 @@ impl<T: Trait> Module<T> {
         let stake_id = Self::stakes_created();
         <StakesCreated<T>>::put(stake_id + One::one());
 
-        <Stakes<T>>::insert(&stake_id, Stake::new(<system::Module<T>>::block_number()));
+        <Stakes<T>>::insert(
+            &stake_id,
+            Stake::new(<frame_system::Module<T>>::block_number()),
+        );
 
         stake_id
     }
@@ -1036,7 +1039,7 @@ impl<T: Trait> Module<T> {
         let slash_id = stake.initiate_slashing(
             slash_amount,
             slash_period,
-            <system::Module<T>>::block_number(),
+            <frame_system::Module<T>>::block_number(),
         )?;
 
         <Stakes<T>>::insert(stake_id, stake);
@@ -1092,7 +1095,8 @@ impl<T: Trait> Module<T> {
         let mut stake = ensure_stake_exists!(T, stake_id, StakeActionError::StakeNotFound)?;
 
         if let Some(unstaking_period) = unstaking_period {
-            stake.initiate_unstaking(unstaking_period, <system::Module<T>>::block_number())?;
+            stake
+                .initiate_unstaking(unstaking_period, <frame_system::Module<T>>::block_number())?;
             <Stakes<T>>::insert(stake_id, stake);
         } else {
             let staked_amount = stake.unstake()?;

+ 8 - 5
runtime-modules/stake/src/mock.rs

@@ -25,7 +25,7 @@ parameter_types! {
     pub const AvailableBlockRatio: Perbill = Perbill::one();
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -46,10 +46,11 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type SystemWeightInfo = ();
+    type PalletInfo = ();
 }
 
 parameter_types! {
@@ -63,6 +64,8 @@ impl balances::Trait for Test {
     type Event = ();
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl Trait for Test {
@@ -74,14 +77,14 @@ impl Trait for Test {
 }
 
 pub fn build_test_externalities() -> sp_io::TestExternalities {
-    let t = system::GenesisConfig::default()
+    let t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 
     t.into()
 }
 
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 pub type Balances = balances::Module<Test>;
 pub type StakePool = Module<Test>;
 
@@ -90,6 +93,6 @@ pub mod fixtures {
     use super::*;
     pub type OngoingSlashes = BTreeMap<
         <Test as Trait>::SlashId,
-        Slash<<Test as system::Trait>::BlockNumber, BalanceOf<Test>>,
+        Slash<<Test as frame_system::Trait>::BlockNumber, BalanceOf<Test>>,
     >;
 }

+ 12 - 12
runtime-modules/storage/Cargo.toml

@@ -1,26 +1,26 @@
 [package]
 name = 'pallet-storage'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 membership = { package = 'pallet-membership', default-features = false, path = '../membership'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 working-group = { package = 'pallet-working-group', default-features = false, path = '../working-group'}
 common = { package = 'pallet-common', default-features = false, path = '../common'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 stake = { package = 'pallet-stake', default-features = false, path = '../stake'}
 hiring = { package = 'pallet-hiring', default-features = false, path = '../hiring'}
 minting = { package = 'pallet-token-mint', default-features = false, path = '../token-minting'}
@@ -33,7 +33,7 @@ std = [
 	'codec/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'sp-arithmetic/std',
 	'sp-runtime/std',
 	'membership/std',

+ 9 - 9
runtime-modules/storage/src/data_directory.rs

@@ -1,6 +1,6 @@
 //! # Data directory module
 //! Data directory module for the Joystream platform manages IPFS content id, storage providers,
-//! owners of the content. It allows to add and accept or reject the content in the system.
+//! owners of the content. It allows to add and accept or reject the content in the frame_system.
 //!
 //! ## Comments
 //!
@@ -9,7 +9,7 @@
 //! ## Supported extrinsics
 //!
 //! ### Public extrinsic
-//! - [add_content](./struct.Module.html#method.add_content) - Adds the content to the system.
+//! - [add_content](./struct.Module.html#method.add_content) - Adds the content to the frame_system.
 //!
 //! ### Private extrinsics
 //! - accept_content - Storage provider accepts a content.
@@ -24,9 +24,9 @@
 use codec::{Decode, Encode};
 use frame_support::dispatch::DispatchResult;
 use frame_support::{decl_error, decl_event, decl_module, decl_storage, ensure};
+use frame_system::ensure_root;
 use sp_std::collections::btree_map::BTreeMap;
 use sp_std::vec::Vec;
-use system::ensure_root;
 
 #[cfg(feature = "std")]
 use serde::{Deserialize, Serialize};
@@ -43,7 +43,7 @@ use crate::*;
 pub const DEFAULT_VOUCHER_SIZE_LIMIT_UPPER_BOUND: u64 = 54_000_000_000;
 /// The default maximum number of objects that lead can set on the voucher of an owner
 pub const DEFAULT_VOUCHER_OBJECTS_LIMIT_UPPER_BOUND: u64 = 10_000;
-/// The default system global storage limits
+/// The default frame_system global storage limits
 pub const DEFAULT_GLOBAL_VOUCHER: Voucher = Voucher::new(1_100_000_000_000, 1_000_000);
 /// The default initial owner voucher
 pub const DEFAULT_VOUCHER: Voucher = Voucher::new(5_400_000_000, 1_000);
@@ -53,7 +53,7 @@ pub const DEFAULT_UPLOADING_BLOCKED_STATUS: bool = false;
 /// The _Data directory_ main _Trait_.
 pub trait Trait:
     pallet_timestamp::Trait
-    + system::Trait
+    + frame_system::Trait
     + data_object_type_registry::Trait
     + membership::Trait
     + working_group::Trait<StorageWorkingGroupInstance>
@@ -61,7 +61,7 @@ pub trait Trait:
     + common::StorageOwnership
 {
     /// _Data directory_ event type.
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     /// Active data object type validator.
     type IsActiveDataObjectType: data_object_type_registry::IsActiveDataObjectType<Self>;
@@ -136,7 +136,7 @@ pub type DataObject<T> = DataObjectInternal<
     MemberId<T>,
     ChannelId<T>,
     DAOId<T>,
-    <T as system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::BlockNumber,
     <T as pallet_timestamp::Trait>::Moment,
     DataObjectTypeId<T>,
     StorageProviderId<T>,
@@ -412,7 +412,7 @@ decl_module! {
         /// Predefined errors.
         type Error = Error<T>;
 
-        /// Adds the content to the system. The created DataObject
+        /// Adds the content to the frame_system. The created DataObject
         /// awaits liaison to accept it.
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn add_content(
@@ -446,7 +446,7 @@ decl_module! {
             Self::deposit_event(RawEvent::ContentAdded(content, owner));
         }
 
-        /// Remove the content from the system.
+        /// Remove the content from the frame_system.
         #[weight = 10_000_000] // TODO: adjust weight
         pub fn remove_content(
             origin,

+ 2 - 2
runtime-modules/storage/src/data_object_storage_registry.rs

@@ -37,12 +37,12 @@ const DEFAULT_FIRST_RELATIONSHIP_ID: u8 = 1;
 /// The _Data object storage registry_ main _Trait_.
 pub trait Trait:
     pallet_timestamp::Trait
-    + system::Trait
+    + frame_system::Trait
     + data_directory::Trait
     + working_group::Trait<StorageWorkingGroupInstance>
 {
     /// _Data object storage registry_ event type.
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 
     /// Type for data object storage relationship id
     type DataObjectStorageRelationshipId: Parameter

+ 2 - 2
runtime-modules/storage/src/data_object_type_registry.rs

@@ -35,13 +35,13 @@ const DEFAULT_FIRST_DATA_OBJECT_TYPE_ID: u8 = 1;
 
 /// The _Data object type registry_ main _Trait_.
 pub trait Trait:
-    system::Trait
+    frame_system::Trait
     + working_group::Trait<StorageWorkingGroupInstance>
     + common::MembershipTypes
     + common::StorageOwnership
 {
     /// _Data object type registry_ event type.
-    type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+    type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
 }
 
 decl_error! {

+ 1 - 1
runtime-modules/storage/src/tests/data_directory.rs

@@ -4,7 +4,7 @@ use crate::data_directory::Error;
 use common::storage::StorageObjectOwner;
 use frame_support::assert_ok;
 use frame_support::dispatch::DispatchError;
-use system::RawOrigin;
+use frame_system::RawOrigin;
 
 use super::mock::*;
 

+ 1 - 1
runtime-modules/storage/src/tests/data_object_type_registry.rs

@@ -1,6 +1,6 @@
 #![cfg(test)]
 
-use system::{EventRecord, Phase, RawOrigin};
+use frame_system::{EventRecord, Phase, RawOrigin};
 
 use super::mock::*;
 

+ 10 - 24
runtime-modules/storage/src/tests/mock.rs

@@ -47,7 +47,7 @@ impl_outer_event! {
         balances<T>,
         members<T>,
         working_group_mod StorageWorkingGroupInstance <T>,
-        system<T>,
+        frame_system<T>,
     }
 }
 
@@ -79,9 +79,7 @@ impl SetLeadFixture {
 }
 
 pub const TEST_FIRST_DATA_OBJECT_TYPE_ID: u64 = 1000;
-pub const TEST_FIRST_CONTENT_ID: u64 = 2000;
 pub const TEST_FIRST_RELATIONSHIP_ID: u64 = 3000;
-pub const TEST_FIRST_METADATA_ID: u64 = 4000;
 
 pub const TEST_MOCK_LIAISON_STORAGE_PROVIDER_ID: u32 = 1;
 pub const TEST_MOCK_EXISTING_CID: u64 = 42;
@@ -131,7 +129,7 @@ parameter_types! {
     pub const MinimumPeriod: u64 = 5;
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -152,16 +150,18 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type SystemWeightInfo = ();
+    type PalletInfo = ();
 }
 
 impl pallet_timestamp::Trait for Test {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 
 impl common::MembershipTypes for Test {
@@ -187,6 +187,8 @@ impl balances::Trait for Test {
     type Event = MetaEvent;
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl GovernanceCurrency for Test {
@@ -214,7 +216,7 @@ impl data_directory::Trait for Test {
 
 impl common::origin::ActorOriginValidator<Origin, u64, u64> for () {
     fn ensure_actor_origin(origin: Origin, _account_id: u64) -> Result<u64, &'static str> {
-        let signed_account_id = system::ensure_signed(origin)?;
+        let signed_account_id = frame_system::ensure_signed(origin)?;
 
         Ok(signed_account_id)
     }
@@ -271,9 +273,7 @@ pub struct ExtBuilder {
     global_voucher: Voucher,
     default_voucher: Voucher,
     first_data_object_type_id: u64,
-    first_content_id: u64,
     first_relationship_id: u64,
-    first_metadata_id: u64,
     uploading_blocked: bool,
 }
 
@@ -285,9 +285,7 @@ impl Default for ExtBuilder {
             global_voucher: DEFAULT_GLOBAL_VOUCHER,
             default_voucher: DEFAULT_VOUCHER,
             first_data_object_type_id: 1,
-            first_content_id: 2,
             first_relationship_id: 3,
-            first_metadata_id: 4,
             uploading_blocked: DEFAULT_UPLOADING_BLOCKED_STATUS,
         }
     }
@@ -299,21 +297,11 @@ impl ExtBuilder {
         self
     }
 
-    pub fn first_content_id(mut self, first_content_id: u64) -> Self {
-        self.first_content_id = first_content_id;
-        self
-    }
-
     pub fn first_relationship_id(mut self, first_relationship_id: u64) -> Self {
         self.first_relationship_id = first_relationship_id;
         self
     }
 
-    pub fn first_metadata_id(mut self, first_metadata_id: u64) -> Self {
-        self.first_metadata_id = first_metadata_id;
-        self
-    }
-
     pub fn uploading_blocked_status(mut self, uploading_blocked: bool) -> Self {
         self.uploading_blocked = uploading_blocked;
         self
@@ -325,7 +313,7 @@ impl ExtBuilder {
     }
 
     pub fn build(self) -> sp_io::TestExternalities {
-        let mut t = system::GenesisConfig::default()
+        let mut t = frame_system::GenesisConfig::default()
             .build_storage::<Test>()
             .unwrap();
 
@@ -375,7 +363,7 @@ impl ExtBuilder {
 pub type TestDataObjectType = data_object_type_registry::DataObjectType;
 
 pub type Balances = balances::Module<Test>;
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 pub type TestDataObjectTypeRegistry = data_object_type_registry::Module<Test>;
 pub type TestDataDirectory = data_directory::Module<Test>;
 pub type TestDataObjectStorageRegistry = data_object_storage_registry::Module<Test>;
@@ -383,9 +371,7 @@ pub type TestDataObjectStorageRegistry = data_object_storage_registry::Module<Te
 pub fn with_default_mock_builder<R, F: FnOnce() -> R>(f: F) -> R {
     ExtBuilder::default()
         .first_data_object_type_id(TEST_FIRST_DATA_OBJECT_TYPE_ID)
-        .first_content_id(TEST_FIRST_CONTENT_ID)
         .first_relationship_id(TEST_FIRST_RELATIONSHIP_ID)
-        .first_metadata_id(TEST_FIRST_METADATA_ID)
         .build()
         .execute_with(|| f())
 }

+ 10 - 10
runtime-modules/token-minting/Cargo.toml

@@ -1,20 +1,20 @@
 [package]
 name = 'pallet-token-mint'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -23,5 +23,5 @@ std = [
 	'sp-arithmetic/std',
 	'sp-runtime/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 ]

+ 4 - 4
runtime-modules/token-minting/src/lib.rs

@@ -2,7 +2,7 @@
 #![allow(clippy::type_complexity)]
 // disable it because of possible frontend API break
 // TODO: remove post-Constaninople
-
+#![allow(clippy::collapsible_match)]
 // Ensure we're `no_std` when compiling for Wasm.
 #![cfg_attr(not(feature = "std"), no_std)]
 
@@ -19,7 +19,7 @@ mod tests;
 
 pub use mint::*;
 
-pub trait Trait: system::Trait {
+pub trait Trait: frame_system::Trait {
     /// The currency to mint.
     type Currency: Currency<Self::AccountId>;
 
@@ -35,7 +35,7 @@ pub trait Trait: system::Trait {
 }
 
 pub type BalanceOf<T> =
-    <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 #[derive(PartialEq, Eq, Debug)]
 pub enum GeneralError {
@@ -136,7 +136,7 @@ impl<T: Trait> Module<T> {
         initial_capacity: BalanceOf<T>,
         adjustment: Option<Adjustment<BalanceOf<T>, T::BlockNumber>>,
     ) -> Result<T::MintId, GeneralError> {
-        let now = <system::Module<T>>::block_number();
+        let now = <frame_system::Module<T>>::block_number();
 
         // Ensure the next adjustment if set, is in the future
         if let Some(adjustment) = adjustment {

+ 7 - 4
runtime-modules/token-minting/src/mock.rs

@@ -24,7 +24,7 @@ parameter_types! {
     pub const AvailableBlockRatio: Perbill = Perbill::one();
 }
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -45,10 +45,11 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type SystemWeightInfo = ();
+    type PalletInfo = ();
 }
 
 parameter_types! {
@@ -65,6 +66,8 @@ impl balances::Trait for Test {
     type Event = ();
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl Trait for Test {
@@ -73,13 +76,13 @@ impl Trait for Test {
 }
 
 pub fn build_test_externalities() -> sp_io::TestExternalities {
-    let t = system::GenesisConfig::default()
+    let t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 
     t.into()
 }
 
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 pub type Balances = balances::Module<Test>;
 pub type Minting = Module<Test>;

+ 13 - 13
runtime-modules/working-group/Cargo.toml

@@ -1,17 +1,17 @@
 [package]
 name = 'pallet-working-group'
-version = '3.0.0'
+version = '3.1.1'
 authors = ['Joystream contributors']
 edition = '2018'
 
 [dependencies]
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
-codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+codec = { package = 'parity-scale-codec', version = '1.3.4', default-features = false, features = ['derive'] }
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 membership = { package = 'pallet-membership', default-features = false, path = '../membership'}
 stake = { package = 'pallet-stake', default-features = false, path = '../stake'}
 hiring = { package = 'pallet-hiring', default-features = false, path = '../hiring'}
@@ -20,10 +20,10 @@ recurringrewards = { package = 'pallet-recurring-reward', default-features = fal
 common = { package = 'pallet-common', default-features = false, path = '../common'}
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 [features]
 default = ['std']
@@ -32,7 +32,7 @@ std = [
 	'codec/std',
 	'sp-std/std',
 	'frame-support/std',
-	'system/std',
+	'frame-system/std',
 	'sp-arithmetic/std',
 	'sp-runtime/std',
 	'membership/std',
@@ -41,4 +41,4 @@ std = [
 	'minting/std',
 	'recurringrewards/std',
 	'common/std',
-]
+]

+ 26 - 23
runtime-modules/working-group/src/lib.rs

@@ -56,11 +56,11 @@ use frame_support::dispatch::{DispatchError, DispatchResult};
 use frame_support::storage::IterableStorageMap;
 use frame_support::traits::{Currency, ExistenceRequirement, Get, Imbalance, WithdrawReasons};
 use frame_support::{decl_event, decl_module, decl_storage, ensure, print, StorageValue};
+use frame_system::{ensure_root, ensure_signed};
 use sp_arithmetic::traits::{Bounded, One, Zero};
 use sp_std::collections::{btree_map::BTreeMap, btree_set::BTreeSet};
 use sp_std::vec;
 use sp_std::vec::Vec;
-use system::{ensure_root, ensure_signed};
 
 use crate::types::ExitInitiationOrigin;
 use common::constraints::InputValidationLengthConstraint;
@@ -89,18 +89,19 @@ pub type ApplicationId<T> = <T as hiring::Trait>::ApplicationId;
 
 /// Balance type of runtime
 pub type BalanceOf<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as stake::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 /// Balance type of runtime reward
 pub type BalanceOfMint<T> =
-    <<T as minting::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as minting::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 /// Balance type of runtime
 pub type CurrencyOf<T> = <T as stake::Trait>::Currency;
 
 /// Negative imbalance of runtime.
-pub type NegativeImbalance<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
+pub type NegativeImbalance<T> = <<T as stake::Trait>::Currency as Currency<
+    <T as frame_system::Trait>::AccountId,
+>>::NegativeImbalance;
 
 /// Alias for the worker application id to the worker id dictionary
 pub type ApplicationIdToWorkerIdMap<T> = BTreeMap<ApplicationId<T>, WorkerId<T>>;
@@ -114,7 +115,7 @@ pub type HiringApplicationId<T> = <T as hiring::Trait>::ApplicationId;
 // Type simplification
 type OpeningInfo<T> = (
     OpeningOf<T>,
-    hiring::Opening<BalanceOf<T>, <T as system::Trait>::BlockNumber, HiringApplicationId<T>>,
+    hiring::Opening<BalanceOf<T>, <T as frame_system::Trait>::BlockNumber, HiringApplicationId<T>>,
 );
 
 // Type simplification
@@ -123,33 +124,37 @@ type ApplicationInfo<T> = (ApplicationOf<T>, ApplicationId<T>, OpeningOf<T>);
 // Type simplification
 type RewardSettings<T> = (
     <T as minting::Trait>::MintId,
-    RewardPolicy<BalanceOfMint<T>, <T as system::Trait>::BlockNumber>,
+    RewardPolicy<BalanceOfMint<T>, <T as frame_system::Trait>::BlockNumber>,
 );
 
 // Type simplification
 type WorkerOf<T> = Worker<
-    <T as system::Trait>::AccountId,
+    <T as frame_system::Trait>::AccountId,
     <T as recurringrewards::Trait>::RewardRelationshipId,
     <T as stake::Trait>::StakeId,
-    <T as system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::BlockNumber,
     MemberId<T>,
 >;
 
 // Type simplification
 type OpeningOf<T> = Opening<
     <T as hiring::Trait>::OpeningId,
-    <T as system::Trait>::BlockNumber,
+    <T as frame_system::Trait>::BlockNumber,
     BalanceOf<T>,
     ApplicationId<T>,
 >;
 
 // Type simplification
-type ApplicationOf<T> =
-    Application<<T as system::Trait>::AccountId, OpeningId<T>, MemberId<T>, HiringApplicationId<T>>;
+type ApplicationOf<T> = Application<
+    <T as frame_system::Trait>::AccountId,
+    OpeningId<T>,
+    MemberId<T>,
+    HiringApplicationId<T>,
+>;
 
 /// The _Working group_ main _Trait_
 pub trait Trait<I: Instance>:
-    system::Trait
+    frame_system::Trait
     + membership::Trait
     + hiring::Trait
     + minting::Trait
@@ -157,7 +162,7 @@ pub trait Trait<I: Instance>:
     + recurringrewards::Trait
 {
     /// _Working group_ event type.
-    type Event: From<Event<Self, I>> + Into<<Self as system::Trait>::Event>;
+    type Event: From<Event<Self, I>> + Into<<Self as frame_system::Trait>::Event>;
 
     /// Defines max workers number in the working group.
     type MaxWorkerNumberLimit: Get<u32>;
@@ -168,7 +173,7 @@ decl_event!(
     pub enum Event<T, I>
     where
         WorkerId = WorkerId<T>,
-        <T as system::Trait>::AccountId,
+        <T as frame_system::Trait>::AccountId,
         OpeningId = OpeningId<T>,
         ApplicationId = ApplicationId<T>,
         ApplicationIdToWorkerIdMap = ApplicationIdToWorkerIdMap<T>,
@@ -647,7 +652,7 @@ decl_module! {
             // Ensure origin which will server as the source account for staked funds is signed
             let source_account = ensure_signed(origin)?;
 
-            // In absence of a more general key delegation system which allows an account with some funds to
+            // In absence of a more general key delegation frame_system which allows an account with some funds to
             // grant another account permission to stake from its funds, the origin of this call must have the funds
             // and cannot specify another arbitrary account as the source account.
             // Ensure the source_account is either the controller or root account of member with given id
@@ -855,7 +860,7 @@ decl_module! {
                 let mint_id = Self::mint();
 
                 // Make sure valid parameters are selected for next payment at block number
-                ensure!(policy.next_payment_at_block > <system::Module<T>>::block_number(),
+                ensure!(policy.next_payment_at_block > <frame_system::Module<T>>::block_number(),
                     Error::<T, I>::FillOpeningInvalidNextPaymentBlock);
 
                 // The verified reward settings to use
@@ -1626,17 +1631,15 @@ impl<T: Trait<I>, I: Instance> Module<T, I> {
                     hiring::ApplicationById::<T>::get(successful_application.hiring_application_id);
 
                 // Staking profile for worker
-                let stake_profile = if let Some(ref stake_id) = application.active_role_staking_id {
-                    Some(RoleStakeProfile::new(
+                let stake_profile = application.active_role_staking_id.as_ref().map(|stake_id| {
+                    RoleStakeProfile::new(
                         stake_id,
                         &opening
                             .policy_commitment
                             .terminate_role_stake_unstaking_period,
                         &opening.policy_commitment.exit_role_stake_unstaking_period,
-                    ))
-                } else {
-                    None
-                };
+                    )
+                });
 
                 // Get worker id
                 let new_worker_id = <NextWorkerId<T, I>>::get();

+ 1 - 1
runtime-modules/working-group/src/tests/fixtures.rs

@@ -1,7 +1,7 @@
 use frame_support::dispatch::{DispatchError, DispatchResult};
 use frame_support::storage::{StorageMap, StorageValue};
+use frame_system::{EventRecord, Phase, RawOrigin};
 use std::collections::BTreeSet;
-use system::{EventRecord, Phase, RawOrigin};
 
 use super::mock::{
     Balances, Membership, System, Test, TestEvent, TestWorkingGroup, TestWorkingGroupInstance,

+ 1 - 1
runtime-modules/working-group/src/tests/hiring_workflow.rs

@@ -1,5 +1,5 @@
 use frame_support::dispatch::{DispatchError, DispatchResult};
-use system::RawOrigin;
+use frame_system::RawOrigin;
 
 use crate::tests::fixtures::{
     create_mint, increase_total_balance_issuance_using_account_id, set_mint_id, setup_members,

+ 10 - 6
runtime-modules/working-group/src/tests/mock.rs

@@ -1,6 +1,7 @@
 use frame_support::storage::StorageMap;
 use frame_support::traits::{OnFinalize, OnInitialize};
 use frame_support::{impl_outer_event, impl_outer_origin, parameter_types};
+use frame_system;
 use sp_core::H256;
 use sp_runtime::{
     testing::Header,
@@ -8,7 +9,6 @@ use sp_runtime::{
     Perbill,
 };
 use std::marker::PhantomData;
-use system;
 
 use crate::{BalanceOf, Module, NegativeImbalance, Trait};
 use common::constraints::InputValidationLengthConstraint;
@@ -31,7 +31,7 @@ impl_outer_event! {
         balances<T>,
         working_group TestWorkingGroupInstance <T>,
         membership_mod<T>,
-        system<T>,
+        frame_system<T>,
     }
 }
 
@@ -49,7 +49,7 @@ parameter_types! {
 #[derive(Clone, PartialEq, Eq, Debug)]
 pub struct Test;
 
-impl system::Trait for Test {
+impl frame_system::Trait for Test {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = ();
@@ -70,10 +70,11 @@ impl system::Trait for Test {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = ();
-    type ModuleToIndex = ();
     type AccountData = balances::AccountData<u64>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type PalletInfo = ();
+    type SystemWeightInfo = ();
 }
 
 impl hiring::Trait for Test {
@@ -117,6 +118,7 @@ impl pallet_timestamp::Trait for Test {
     type Moment = u64;
     type OnTimestampSet = ();
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = ();
 }
 
 impl balances::Trait for Test {
@@ -125,6 +127,8 @@ impl balances::Trait for Test {
     type Event = TestEvent;
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = ();
+    type MaxLocks = ();
 }
 
 impl recurringrewards::Trait for Test {
@@ -134,7 +138,7 @@ impl recurringrewards::Trait for Test {
 }
 
 pub type Balances = balances::Module<Test>;
-pub type System = system::Module<Test>;
+pub type System = frame_system::Module<Test>;
 
 parameter_types! {
     pub const MaxWorkerNumberLimit: u32 = 3;
@@ -155,7 +159,7 @@ pub(crate) const WORKING_GROUP_CONSTRAINT_MIN: u16 = 1;
 pub(crate) const WORKING_GROUP_CONSTRAINT_DIFF: u16 = 40;
 
 pub fn build_test_externalities() -> sp_io::TestExternalities {
-    let mut t = system::GenesisConfig::default()
+    let mut t = frame_system::GenesisConfig::default()
         .build_storage::<Test>()
         .unwrap();
 

+ 4 - 4
runtime-modules/working-group/src/tests/mod.rs

@@ -4,13 +4,13 @@ mod mock;
 
 use frame_support::dispatch::DispatchError;
 use frame_support::storage::{StorageMap, StorageValue};
+use frame_system::RawOrigin;
 use std::collections::BTreeMap;
-use system::RawOrigin;
 
 use crate::default_storage_size_constraint;
 use crate::tests::hiring_workflow::HiringWorkflow;
 use crate::types::{OpeningPolicyCommitment, OpeningType, RewardPolicy};
-use crate::{Error, RawEvent, Worker};
+use crate::{Error, RawEvent, Worker, WorkerId};
 use common::constraints::InputValidationLengthConstraint;
 use fixtures::*;
 use mock::{
@@ -2264,7 +2264,7 @@ fn slash_worker_stake_fails_with_not_set_lead() {
 fn get_regular_worker_ids_succeeds() {
     build_test_externalities().execute_with(|| {
         let worker_ids = TestWorkingGroup::get_regular_worker_ids();
-        assert_eq!(worker_ids, Vec::new());
+        assert_eq!(worker_ids, Vec::<WorkerId<Test>>::new());
 
         let leader_worker_id = HireLeadFixture::default().hire_lead();
 
@@ -2290,7 +2290,7 @@ fn get_regular_worker_ids_succeeds() {
 fn get_all_worker_ids_succeeds() {
     build_test_externalities().execute_with(|| {
         let worker_ids = TestWorkingGroup::get_all_worker_ids();
-        assert_eq!(worker_ids, Vec::new());
+        assert_eq!(worker_ids, Vec::<WorkerId<Test>>::new());
 
         let leader_worker_id = HireLeadFixture::default().hire_lead();
 

+ 47 - 47
runtime/Cargo.toml

@@ -4,7 +4,7 @@ edition = '2018'
 name = 'joystream-node-runtime'
 # Follow convention: https://github.com/Joystream/substrate-runtime-joystream/issues/1
 # {Authoring}.{Spec}.{Impl} of the RuntimeVersion
-version = '7.16.0'
+version = '9.4.0'
 
 [dependencies]
 # Third-party dependencies
@@ -12,52 +12,52 @@ serde = { version = "1.0.101", optional = true, features = ["derive"] }
 codec = { package = 'parity-scale-codec', version = '1.3.1', default-features = false, features = ['derive'] }
 
 # Substrate primitives
-sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-offchain = { package = 'sp-offchain', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-authority-discovery = { package = 'sp-authority-discovery', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-consensus-babe = { package = 'sp-consensus-babe', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-transaction-pool = { package = 'sp-transaction-pool', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-session = { package = 'sp-session', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-block-builder = { package = 'sp-block-builder', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-api = { package = 'sp-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-version = { package = 'sp-version', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-staking = { package = 'sp-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-sp-application-crypto = { package = 'sp-application-crypto', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-offchain = { package = 'sp-offchain', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-authority-discovery = { package = 'sp-authority-discovery', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-consensus-babe = { package = 'sp-consensus-babe', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-transaction-pool = { package = 'sp-transaction-pool', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-session = { package = 'sp-session', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-block-builder = { package = 'sp-block-builder', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-api = { package = 'sp-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-version = { package = 'sp-version', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-staking = { package = 'sp-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+sp-application-crypto = { package = 'sp-application-crypto', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 # Frame
-frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-executive = { package = 'frame-executive', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-frame-system-rpc-runtime-api = { package = 'frame-system-rpc-runtime-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-executive = { package = 'frame-executive', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system-rpc-runtime-api = { package = 'frame-system-rpc-runtime-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 # Pallets
-pallet-grandpa = { package = 'pallet-grandpa', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-staking-reward-curve = { package = 'pallet-staking-reward-curve', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-babe = { package = 'pallet-babe', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-transaction-payment = { package = 'pallet-transaction-payment', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-transaction-payment-rpc-runtime-api = { package = 'pallet-transaction-payment-rpc-runtime-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-authorship = { package = 'pallet-authorship', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-session = { package = 'pallet-session', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-offences = { package = 'pallet-offences', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-finality-tracker = { package = 'pallet-finality-tracker', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-randomness-collective-flip = { package = 'pallet-randomness-collective-flip', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-authority-discovery = { package = 'pallet-authority-discovery', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-sudo = { package = 'pallet-sudo', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-staking = { package = 'pallet-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-collective = { package = 'pallet-collective', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
-pallet-utility = { package = 'pallet-utility', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+pallet-grandpa = { package = 'pallet-grandpa', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-staking-reward-curve = { package = 'pallet-staking-reward-curve', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-babe = { package = 'pallet-babe', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-transaction-payment = { package = 'pallet-transaction-payment', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-transaction-payment-rpc-runtime-api = { package = 'pallet-transaction-payment-rpc-runtime-api', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-authorship = { package = 'pallet-authorship', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-session = { package = 'pallet-session', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-offences = { package = 'pallet-offences', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-finality-tracker = { package = 'pallet-finality-tracker', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-randomness-collective-flip = { package = 'pallet-randomness-collective-flip', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-authority-discovery = { package = 'pallet-authority-discovery', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-sudo = { package = 'pallet-sudo', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-staking = { package = 'pallet-staking', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+pallet-collective = { package = 'pallet-collective', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
+substrate-utility = { package = 'pallet-utility', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 
 # Benchmarking
-frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true }
-frame-system-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true }
-pallet-offences-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true }
-pallet-session-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true }
+frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', default-features = false, optional = true }
+frame-system-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', default-features = false, optional = true }
+pallet-offences-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', default-features = false, optional = true }
+pallet-session-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62', default-features = false, optional = true }
 
 # Joystream
 common = { package = 'pallet-common', default-features = false, path = '../runtime-modules/common'}
@@ -77,10 +77,10 @@ proposals-codex = { package = 'pallet-proposals-codex', default-features = false
 content = { package = 'pallet-content', default-features = false, path = '../runtime-modules/content' }
 
 [dev-dependencies]
-sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'}
+sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62'}
 strum = {version = "0.19", default-features = false}
 [build-dependencies]
-wasm-builder-runner = { package = "substrate-wasm-builder-runner", git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
+wasm-builder-runner = { package = "substrate-wasm-builder-runner", git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
 
 [features]
 default = ['std']
@@ -110,7 +110,7 @@ std = [
     'frame-support/std',
     'frame-executive/std',
     'frame-system-rpc-runtime-api/std',
-    'system/std',
+    'frame-system/std',
 
     # Pallets
     'pallet-timestamp/std',
@@ -130,7 +130,7 @@ std = [
     'pallet-im-online/std',
     'pallet-collective/std',
     'pallet-offences/std',
-    'pallet-utility/std',
+    'substrate-utility/std',
 
     # Joystream
     'common/std',
@@ -150,7 +150,7 @@ std = [
     'content/std',
 ]
 runtime-benchmarks = [
-    "system/runtime-benchmarks",
+    "frame-system/runtime-benchmarks",
 	"frame-support/runtime-benchmarks",
 	"sp-runtime/runtime-benchmarks",
 	"pallet-balances/runtime-benchmarks",
@@ -162,7 +162,7 @@ runtime-benchmarks = [
     "frame-system-benchmarking",
     "pallet-offences-benchmarking",
 	"pallet-session-benchmarking",
-    "pallet-utility/runtime-benchmarks",
+    "substrate-utility/runtime-benchmarks",
 ]
 
 

+ 1 - 1
runtime/build.rs

@@ -25,7 +25,7 @@ fn main() {
 
     WasmBuilder::new()
         .with_current_project()
-        .with_wasm_builder_from_crates("1.0.11")
+        .with_wasm_builder_from_crates("2.0.0")
         .export_heap_base()
         .import_memory()
         .build()

+ 11 - 8
runtime/src/integration/proposals/council_origin_validator.rs

@@ -14,15 +14,18 @@ pub struct CouncilManager<T> {
 }
 
 impl<T: governance::council::Trait + membership::Trait>
-    ActorOriginValidator<<T as system::Trait>::Origin, MemberId<T>, <T as system::Trait>::AccountId>
-    for CouncilManager<T>
+    ActorOriginValidator<
+        <T as frame_system::Trait>::Origin,
+        MemberId<T>,
+        <T as frame_system::Trait>::AccountId,
+    > for CouncilManager<T>
 {
     /// Check for valid combination of origin and actor_id. Actor_id should be valid member_id of
     /// the membership module
     fn ensure_actor_origin(
-        origin: <T as system::Trait>::Origin,
+        origin: <T as frame_system::Trait>::Origin,
         actor_id: MemberId<T>,
-    ) -> Result<<T as system::Trait>::AccountId, &'static str> {
+    ) -> Result<<T as frame_system::Trait>::AccountId, &'static str> {
         let account_id = <MembershipOriginValidator<T>>::ensure_actor_origin(origin, actor_id)?;
 
         if <governance::council::Module<T>>::is_councilor(&account_id) {
@@ -45,14 +48,14 @@ mod tests {
     use super::CouncilManager;
     use crate::Runtime;
     use common::origin::ActorOriginValidator;
+    use frame_system::RawOrigin;
     use proposals_engine::VotersParameters;
     use sp_runtime::AccountId32;
-    use system::RawOrigin;
 
     type Council = governance::council::Module<Runtime>;
 
     fn initial_test_ext() -> sp_io::TestExternalities {
-        let t = system::GenesisConfig::default()
+        let t = frame_system::GenesisConfig::default()
             .build_storage::<Runtime>()
             .unwrap();
 
@@ -83,7 +86,7 @@ mod tests {
             let councilor3: [u8; 32] = [3; 32];
 
             assert!(Council::set_council(
-                system::RawOrigin::Root.into(),
+                frame_system::RawOrigin::Root.into(),
                 vec![councilor1, councilor2.into(), councilor3.into()]
             )
             .is_ok());
@@ -188,7 +191,7 @@ mod tests {
             let councilor3: [u8; 32] = [3; 32];
             let councilor4: [u8; 32] = [4; 32];
             assert!(Council::set_council(
-                system::RawOrigin::Root.into(),
+                frame_system::RawOrigin::Root.into(),
                 vec![
                     councilor1,
                     councilor2.into(),

+ 10 - 7
runtime/src/integration/proposals/membership_origin_validator.rs

@@ -3,7 +3,7 @@
 use sp_std::marker::PhantomData;
 
 use common::origin::ActorOriginValidator;
-use system::ensure_signed;
+use frame_system::ensure_signed;
 
 /// Member of the Joystream organization
 pub type MemberId<T> = <T as membership::Trait>::MemberId;
@@ -14,15 +14,18 @@ pub struct MembershipOriginValidator<T> {
 }
 
 impl<T: membership::Trait>
-    ActorOriginValidator<<T as system::Trait>::Origin, MemberId<T>, <T as system::Trait>::AccountId>
-    for MembershipOriginValidator<T>
+    ActorOriginValidator<
+        <T as frame_system::Trait>::Origin,
+        MemberId<T>,
+        <T as frame_system::Trait>::AccountId,
+    > for MembershipOriginValidator<T>
 {
     /// Check for valid combination of origin and actor_id. Actor_id should be valid member_id of
     /// the membership module
     fn ensure_actor_origin(
-        origin: <T as system::Trait>::Origin,
+        origin: <T as frame_system::Trait>::Origin,
         actor_id: MemberId<T>,
-    ) -> Result<<T as system::Trait>::AccountId, &'static str> {
+    ) -> Result<<T as frame_system::Trait>::AccountId, &'static str> {
         // check valid signed account_id
         let account_id = ensure_signed(origin)?;
 
@@ -47,13 +50,13 @@ mod tests {
     use super::MembershipOriginValidator;
     use crate::Runtime;
     use common::origin::ActorOriginValidator;
+    use frame_system::RawOrigin;
     use sp_runtime::AccountId32;
-    use system::RawOrigin;
 
     type Membership = membership::Module<Runtime>;
 
     fn initial_test_ext() -> sp_io::TestExternalities {
-        let t = system::GenesisConfig::default()
+        let t = frame_system::GenesisConfig::default()
             .build_storage::<Runtime>()
             .unwrap();
 

+ 1 - 1
runtime/src/integration/proposals/proposal_encoder.rs

@@ -143,7 +143,7 @@ struct Wg<T, I> {
 impl<T, I> Wg<T, I>
 where
     T: working_group::Trait<I>,
-    I: working_group::Instance,
+    I: frame_support::traits::Instance,
 {
     // Generic call constructor for the add working group opening.
     fn create_add_opening_call(

+ 4 - 3
runtime/src/integration/proposals/staking_events_handler.rs

@@ -6,11 +6,12 @@ use sp_std::marker::PhantomData;
 
 // Balance alias
 type BalanceOf<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
+    <<T as stake::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
 
 // Balance alias for staking
-type NegativeImbalance<T> =
-    <<T as stake::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
+type NegativeImbalance<T> = <<T as stake::Trait>::Currency as Currency<
+    <T as frame_system::Trait>::AccountId,
+>>::NegativeImbalance;
 
 /// Proposal implementation of the staking event handler from the stake module.
 /// 'marker' responsible for the 'Trait' binding.

+ 12 - 28
runtime/src/integration/transactions.rs

@@ -1,36 +1,21 @@
 use codec::Encode;
 use frame_support::debug;
-use frame_support::weights::{WeightToFeeCoefficients, WeightToFeePolynomial};
 use sp_runtime::generic;
 use sp_runtime::generic::SignedPayload;
 use sp_runtime::SaturatedConversion;
 
-use crate::{AccountId, Balance, BlockHashCount, Index, SignedExtra, UncheckedExtrinsic};
+use crate::{AccountId, BlockHashCount, Index, SignedExtra, UncheckedExtrinsic};
 use crate::{Call, Runtime, System};
 
-/// Stub for zero transaction weights.
-pub struct NoWeights;
-impl WeightToFeePolynomial for NoWeights {
-    type Balance = Balance;
-
-    fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
-        Default::default()
-    }
-
-    fn calc(_weight: &u64) -> Self::Balance {
-        Default::default()
-    }
-}
-
 /// 'Create transaction' default implementation.
 pub(crate) fn create_transaction<
-    C: system::offchain::AppCrypto<
-        <Runtime as system::offchain::SigningTypes>::Public,
-        <Runtime as system::offchain::SigningTypes>::Signature,
+    C: frame_system::offchain::AppCrypto<
+        <Runtime as frame_system::offchain::SigningTypes>::Public,
+        <Runtime as frame_system::offchain::SigningTypes>::Signature,
     >,
 >(
     call: Call,
-    public: <<Runtime as system::offchain::SigningTypes>::Signature as sp_runtime::traits::Verify>::Signer,
+    public: <<Runtime as frame_system::offchain::SigningTypes>::Signature as sp_runtime::traits::Verify>::Signer,
     account: AccountId,
     nonce: Index,
 ) -> Option<(
@@ -44,19 +29,18 @@ pub(crate) fn create_transaction<
         .unwrap_or(2) as u64;
     let current_block = System::block_number()
         .saturated_into::<u64>()
-        // The `System::block_number` is initialized with `n+1`,
+        // The `frame_system::block_number` is initialized with `n+1`,
         // so the actual block number is `n`.
         .saturating_sub(1);
     let tip = 0;
     let extra: SignedExtra = (
-        system::CheckSpecVersion::<Runtime>::new(),
-        system::CheckTxVersion::<Runtime>::new(),
-        system::CheckGenesis::<Runtime>::new(),
-        system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
-        system::CheckNonce::<Runtime>::from(nonce),
-        system::CheckWeight::<Runtime>::new(),
+        frame_system::CheckSpecVersion::<Runtime>::new(),
+        frame_system::CheckTxVersion::<Runtime>::new(),
+        frame_system::CheckGenesis::<Runtime>::new(),
+        frame_system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
+        frame_system::CheckNonce::<Runtime>::from(nonce),
+        frame_system::CheckWeight::<Runtime>::new(),
         pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
-        pallet_grandpa::ValidateEquivocationReport::<Runtime>::new(),
     );
     let raw_payload = SignedPayload::new(call, extra)
         .map_err(|e| {

+ 86 - 25
runtime/src/lib.rs

@@ -6,6 +6,8 @@
 //Substrate internal issues.
 #![allow(clippy::large_enum_variant)]
 #![allow(clippy::unnecessary_mut_passed)]
+#![allow(non_fmt_panic)]
+#![allow(clippy::from_over_into)]
 
 // Make the WASM binary available.
 // This is required only by the node build.
@@ -13,19 +15,32 @@
 #[cfg(feature = "std")]
 include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
 
+#[cfg(feature = "std")]
+/// Wasm binary unwrapped. If built with `BUILD_DUMMY_WASM_BINARY`, the function panics.
+pub fn wasm_binary_unwrap() -> &'static [u8] {
+    WASM_BINARY.expect(
+        "Development wasm binary is not available. This means the client is \
+        built with `BUILD_DUMMY_WASM_BINARY` flag and it is only usable for \
+        production chains. Please rebuild with the flag disabled.",
+    )
+}
+
 mod constants;
 mod integration;
 pub mod primitives;
 mod runtime_api;
 #[cfg(test)]
 mod tests; // Runtime integration tests
+mod weights;
 
-use frame_support::traits::KeyOwnerProofSystem;
+use frame_support::traits::{Currency, KeyOwnerProofSystem, OnUnbalanced};
 use frame_support::weights::{
     constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},
     Weight,
 };
+use frame_support::weights::{WeightToFeeCoefficients, WeightToFeePolynomial};
 use frame_support::{construct_runtime, parameter_types};
+use frame_system::EnsureRoot;
 use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
 use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
 use pallet_session::historical as pallet_session_historical;
@@ -39,7 +54,6 @@ use sp_std::vec::Vec;
 #[cfg(feature = "std")]
 use sp_version::NativeVersion;
 use sp_version::RuntimeVersion;
-use system::EnsureRoot;
 
 pub use constants::*;
 pub use primitives::*;
@@ -70,8 +84,8 @@ pub use content::MaxNumber;
 pub const VERSION: RuntimeVersion = RuntimeVersion {
     spec_name: create_runtime_str!("joystream-node"),
     impl_name: create_runtime_str!("joystream-node"),
-    authoring_version: 7,
-    spec_version: 16,
+    authoring_version: 9,
+    spec_version: 4,
     impl_version: 0,
     apis: crate::runtime_api::EXPORTED_RUNTIME_API_VERSIONS,
     transaction_version: 1,
@@ -101,7 +115,7 @@ parameter_types! {
 const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_percent(10);
 
 // TODO: adjust weight
-impl system::Trait for Runtime {
+impl frame_system::Trait for Runtime {
     type BaseCallFilter = ();
     type Origin = Origin;
     type Call = Call;
@@ -122,15 +136,17 @@ impl system::Trait for Runtime {
     type MaximumBlockLength = MaximumBlockLength;
     type AvailableBlockRatio = AvailableBlockRatio;
     type Version = Version;
-    type ModuleToIndex = ModuleToIndex;
+    type PalletInfo = PalletInfo;
     type AccountData = pallet_balances::AccountData<Balance>;
     type OnNewAccount = ();
     type OnKilledAccount = ();
+    type SystemWeightInfo = weights::frame_system::WeightInfo;
 }
 
-impl pallet_utility::Trait for Runtime {
+impl substrate_utility::Trait for Runtime {
     type Event = Event;
     type Call = Call;
+    type WeightInfo = weights::substrate_utility::WeightInfo;
 }
 
 parameter_types! {
@@ -142,6 +158,22 @@ impl pallet_babe::Trait for Runtime {
     type EpochDuration = EpochDuration;
     type ExpectedBlockTime = ExpectedBlockTime;
     type EpochChangeTrigger = pallet_babe::ExternalTrigger;
+    type KeyOwnerProofSystem = Historical;
+
+    type KeyOwnerProof = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
+        KeyTypeId,
+        pallet_babe::AuthorityId,
+    )>>::Proof;
+
+    type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
+        KeyTypeId,
+        pallet_babe::AuthorityId,
+    )>>::IdentificationTuple;
+
+    type HandleEquivocation =
+        pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
+
+    type WeightInfo = ();
 }
 
 impl pallet_grandpa::Trait for Runtime {
@@ -157,19 +189,16 @@ impl pallet_grandpa::Trait for Runtime {
 
     type KeyOwnerProofSystem = Historical;
 
-    type HandleEquivocation = pallet_grandpa::EquivocationHandler<
-        Self::KeyOwnerIdentification,
-        primitives::report::ReporterAppCrypto,
-        Runtime,
-        Offences,
-    >;
+    type HandleEquivocation =
+        pallet_grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
+    type WeightInfo = ();
 }
 
-impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
+impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime
 where
     Call: From<LocalCall>,
 {
-    fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
+    fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
         call: Call,
         public: <Signature as sp_runtime::traits::Verify>::Signer,
         account: AccountId,
@@ -182,12 +211,12 @@ where
     }
 }
 
-impl system::offchain::SigningTypes for Runtime {
+impl frame_system::offchain::SigningTypes for Runtime {
     type Public = <Signature as sp_runtime::traits::Verify>::Signer;
     type Signature = Signature;
 }
 
-impl<C> system::offchain::SendTransactionTypes<C> for Runtime
+impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
 where
     Call: From<C>,
 {
@@ -203,12 +232,14 @@ impl pallet_timestamp::Trait for Runtime {
     type Moment = Moment;
     type OnTimestampSet = Babe;
     type MinimumPeriod = MinimumPeriod;
+    type WeightInfo = weights::pallet_timestamp::WeightInfo;
 }
 
 parameter_types! {
     pub const ExistentialDeposit: u128 = 0;
     pub const TransferFee: u128 = 0;
     pub const CreationFee: u128 = 0;
+    pub const MaxLocks: u32 = 50;
     pub const InitialMembersBalance: u32 = 2000;
 }
 
@@ -218,18 +249,43 @@ impl pallet_balances::Trait for Runtime {
     type Event = Event;
     type ExistentialDeposit = ExistentialDeposit;
     type AccountStore = System;
+    type WeightInfo = weights::pallet_balances::WeightInfo;
+    type MaxLocks = MaxLocks;
 }
 
 parameter_types! {
-    pub const TransactionByteFee: Balance = 0; // TODO: adjust fee
+    pub const TransactionByteFee: Balance = 0;
+}
+
+type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;
+
+pub struct Author;
+impl OnUnbalanced<NegativeImbalance> for Author {
+    fn on_nonzero_unbalanced(amount: NegativeImbalance) {
+        Balances::resolve_creating(&Authorship::author(), amount);
+    }
+}
+
+/// Stub for zero transaction weights.
+pub struct NoWeights;
+impl WeightToFeePolynomial for NoWeights {
+    type Balance = Balance;
+
+    fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
+        Default::default()
+    }
+
+    fn calc(_weight: &u64) -> Self::Balance {
+        Default::default()
+    }
 }
 
 impl pallet_transaction_payment::Trait for Runtime {
     type Currency = Balances;
     type OnTransactionPayment = ();
     type TransactionByteFee = TransactionByteFee;
-    type WeightToFee = integration::transactions::NoWeights; // TODO: adjust weight
-    type FeeMultiplierUpdate = (); // TODO: adjust fee
+    type WeightToFee = NoWeights;
+    type FeeMultiplierUpdate = ();
 }
 
 impl pallet_sudo::Trait for Runtime {
@@ -275,6 +331,7 @@ impl pallet_session::Trait for Runtime {
     type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
     type Keys = SessionKeys;
     type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
+    type WeightInfo = weights::pallet_session::WeightInfo;
 }
 
 impl pallet_session::historical::Trait for Runtime {
@@ -327,12 +384,13 @@ impl pallet_staking::Trait for Runtime {
     type SessionInterface = Self;
     type RewardCurve = RewardCurve;
     type NextNewSession = Session;
-    type ElectionLookahead = MaxIterations;
+    type ElectionLookahead = ElectionLookahead;
     type Call = Call;
     type MaxIterations = MaxIterations;
     type MinSolutionScoreBump = MinSolutionScoreBump;
     type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
     type UnsignedPriority = StakingUnsignedPriority;
+    type WeightInfo = weights::pallet_staking::WeightInfo;
 }
 
 impl pallet_im_online::Trait for Runtime {
@@ -340,6 +398,9 @@ impl pallet_im_online::Trait for Runtime {
     type Event = Event;
     type SessionDuration = SessionDuration;
     type ReportUnresponsiveness = Offences;
+    // Using the default weights until we check if we can run the benchmarks for this pallet in
+    // the reference machine in an acceptable time.
+    type WeightInfo = ();
     type UnsignedPriority = ImOnlineUnsignedPriority;
 }
 
@@ -362,7 +423,7 @@ parameter_types! {
 }
 
 impl pallet_finality_tracker::Trait for Runtime {
-    type OnFinalizationStalled = Grandpa;
+    type OnFinalizationStalled = ();
     type WindowSize = WindowSize;
     type ReportLatency = ReportLatency;
 }
@@ -617,9 +678,9 @@ construct_runtime!(
         UncheckedExtrinsic = UncheckedExtrinsic
     {
         // Substrate
-        System: system::{Module, Call, Storage, Config, Event<T>},
-        Utility: pallet_utility::{Module, Call, Event},
-        Babe: pallet_babe::{Module, Call, Storage, Config, Inherent(Timestamp)},
+        System: frame_system::{Module, Call, Storage, Config, Event<T>},
+        Utility: substrate_utility::{Module, Call, Event},
+        Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned},
         Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
         Authorship: pallet_authorship::{Module, Call, Storage, Inherent},
         Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},

+ 1 - 2
runtime/src/primitives.rs

@@ -1,7 +1,6 @@
 //! Low-level types used throughout the Substrate code.
 
 #![warn(missing_docs)]
-
 #![cfg_attr(not(feature = "std"), no_std)]
 
 use sp_runtime::{
@@ -98,8 +97,8 @@ pub type MemberId = u64;
 /// account.
 pub mod report {
     use super::{Signature, Verify};
+    use frame_system::offchain::AppCrypto;
     use sp_core::crypto::{key_types, KeyTypeId};
-    use system::offchain::AppCrypto;
 
     /// Key type for the reporting module. Used for reporting BABE and GRANDPA
     /// equivocations.

+ 37 - 13
runtime/src/runtime_api.rs

@@ -26,16 +26,18 @@ use frame_support::weights::Weight;
 
 /// The SignedExtension to the basic transaction logic.
 pub type SignedExtra = (
-    system::CheckSpecVersion<Runtime>,
-    system::CheckTxVersion<Runtime>,
-    system::CheckGenesis<Runtime>,
-    system::CheckEra<Runtime>,
-    system::CheckNonce<Runtime>,
-    system::CheckWeight<Runtime>,
+    frame_system::CheckSpecVersion<Runtime>,
+    frame_system::CheckTxVersion<Runtime>,
+    frame_system::CheckGenesis<Runtime>,
+    frame_system::CheckEra<Runtime>,
+    frame_system::CheckNonce<Runtime>,
+    frame_system::CheckWeight<Runtime>,
     pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
-    pallet_grandpa::ValidateEquivocationReport<Runtime>,
 );
 
+/// We don't use specific Address types (like Indices).
+pub type Address = AccountId;
+
 /// Digest item type.
 pub type DigestItem = generic::DigestItem<Hash>;
 
@@ -56,7 +58,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<AccountId, Call, Signa
 
 // Default Executive type without the RuntimeUpgrade
 // pub type Executive =
-//     frame_executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
+//     frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
 
 // Alias for the builder working group
 pub(crate) type OperationsWorkingGroup<T> =
@@ -113,7 +115,7 @@ impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
 pub type Executive = frame_executive::Executive<
     Runtime,
     Block,
-    system::ChainContext<Runtime>,
+    frame_system::ChainContext<Runtime>,
     Runtime,
     AllModules,
     CustomOnRuntimeUpgrade,
@@ -185,7 +187,7 @@ impl_runtime_apis! {
             Grandpa::grandpa_authorities()
         }
 
-        fn submit_report_equivocation_extrinsic(
+        fn submit_report_equivocation_unsigned_extrinsic(
             equivocation_proof: fg_primitives::EquivocationProof<
                 <Block as BlockT>::Hash,
                 NumberFor<Block>,
@@ -194,7 +196,7 @@ impl_runtime_apis! {
         ) -> Option<()> {
             let key_owner_proof = key_owner_proof.decode()?;
 
-            Grandpa::submit_report_equivocation_extrinsic(
+            Grandpa::submit_unsigned_equivocation_report(
                 equivocation_proof,
                 key_owner_proof,
             )
@@ -229,6 +231,29 @@ impl_runtime_apis! {
             }
         }
 
+        fn generate_key_ownership_proof(
+            _slot_number: sp_consensus_babe::SlotNumber,
+            authority_id: sp_consensus_babe::AuthorityId,
+        ) -> Option<sp_consensus_babe::OpaqueKeyOwnershipProof> {
+            use codec::Encode;
+
+            Historical::prove((sp_consensus_babe::KEY_TYPE, authority_id))
+                .map(|p| p.encode())
+                .map(sp_consensus_babe::OpaqueKeyOwnershipProof::new)
+        }
+
+        fn submit_report_equivocation_unsigned_extrinsic(
+            equivocation_proof: sp_consensus_babe::EquivocationProof<<Block as BlockT>::Header>,
+            key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof,
+        ) -> Option<()> {
+            let key_owner_proof = key_owner_proof.decode()?;
+
+            Babe::submit_unsigned_equivocation_report(
+                equivocation_proof,
+                key_owner_proof,
+            )
+        }
+
         fn current_epoch_start() -> sp_consensus_babe::SlotNumber {
             Babe::current_epoch_start()
         }
@@ -249,9 +274,8 @@ impl_runtime_apis! {
     impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
         Block,
         Balance,
-        UncheckedExtrinsic,
     > for Runtime {
-        fn query_info(uxt: UncheckedExtrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {
+        fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {
             TransactionPayment::query_info(uxt, len)
         }
     }

+ 1 - 1
runtime/src/tests/mod.rs

@@ -7,7 +7,7 @@ mod proposals_integration;
 use sp_runtime::BuildStorage;
 
 pub(crate) fn initial_test_ext() -> sp_io::TestExternalities {
-    let mut t = system::GenesisConfig::default()
+    let mut t = frame_system::GenesisConfig::default()
         .build_storage::<crate::Runtime>()
         .unwrap();
 

+ 8 - 8
runtime/src/tests/proposals_integration/mod.rs

@@ -17,15 +17,15 @@ use proposals_engine::{
 use frame_support::dispatch::{DispatchError, DispatchResult};
 use frame_support::traits::{Currency, OnFinalize, OnInitialize};
 use frame_support::{StorageMap, StorageValue};
+use frame_system::RawOrigin;
 use sp_runtime::AccountId32;
-use system::RawOrigin;
 
 use super::initial_test_ext;
 
 use crate::CouncilManager;
 
 pub type Balances = pallet_balances::Module<Runtime>;
-pub type System = system::Module<Runtime>;
+pub type System = frame_system::Module<Runtime>;
 pub type Membership = membership::Module<Runtime>;
 pub type ProposalsEngine = proposals_engine::Module<Runtime>;
 pub type Council = governance::council::Module<Runtime>;
@@ -33,7 +33,7 @@ pub type Election = governance::election::Module<Runtime>;
 pub type ProposalCodex = proposals_codex::Module<Runtime>;
 
 fn setup_members(count: u8) {
-    let authority_account_id = <Runtime as system::Trait>::AccountId::default();
+    let authority_account_id = <Runtime as frame_system::Trait>::AccountId::default();
     Membership::set_screening_authority(RawOrigin::Root.into(), authority_account_id.clone())
         .unwrap();
 
@@ -59,7 +59,7 @@ fn setup_council() {
     let councilor4: [u8; 32] = [4; 32];
     let councilor5: [u8; 32] = [5; 32];
     assert!(Council::set_council(
-        system::RawOrigin::Root.into(),
+        frame_system::RawOrigin::Root.into(),
         vec![
             councilor0,
             councilor1.into(),
@@ -133,7 +133,7 @@ impl VoteGenerator {
         }
 
         ProposalsEngine::vote(
-            system::RawOrigin::Signed(self.current_account_id.clone()).into(),
+            frame_system::RawOrigin::Signed(self.current_account_id.clone()).into(),
             self.current_voter_id,
             self.proposal_id,
             vote_kind,
@@ -169,7 +169,7 @@ impl Default for DummyProposalFixture {
                 grace_period: 0,
                 required_stake: None,
             },
-            account_id: <Runtime as system::Trait>::AccountId::default(),
+            account_id: <Runtime as frame_system::Trait>::AccountId::default(),
             proposer_id: 0,
             proposal_code: dummy_proposal.encode(),
             title,
@@ -236,7 +236,7 @@ struct CancelProposalFixture {
 
 impl CancelProposalFixture {
     fn new(proposal_id: u32) -> Self {
-        let account_id = <Runtime as system::Trait>::AccountId::default();
+        let account_id = <Runtime as frame_system::Trait>::AccountId::default();
         CancelProposalFixture {
             proposal_id,
             origin: RawOrigin::Signed(account_id),
@@ -268,7 +268,7 @@ impl CancelProposalFixture {
 #[test]
 fn proposal_cancellation_with_slashes_with_balance_checks_succeeds() {
     initial_test_ext().execute_with(|| {
-        let account_id = <Runtime as system::Trait>::AccountId::default();
+        let account_id = <Runtime as frame_system::Trait>::AccountId::default();
 
         setup_members(2);
         let member_id = 0; // newly created member_id

+ 55 - 53
runtime/src/tests/proposals_integration/working_group_proposals.rs

@@ -3,7 +3,7 @@
 
 use super::*;
 
-use system::RawOrigin;
+use frame_system::RawOrigin;
 
 use common::working_group::WorkingGroup;
 use hiring::ActivateOpeningAt;
@@ -257,8 +257,8 @@ fn set_reward(
 }
 
 fn set_mint_capacity<
-    T: working_group::Trait<I> + system::Trait + minting::Trait,
-    I: working_group::Instance,
+    T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+    I: frame_support::traits::Instance,
 >(
     member_id: MemberId,
     account_id: [u8; 32],
@@ -364,8 +364,8 @@ fn create_add_working_group_leader_opening_proposal_execution_succeeds() {
 }
 
 fn run_create_add_working_group_leader_opening_proposal_execution_succeeds<
-    T: working_group::Trait<I> + system::Trait + stake::Trait,
-    I: working_group::Instance,
+    T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+    I: frame_support::traits::Instance,
 >(
     working_group: WorkingGroup,
 ) where
@@ -434,8 +434,8 @@ fn create_begin_review_working_group_leader_applications_proposal_execution_succ
 }
 
 fn run_create_begin_review_working_group_leader_applications_proposal_execution_succeeds<
-    T: working_group::Trait<I> + system::Trait + stake::Trait,
-    I: working_group::Instance,
+    T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+    I: frame_support::traits::Instance,
 >(
     working_group: WorkingGroup,
 ) where
@@ -525,12 +525,12 @@ fn create_fill_working_group_leader_opening_proposal_execution_succeeds() {
     }
 
     fn run_create_fill_working_group_leader_opening_proposal_execution_succeeds<
-        T: working_group::Trait<I> + system::Trait + stake::Trait,
-        I: working_group::Instance,
+        T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+        I: frame_support::traits::Instance,
     >(
         working_group: WorkingGroup,
     ) where
-        <T as system::Trait>::AccountId: From<[u8; 32]>,
+        <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
         <T as membership::Trait>::MemberId: From<u64>,
         <T as hiring::Trait>::OpeningId: From<u64>,
     {
@@ -614,19 +614,20 @@ fn create_fill_working_group_leader_opening_proposal_execution_succeeds() {
         }
     }
 
-fn run_create_decrease_group_leader_stake_proposal_execution_succeeds<
-    T: working_group::Trait<I> + system::Trait + stake::Trait,
-    I: working_group::Instance,
->(
-    working_group: WorkingGroup,
-) where
-    <T as system::Trait>::AccountId: From<[u8; 32]>,
-    <T as hiring::Trait>::OpeningId: From<u64>,
-    <T as membership::Trait>::MemberId: From<u64>,
-    <T as membership::Trait>::ActorId: Into<u64>,
-    <<T as stake::Trait>::Currency as traits::Currency<<T as system::Trait>::AccountId>>::Balance:
-        From<u128>,
-{
+    fn run_create_decrease_group_leader_stake_proposal_execution_succeeds<
+        T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+        I: frame_support::traits::Instance,
+    >(
+        working_group: WorkingGroup,
+    ) where
+        <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
+        <T as hiring::Trait>::OpeningId: From<u64>,
+        <T as membership::Trait>::MemberId: From<u64>,
+        <T as membership::Trait>::ActorId: Into<u64>,
+        <<T as stake::Trait>::Currency as traits::Currency<
+            <T as frame_system::Trait>::AccountId,
+        >>::Balance: From<u128>,
+    {
         initial_test_ext().execute_with(|| {
             let member_id: MemberId = 1;
             let account_id: [u8; 32] = [member_id as u8; 32];
@@ -742,19 +743,20 @@ fn run_create_decrease_group_leader_stake_proposal_execution_succeeds<
         }
     }
 
-fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
-    T: working_group::Trait<I> + system::Trait + stake::Trait,
-    I: working_group::Instance,
->(
-    working_group: WorkingGroup,
-) where
-    <T as system::Trait>::AccountId: From<[u8; 32]>,
-    <T as hiring::Trait>::OpeningId: From<u64>,
-    <T as membership::Trait>::MemberId: From<u64>,
-    <T as membership::Trait>::ActorId: Into<u64>,
-    <<T as stake::Trait>::Currency as traits::Currency<<T as system::Trait>::AccountId>>::Balance:
-        From<u128>,
-{
+    fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
+        T: working_group::Trait<I> + frame_system::Trait + stake::Trait,
+        I: frame_support::traits::Instance,
+    >(
+        working_group: WorkingGroup,
+    ) where
+        <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
+        <T as hiring::Trait>::OpeningId: From<u64>,
+        <T as membership::Trait>::MemberId: From<u64>,
+        <T as membership::Trait>::ActorId: Into<u64>,
+        <<T as stake::Trait>::Currency as traits::Currency<
+            <T as frame_system::Trait>::AccountId,
+        >>::Balance: From<u128>,
+    {
         initial_test_ext().execute_with(|| {
             let member_id: MemberId = 1;
             let account_id: [u8; 32] = [member_id as u8; 32];
@@ -871,16 +873,16 @@ fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
         }
 
         fn run_create_set_working_group_mint_capacity_proposal_execution_succeeds<
-            T: working_group::Trait<I> + system::Trait + minting::Trait,
-            I: working_group::Instance,
+            T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+            I: frame_support::traits::Instance,
         >(
             working_group: WorkingGroup,
         ) where
-            <T as system::Trait>::AccountId: From<[u8; 32]>,
+            <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
             <T as membership::Trait>::MemberId: From<u64>,
             <T as minting::Trait>::MintId: From<u64>,
             <<T as minting::Trait>::Currency as traits::Currency<
-                <T as system::Trait>::AccountId,
+                <T as frame_system::Trait>::AccountId,
             >>::Balance: From<u128>,
         {
             initial_test_ext().execute_with(|| {
@@ -940,24 +942,24 @@ fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
         }
 
         fn run_create_set_group_leader_reward_proposal_execution_succeeds<
-            T: working_group::Trait<I> + system::Trait + minting::Trait,
-            I: working_group::Instance,
+            T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+            I: frame_support::traits::Instance,
         >(
             working_group: WorkingGroup,
         ) where
-            <T as system::Trait>::AccountId: From<[u8; 32]>,
+            <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
             <T as membership::Trait>::MemberId: From<u64>,
             <T as membership::Trait>::ActorId: Into<u64>,
             <T as minting::Trait>::MintId: From<u64>,
             <T as hiring::Trait>::OpeningId: From<u64>,
             <<T as minting::Trait>::Currency as traits::Currency<
-                <T as system::Trait>::AccountId,
+                <T as frame_system::Trait>::AccountId,
             >>::Balance: From<u128>,
         {
             initial_test_ext().execute_with(|| {
                 let member_id: MemberId = 1;
                 let account_id: [u8; 32] = [member_id as u8; 32];
-                let stake_amount = 100;
+                let stake_amount = 100u32;
 
                 let opening_policy_commitment = OpeningPolicyCommitment {
                     role_staking_policy: Some(hiring::StakingPolicy {
@@ -1075,18 +1077,18 @@ fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
         }
 
         fn run_create_terminate_group_leader_role_proposal_execution_succeeds<
-            T: working_group::Trait<I> + system::Trait + minting::Trait,
-            I: working_group::Instance,
+            T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+            I: frame_support::traits::Instance,
         >(
             working_group: WorkingGroup,
         ) where
-            <T as system::Trait>::AccountId: From<[u8; 32]>,
+            <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
             <T as membership::Trait>::MemberId: From<u64>,
             <T as membership::Trait>::ActorId: Into<u64>,
             <T as minting::Trait>::MintId: From<u64>,
             <T as hiring::Trait>::OpeningId: From<u64>,
             <<T as stake::Trait>::Currency as traits::Currency<
-                <T as system::Trait>::AccountId,
+                <T as frame_system::Trait>::AccountId,
             >>::Balance: From<u128>,
         {
             initial_test_ext().execute_with(|| {
@@ -1200,18 +1202,18 @@ fn run_create_slash_group_leader_stake_proposal_execution_succeeds<
         }
 
         fn run_create_terminate_group_leader_role_proposal_with_slashing_execution_succeeds<
-            T: working_group::Trait<I> + system::Trait + minting::Trait,
-            I: working_group::Instance,
+            T: working_group::Trait<I> + frame_system::Trait + minting::Trait,
+            I: frame_support::traits::Instance,
         >(
             working_group: WorkingGroup,
         ) where
-            <T as system::Trait>::AccountId: From<[u8; 32]>,
+            <T as frame_system::Trait>::AccountId: From<[u8; 32]>,
             <T as membership::Trait>::MemberId: From<u64>,
             <T as membership::Trait>::ActorId: Into<u64>,
             <T as minting::Trait>::MintId: From<u64>,
             <T as hiring::Trait>::OpeningId: From<u64>,
             <<T as stake::Trait>::Currency as traits::Currency<
-                <T as system::Trait>::AccountId,
+                <T as frame_system::Trait>::AccountId,
             >>::Balance: From<u128>,
         {
             initial_test_ext().execute_with(|| {

+ 41 - 0
runtime/src/weights/frame_system.rs

@@ -0,0 +1,41 @@
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
+
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+
+use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
+
+pub struct WeightInfo;
+impl frame_system::WeightInfo for WeightInfo {
+    // WARNING! Some components were not used: ["b"]
+    fn remark() -> Weight {
+        (9_342_000 as Weight)
+    }
+    fn set_heap_pages() -> Weight {
+        (11_274_000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    // WARNING! Some components were not used: ["d"]
+    fn set_changes_trie_config() -> Weight {
+        (32_325_000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
+    fn set_storage(i: u32) -> Weight {
+        (0 as Weight)
+            .saturating_add((2_060_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
+    }
+    fn kill_storage(i: u32) -> Weight {
+        (27_686_000 as Weight)
+            .saturating_add((1_237_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
+    }
+    fn kill_prefix(p: u32) -> Weight {
+        (27_689_000 as Weight)
+            .saturating_add((1_205_000 as Weight).saturating_mul(p as Weight))
+            .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
+    }
+    fn suicide() -> Weight {
+        (145_274_000 as Weight)
+    }
+}

+ 27 - 0
runtime/src/weights/mod.rs

@@ -0,0 +1,27 @@
+// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// 	http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//! A list of the different weight modules for our runtime.
+
+// Disable lints for Auto-generated code.
+#![allow(clippy::unnecessary_cast)]
+
+// FRAME pallets
+pub mod frame_system;
+pub mod pallet_balances;
+pub mod pallet_session;
+pub mod pallet_staking;
+pub mod pallet_timestamp;
+pub mod substrate_utility;

+ 47 - 0
runtime/src/weights/pallet_balances.rs

@@ -0,0 +1,47 @@
+// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// 	http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5
+
+use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
+
+pub struct WeightInfo;
+impl pallet_balances::WeightInfo for WeightInfo {
+    fn transfer() -> Weight {
+        (65949000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn transfer_keep_alive() -> Weight {
+        (46665000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_balance_creating() -> Weight {
+        (27086000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_balance_killing() -> Weight {
+        (33424000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn force_transfer() -> Weight {
+        (65343000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
+}

+ 20 - 0
runtime/src/weights/pallet_session.rs

@@ -0,0 +1,20 @@
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
+
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+
+use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
+
+pub struct WeightInfo;
+impl pallet_session::WeightInfo for WeightInfo {
+    fn set_keys() -> Weight {
+        (433_479_000 as Weight)
+            .saturating_add(DbWeight::get().reads(6 as Weight))
+            .saturating_add(DbWeight::get().writes(5 as Weight))
+    }
+    fn purge_keys() -> Weight {
+        (299_139_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(5 as Weight))
+    }
+}

+ 166 - 0
runtime/src/weights/pallet_staking.rs

@@ -0,0 +1,166 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// 	http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//! Default weights of pallet-staking.
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6
+
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+
+use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
+
+pub struct WeightInfo;
+impl pallet_staking::WeightInfo for WeightInfo {
+    fn bond() -> Weight {
+        (144278000 as Weight)
+            .saturating_add(DbWeight::get().reads(5 as Weight))
+            .saturating_add(DbWeight::get().writes(4 as Weight))
+    }
+    fn bond_extra() -> Weight {
+        (110715000 as Weight)
+            .saturating_add(DbWeight::get().reads(4 as Weight))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
+    fn unbond() -> Weight {
+        (99840000 as Weight)
+            .saturating_add(DbWeight::get().reads(5 as Weight))
+            .saturating_add(DbWeight::get().writes(3 as Weight))
+    }
+    fn withdraw_unbonded_update(s: u32) -> Weight {
+        (100728000 as Weight)
+            .saturating_add((63000 as Weight).saturating_mul(s as Weight))
+            .saturating_add(DbWeight::get().reads(5 as Weight))
+            .saturating_add(DbWeight::get().writes(3 as Weight))
+    }
+    fn withdraw_unbonded_kill(s: u32) -> Weight {
+        (168879000 as Weight)
+            .saturating_add((6666000 as Weight).saturating_mul(s as Weight))
+            .saturating_add(DbWeight::get().reads(7 as Weight))
+            .saturating_add(DbWeight::get().writes(8 as Weight))
+            .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+    }
+    fn validate() -> Weight {
+        (35539000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
+    fn nominate(n: u32) -> Weight {
+        (48596000 as Weight)
+            .saturating_add((308000 as Weight).saturating_mul(n as Weight))
+            .saturating_add(DbWeight::get().reads(3 as Weight))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
+    fn chill() -> Weight {
+        (35144000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
+    fn set_payee() -> Weight {
+        (24255000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_controller() -> Weight {
+        (52294000 as Weight)
+            .saturating_add(DbWeight::get().reads(3 as Weight))
+            .saturating_add(DbWeight::get().writes(3 as Weight))
+    }
+    fn set_validator_count() -> Weight {
+        (5185000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn force_no_eras() -> Weight {
+        (5907000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn force_new_era() -> Weight {
+        (5917000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn force_new_era_always() -> Weight {
+        (5952000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_invulnerables(v: u32) -> Weight {
+        (6324000 as Weight)
+            .saturating_add((9000 as Weight).saturating_mul(v as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn force_unstake(s: u32) -> Weight {
+        (119691000 as Weight)
+            .saturating_add((6681000 as Weight).saturating_mul(s as Weight))
+            .saturating_add(DbWeight::get().reads(4 as Weight))
+            .saturating_add(DbWeight::get().writes(8 as Weight))
+            .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+    }
+    fn cancel_deferred_slash(s: u32) -> Weight {
+        (5820201000 as Weight)
+            .saturating_add((34672000 as Weight).saturating_mul(s as Weight))
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn payout_stakers_dead_controller(n: u32) -> Weight {
+        (0 as Weight)
+            .saturating_add((92486000 as Weight).saturating_mul(n as Weight))
+            .saturating_add(DbWeight::get().reads(4 as Weight))
+            .saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
+            .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight)))
+    }
+    fn payout_stakers_alive_staked(n: u32) -> Weight {
+        (0 as Weight)
+            .saturating_add((117324000 as Weight).saturating_mul(n as Weight))
+            .saturating_add(DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight)))
+            .saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight)))
+    }
+    fn rebond(l: u32) -> Weight {
+        (71316000 as Weight)
+            .saturating_add((142000 as Weight).saturating_mul(l as Weight))
+            .saturating_add(DbWeight::get().reads(4 as Weight))
+            .saturating_add(DbWeight::get().writes(3 as Weight))
+    }
+    fn set_history_depth(e: u32) -> Weight {
+        (0 as Weight)
+            .saturating_add((51901000 as Weight).saturating_mul(e as Weight))
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(4 as Weight))
+            .saturating_add(DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight)))
+    }
+    fn reap_stash(s: u32) -> Weight {
+        (147166000 as Weight)
+            .saturating_add((6661000 as Weight).saturating_mul(s as Weight))
+            .saturating_add(DbWeight::get().reads(4 as Weight))
+            .saturating_add(DbWeight::get().writes(8 as Weight))
+            .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+    }
+    fn new_era(v: u32, n: u32) -> Weight {
+        (0 as Weight)
+            .saturating_add((1440459000 as Weight).saturating_mul(v as Weight))
+            .saturating_add((182580000 as Weight).saturating_mul(n as Weight))
+            .saturating_add(DbWeight::get().reads(10 as Weight))
+            .saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight)))
+            .saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
+            .saturating_add(DbWeight::get().writes(8 as Weight))
+            .saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight)))
+    }
+    fn submit_solution_better(v: u32, n: u32, a: u32, w: u32) -> Weight {
+        (0 as Weight)
+            .saturating_add((964000 as Weight).saturating_mul(v as Weight))
+            .saturating_add((432000 as Weight).saturating_mul(n as Weight))
+            .saturating_add((204294000 as Weight).saturating_mul(a as Weight))
+            .saturating_add((9546000 as Weight).saturating_mul(w as Weight))
+            .saturating_add(DbWeight::get().reads(6 as Weight))
+            .saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(a as Weight)))
+            .saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight)))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
+}

+ 34 - 0
runtime/src/weights/pallet_timestamp.rs

@@ -0,0 +1,34 @@
+// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// 	http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc5
+
+#![allow(unused_parens)]
+
+use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
+
+pub struct WeightInfo;
+impl pallet_timestamp::WeightInfo for WeightInfo {
+    // WARNING! Some components were not used: ["t"]
+    fn set() -> Weight {
+        (9133000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    // WARNING! Some components were not used: ["t"]
+    fn on_finalize() -> Weight {
+        (5915000 as Weight)
+    }
+}

+ 17 - 0
runtime/src/weights/substrate_utility.rs

@@ -0,0 +1,17 @@
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0
+
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+
+use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
+
+pub struct WeightInfo;
+impl substrate_utility::WeightInfo for WeightInfo {
+    fn batch(c: u32) -> Weight {
+        (0 as Weight).saturating_add((105_180_000 as Weight).saturating_mul(c as Weight))
+    }
+    // WARNING! Some components were not used: ["u"]
+    fn as_derivative() -> Weight {
+        (67_812_000 as Weight)
+    }
+}

+ 8 - 18
setup.sh

@@ -5,7 +5,7 @@ set -e
 if [[ "$OSTYPE" == "linux-gnu" ]]; then
     # code build tools
     sudo apt-get update
-    sudo apt-get install -y coreutils clang jq curl gcc xz-utils sudo pkg-config unzip clang libc6-dev-i386 make libssl-dev python
+    sudo apt-get install -y coreutils clang llvm jq curl gcc xz-utils sudo pkg-config unzip libc6-dev make libssl-dev python
     # docker
     sudo apt-get install -y docker.io docker-compose containerd runc
 elif [[ "$OSTYPE" == "darwin"* ]]; then
@@ -15,7 +15,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
     fi
     # install additional packages
     brew update
-    brew install b2sum gnu-tar jq curl
+    brew install coreutils gnu-tar jq curl
     echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
 fi
 
@@ -25,31 +25,21 @@ curl https://getsubstrate.io -sSf | bash -s -- --fast
 
 source ~/.cargo/env
 
-rustup component add rustfmt clippy
+rustup install nightly-2021-03-24
+rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
 
-# Current version of substrate requires an older version of nightly toolchain
-# to successfully compile the WASM runtime. We force install because rustfmt package
-# is not available for this nightly version.
-rustup install nightly-2020-05-23 --force
-rustup target add wasm32-unknown-unknown --toolchain nightly-2020-05-23
+rustup default nightly-2021-03-24
 
-# Latest clippy linter which comes with 1.47.0 fails on some subtrate modules
-# Also note combination of newer versions of toolchain with the above nightly
-# toolchain to build wasm seems to fail.
-# So we need to stick with an older version until we update substrate
-rustup install 1.46.0
-rustup default 1.46.0
+rustup component add rustfmt clippy
 
 # Volta nodejs, npm, yarn tools manager
 curl https://get.volta.sh | bash
 
 # source env variables added by Volta
-source source ~/.bash_profile || ~/.profile || source ~/.bashrc || :
+source ~/.bash_profile || source ~/.profile || source ~/.bashrc || :
 
 volta install node@12
 volta install yarn
 volta install npx
 
-echo "Starting new terminal/shell session to make newly installed tools available."
-
-exec bash -l
+echo "You may need to open a new terminal/shell session to make newly installed tools available."

+ 64 - 0
tests/network-tests/run-local-node-test.sh

@@ -0,0 +1,64 @@
+# Location that will be mounted as the /data volume in containers
+# This is how we access the initial members and balances files from
+# the containers and where generated chainspec files will be located.
+DATA_PATH="test-data"
+
+# Initial account balance for Alice
+# Alice is the source of funds for all new accounts that are created in the tests.
+ALICE_INITIAL_BALANCE=100000000
+
+rm -Rf ${DATA_PATH}
+mkdir -p ${DATA_PATH}
+
+echo "{
+  \"balances\":[
+    [\"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY\", ${ALICE_INITIAL_BALANCE}]
+  ]
+}" > ${DATA_PATH}/initial-balances.json
+
+# Make Alice a member
+echo '
+  [{
+    "member_id": 0,
+    "root_account": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
+    "controller_account": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
+    "handle":"alice_with_a_long_handle",
+    "avatar_uri":"https://alice.com/avatar.png",
+    "about":"Alice",
+    "name": "Alice",
+    "registered_at_time": 0
+  },
+  {
+    "member_id": 1,
+    "root_account": "5FUeDYFzvvizNhhHyidsuchG7jnToKj7zfimbWBpWKzT9Fqe",
+    "controller_account": "5FUeDYFzvvizNhhHyidsuchG7jnToKj7zfimbWBpWKzT9Fqe",
+    "handle":"bob_with_a_long_handle",
+    "avatar_uri":"https://bob.com/avatar.png",
+    "about":"Bob",
+    "name": "Bob",
+    "registered_at_time": 0
+  }
+]
+' > ${DATA_PATH}/initial-members.json
+
+# Create a chain spec file
+./target/release/chain-spec-builder generate -a 2 -e 2 -k ${DATA_PATH} --chain-spec-path ${DATA_PATH}/chain-spec.json --initial-balances-path ${DATA_PATH}/initial-balances.json --initial-members-path ${DATA_PATH}/initial-members.json --deployment live > ${DATA_PATH}/seeds
+
+jq -c '.id = "js_babylon_test"' ${DATA_PATH}/chain-spec.json > tmp.$$.json && mv tmp.$$.json ${DATA_PATH}/chain-spec.json
+jq -c '.protocolId = "js/babylon/test"' ${DATA_PATH}/chain-spec.json > tmp.$$.json && mv tmp.$$.json ${DATA_PATH}/chain-spec.json
+
+timeout 3s ./target/release/joystream-node --base-path ${DATA_PATH}/alice3  --validator --chain ${DATA_PATH}/chain-spec.json
+
+
+timeout 3s ./target/release/joystream-node --base-path ${DATA_PATH}/bob4  --validator --port 30334 --ws-port 9945 --chain ${DATA_PATH}/chain-spec.json
+
+
+mv  ${DATA_PATH}/auth-0/* ${DATA_PATH}/alice3/chains/js_babylon_test/keystore
+mv  ${DATA_PATH}/auth-1/* ${DATA_PATH}/bob4/chains/js_babylon_test/keystore
+
+rm -Rf ${DATA_PATH}/alice3/chains/js_babylon_test/db
+rm -Rf ${DATA_PATH}/bob4/chains/js_babylon_test/db
+
+# RUN
+#./target/release/joystream-node --base-path test-data/alice3  --validator --chain test-data/chain-spec.json --pruning=archive --log runtime,txpool,transaction-pool
+#./target/release/joystream-node --base-path test-data/bob4 --validator --port 30334 --ws-port 9945 --chain test-data/chain-spec.json --pruning=archive --log runtime,txpool,transaction-pool

+ 6 - 6
utils/chain-spec-builder/Cargo.toml

@@ -3,16 +3,16 @@ authors = ['Joystream contributors']
 build = 'build.rs'
 edition = '2018'
 name = 'chain-spec-builder'
-version = '3.1.0'
+version = '3.1.1'
 
 [dependencies]
 ansi_term = "0.12.1"
 rand = "0.7.2"
 structopt = "0.3.8"
-sc-keystore = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-telemetry = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sc-chain-spec = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
-sp-core = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4' }
+sc-keystore = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-telemetry = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sc-chain-spec = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
+sp-core = { git = 'https://github.com/paritytech/substrate.git', rev = '2cd20966cc09b059817c3ebe12fc130cdd850d62' }
 joystream-node = { path = "../../node" }
 
-enum-utils = "0.1.2"
+enum-utils = "0.1.2"

+ 1 - 0
utils/chain-spec-builder/src/main.rs

@@ -48,6 +48,7 @@ enum ChainDeployment {
     live,
 }
 
+#[allow(clippy::from_over_into)]
 impl Into<ChainType> for ChainDeployment {
     fn into(self) -> ChainType {
         match self {

Some files were not shown because too many files changed in this diff