remove Default from CandidateDescriptor (#4484)

* remove Default from CandidateHash

* Apply suggestions from code review

Co-authored-by: Andronik Ordian <write@reusable.software>

* chore: fmt

* remove backed candidate default

* Partial migration away from CandidateReceipt::default

* Remove more CandidateReceipt defaults

* fmt

* Mostly remove CommittedCandidateReceipt default usage

* Remove CommittedCandidateReceipt

* Remove more Defaults from polakdot primitives v1 + fmt

* Remove more Default from polkadot primites v1

* WIP trying to get overseer example + tests to compile

* feat: add primitives test helpers

* reduce deps of helper

* update primitive helpers

* make candidate validation compile

* fixup cargo lock

* make av-store compile

* fixup disputes coordinator tests

* test: fixup backing

* test: fixup approval voting

* fixup bitfield signing

* test: fixup runtime-api

* test: fixup availability dist

* foxi[ pverseer test]

* remove some Defaults, remove bounds from `dummy`

All `fn dummy` in primitives need to be removed anyways.
This aids in the transition.

* it's a test helper, so always use std

* test: fixup parachains runtime tests

Excluding benches.

* fix keyring

* fix paras runtime properly, no more default

* Remove fn dummy() usage from approval voting

* Move TestCandidateBuilder out of av store to test helpers

* Make candidate validation tests pass

* Make most dispute coirdinator tests pass

* Make provisioner tests work

* Make availability recovery tests work with test helpers

* Update polkadot-collator-protocol tests

* Update statement distribution tests

* Update polkadot overseer examples and tests

* Derive default for validation code so we don't break unrelated things

* Make para runtime test pass (no bench)

* Some more work

* chore: cargo fmt

* cargo fix

* avoid some Default::default

* fixup dispute coordinator test

* remove unused crate deps

* remove Default::default wherever possible, replace by dummy_* for the most part

* chore: cargo fmt

* Remove some warnings

* Remove CommittedCandidateReceipt dummy

* Remove CandidateReceipt dummy

* Remove CandidateDescriptor dummy

* Remove commented out code

* Fix para runtime tests

* chore: nightly

* Some updates to the builder

* Dynamically adjust mock head data size

* Make dispute cooridinator tests work

* Fix test candidate_backing_reorders_votes work

* +nightly-2021-10-29 fmt

* Spelling and remove a default use in builder

* Various clean up

* More small updates

* fmt

* More small updates

* Doc comments for test helpers

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras_inherent --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras_inherent.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras_inherent --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras_inherent.rs

* Update lib.rs

* review comments

* fix warnings

* fix test by using correct candidate receipt relay parent

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: emostov <32168567+emostov@users.noreply.github.com>
Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
Bernhard Schuster
2021-12-10 13:12:07 +01:00
committed by GitHub
parent 916497e5db
commit 0f1a9fb1eb
68 changed files with 993 additions and 500 deletions
+29 -2
View File
@@ -5820,6 +5820,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"rand 0.8.4",
"sc-network",
"sp-core",
@@ -5848,6 +5849,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"rand 0.8.4",
"sc-network",
"sp-application-crypto",
@@ -5928,6 +5930,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sc-network",
"sp-core",
"sp-keyring",
@@ -5968,6 +5971,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sc-keystore",
"sc-network",
"sp-application-crypto",
@@ -6033,6 +6037,7 @@ dependencies = [
"polkadot-node-subsystem-util",
"polkadot-overseer",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sc-network",
"sp-consensus",
"sp-core",
@@ -6052,6 +6057,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sp-core",
"sp-maybe-compressed-blob",
"thiserror",
@@ -6080,6 +6086,7 @@ dependencies = [
"polkadot-node-subsystem-util",
"polkadot-overseer",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"rand_core 0.5.1",
"sc-keystore",
"schnorrkel",
@@ -6115,6 +6122,7 @@ dependencies = [
"polkadot-node-subsystem-util",
"polkadot-overseer",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sp-core",
"sp-keyring",
"thiserror",
@@ -6134,6 +6142,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"polkadot-statement-table",
"sc-keystore",
"sp-application-crypto",
@@ -6154,6 +6163,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sp-keystore",
"thiserror",
"tracing",
@@ -6175,6 +6185,7 @@ dependencies = [
"polkadot-node-subsystem-util",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sp-core",
"sp-keyring",
"sp-maybe-compressed-blob",
@@ -6226,8 +6237,6 @@ name = "polkadot-node-core-dispute-coordinator"
version = "0.9.13"
dependencies = [
"assert_matches",
"bitvec",
"derive_more",
"futures 0.3.18",
"kvdb",
"kvdb-memorydb",
@@ -6237,6 +6246,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sc-keystore",
"sp-core",
"sp-keyring",
@@ -6272,6 +6282,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sp-application-crypto",
"sp-keystore",
"thiserror",
@@ -6324,6 +6335,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sp-api",
"sp-authority-discovery",
"sp-consensus-babe",
@@ -6466,6 +6478,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-overseer",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"rand 0.8.4",
"sp-application-crypto",
"sp-core",
@@ -6492,6 +6505,7 @@ dependencies = [
"polkadot-node-subsystem-types",
"polkadot-overseer-gen",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sc-client-api",
"sp-api",
"sp-core",
@@ -6585,6 +6599,16 @@ dependencies = [
"sp-version",
]
[[package]]
name = "polkadot-primitives-test-helpers"
version = "0.9.13"
dependencies = [
"polkadot-primitives",
"sp-application-crypto",
"sp-keyring",
"sp-runtime",
]
[[package]]
name = "polkadot-rpc"
version = "0.9.13"
@@ -6731,6 +6755,7 @@ dependencies = [
"pallet-vesting",
"parity-scale-codec",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"polkadot-runtime-parachains",
"rustc-hex",
"scale-info",
@@ -6776,6 +6801,7 @@ dependencies = [
"pallet-vesting",
"parity-scale-codec",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"rand 0.8.4",
"rand_chacha 0.3.1",
"rustc-hex",
@@ -6968,6 +6994,7 @@ dependencies = [
"polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"sc-keystore",
"sc-network",
"sp-application-crypto",