diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bb2a1ec8cc7..d9345a3e237 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -59,10 +59,6 @@ jobs: steps: - uses: actions/checkout@v2 - run: | - /home/runner/.cargo/bin/rustup install nightly-2021-11-29 - /home/runner/.cargo/bin/rustup target add --toolchain=nightly-2021-11-29 wasm32-unknown-unknown - /home/runner/.cargo/bin/rustup show - /home/runner/.cargo/bin/rustup override unset /home/runner/.cargo/bin/rustup show - name: Use Node.js 14.x uses: actions/setup-node@v2 @@ -70,7 +66,7 @@ jobs: node-version: 14.x - name: Cargo fmt run: | - /home/runner/.cargo/bin/cargo +nightly-2021-11-29 fmt -- --check + /home/runner/.cargo/bin/cargo fmt -- --check - name: Hadolint env: HADOLINT_VERSION: v2.8.0 @@ -101,7 +97,7 @@ jobs: exit $total_exit_code - name: Cargo clippy run: | - SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 clippy -- -D warnings + SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo clippy --workspace -- -D warnings - name: Cargo udeps env: UDEPS_VERSION: v0.1.24 @@ -110,8 +106,8 @@ jobs: tar xzf "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu.tar.gz" cp "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu/cargo-udeps" ~/.cargo/bin/ rm -r "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu.tar.gz" "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu" - /home/runner/.cargo/bin/cargo +nightly-2021-11-29 udeps --version - SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 udeps --workspace --all-features + /home/runner/.cargo/bin/cargo udeps --version + SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo udeps --workspace --all-features continue-on-error: true # Often this turns gives false positives, due to the different ways that Substrate uses features. test: name: Unit Test @@ -126,9 +122,7 @@ jobs: run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin - name: Run Test (with coverage) run: | - /home/runner/.cargo/bin/rustup install nightly-2021-11-29 - /home/runner/.cargo/bin/rustup component add llvm-tools-preview --toolchain=nightly-2021-11-29 - SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 llvm-cov --workspace --lcov --output-path lcov.info + SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo llvm-cov --workspace --lcov --output-path lcov.info - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: diff --git a/.gitignore b/.gitignore index ec7eb027bd5..86358153965 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ scripts/polkadot-launch/*.log target .env +**/.yarn/ \ No newline at end of file diff --git a/frame/composable-support/src/validation.rs b/frame/composable-support/src/validation.rs index 3da85f37f74..fbb98aaf147 100644 --- a/frame/composable-support/src/validation.rs +++ b/frame/composable-support/src/validation.rs @@ -55,8 +55,7 @@ impl + Validate, U, V> Validate<(U, V)> for T { impl, U, V> codec::Decode for Validated { fn decode(input: &mut I) -> Result { - let value = Validate::validate(T::decode(input)?) - .map_err(|desc| Into::::into(desc))?; + let value = Validate::validate(T::decode(input)?).map_err(Into::::into)?; Ok(Validated { value, _marker: PhantomData }) } fn skip(input: &mut I) -> Result<(), codec::Error> { diff --git a/integration-tests/simnode/src/events.rs b/integration-tests/simnode/src/events.rs index a840517e3dd..fa324d2327b 100644 --- a/integration-tests/simnode/src/events.rs +++ b/integration-tests/simnode/src/events.rs @@ -1,4 +1,5 @@ /// Concrete event type for verbose event asserts in tests. +#[allow(clippy::large_enum_variant)] #[derive(derive_more::From)] pub enum AllRuntimeEvents { /// Picassoo runtime events diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000000..577b8b21008 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "nightly-2021-11-29" +components = [ "rustfmt", "rustc", "rust-std", "cargo", "clippy", "llvm-tools-preview"] +targets = [ "wasm32-unknown-unknown" ] +profile = "minimal" \ No newline at end of file