Pallet Pass #1
Triggered via pull request
September 26, 2024 04:44
Status
Failure
Total duration
5m 10s
Artifacts
–
Annotations
17 errors and 8 warnings
mismatched types:
pallets/pass/src/lib.rs#L216
error[E0308]: mismatched types
--> pallets/pass/src/lib.rs:216:38
|
216 | let pass = T::Lookup::lookup(user)?;
| ----------------- ^^^^ expected associated type, found `[u8; 32]`
| |
| arguments to this function are incorrect
|
= note: expected associated type `<<T as frame_system::Config>::Lookup as sp_runtime::traits::StaticLookup>::Source`
found array `[u8; 32]`
help: a method is available that returns `<<T as frame_system::Config>::Lookup as sp_runtime::traits::StaticLookup>::Source`
--> /home/runner/.cargo/git/checkouts/polkadot-sdk-9b4d86516933931c/b788ee6/substrate/primitives/runtime/src/traits.rs:225:2
|
225 | fn unlookup(t: Self::Target) -> Self::Source;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider calling `sp_runtime::traits::StaticLookup::unlookup`
note: associated function defined here
--> /home/runner/.cargo/git/checkouts/polkadot-sdk-9b4d86516933931c/b788ee6/substrate/primitives/runtime/src/traits.rs:223:5
|
223 | fn lookup(s: Self::Source) -> Result<Self::Target, LookupError>;
| ^^^^^^
|
`?` couldn't convert the error to `sp_runtime::DispatchError`:
pallets/pass/src/lib.rs#L173
error[E0277]: `?` couldn't convert the error to `sp_runtime::DispatchError`
--> pallets/pass/src/lib.rs:173:81
|
173 | let device = T::Authenticator::verify_device(&attestation).ok_or(())?;
| ^ the trait `std::convert::From<()>` is not implemented for `sp_runtime::DispatchError`, which is required by `std::result::Result<_, _>: std::ops::FromResidual<std::result::Result<std::convert::Infallible, ()>>`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `std::convert::From<T>`:
`sp_runtime::DispatchError` implements `std::convert::From<&'static str>`
`sp_runtime::DispatchError` implements `std::convert::From<frame_support::error::BadOrigin>`
`sp_runtime::DispatchError` implements `std::convert::From<frame_support::error::LookupError>`
`sp_runtime::DispatchError` implements `std::convert::From<frame_system::Error<T>>`
`sp_runtime::DispatchError` implements `std::convert::From<pallet::Error<T, I>>`
`sp_runtime::DispatchError` implements `std::convert::From<sp_runtime::ArithmeticError>`
`sp_runtime::DispatchError` implements `std::convert::From<sp_runtime::TokenError>`
`sp_runtime::DispatchError` implements `std::convert::From<sp_runtime::TransactionalError>`
= note: required for `std::result::Result<(), sp_runtime::DispatchError>` to implement `std::ops::FromResidual<std::result::Result<std::convert::Infallible, ()>>`
|
this function takes 2 arguments but 1 argument was supplied:
pallets/pass/src/lib.rs#L173
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> pallets/pass/src/lib.rs:173:26
|
173 | let device = T::Authenticator::verify_device(&attestation).ok_or(())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------ argument #1 of type `&<T as pallet::Config<I>>::Authenticator` is missing
|
note: method defined here
--> /home/runner/work/frame-contrib/frame-contrib/traits/authn/src/lib.rs:33:8
|
33 | fn verify_device(&self, attestation: &Self::DeviceAttestation) -> Option<Self::Device> {
| ^^^^^^^^^^^^^
help: provide the argument
|
173 | let device = T::Authenticator::verify_device(/* &<T as pallet::Config<I>>::Authenticator */, &attestation).ok_or(())?;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
mismatched types:
pallets/pass/src/lib.rs#L158
error[E0308]: mismatched types
--> pallets/pass/src/lib.rs:158:40
|
158 | Self::do_add_session(&who, &account_id, duration);
| -------------------- ^^^^^^^^^^^ expected `&<T as Config>::AccountId`, found `&Result<..., ...>`
| |
| arguments to this function are incorrect
|
= note: expected reference `&<T as frame_system::Config>::AccountId`
found reference `&std::result::Result<<T as frame_system::Config>::AccountId, frame_support::error::LookupError>`
note: associated function defined here
--> pallets/pass/src/lib.rs:264:19
|
264 | pub(crate) fn do_add_session(
| ^^^^^^^^^^^^^^
265 | session_key: &T::AccountId,
266 | account_id: &T::AccountId,
| -------------------------
|
no method named `then_some` found for enum `std::option::Option` in the current scope:
pallets/pass/src/lib.rs#L156
error[E0599]: no method named `then_some` found for enum `std::option::Option` in the current scope
--> pallets/pass/src/lib.rs:156:45
|
156 | device.verify_user(&credential).then_some(()).ok_or();
| ^^^^^^^^^
|
help: there is a method `is_some` with a similar name, but with different arguments
--> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:609:5
|
the trait bound `&std::result::Result<<T as frame_system::Config>::AccountId, frame_support::error::LookupError>: parity_scale_codec::EncodeLike<<T as frame_system::Config>::AccountId>` is not satisfied:
pallets/pass/src/lib.rs#L154
error[E0277]: the trait bound `&std::result::Result<<T as frame_system::Config>::AccountId, frame_support::error::LookupError>: parity_scale_codec::EncodeLike<<T as frame_system::Config>::AccountId>` is not satisfied
--> pallets/pass/src/lib.rs:154:47
|
154 | let device = Devices::<T, I>::get(&account_id, &device_id)
| -------------------- ^^^^^^^^^^^ the trait `parity_scale_codec::EncodeLike<<T as frame_system::Config>::AccountId>` is not implemented for `&std::result::Result<<T as frame_system::Config>::AccountId, frame_support::error::LookupError>`
| |
| required by a bound introduced by this call
|
note: required by a bound in `frame_support::pallet_prelude::StorageDoubleMap::<Prefix, Hasher1, Key1, Hasher2, Key2, Value, QueryKind, OnEmpty, MaxValues>::get`
--> /home/runner/.cargo/git/checkouts/polkadot-sdk-9b4d86516933931c/b788ee6/substrate/frame/support/src/storage/types/double_map.rs:240:10
|
238 | pub fn get<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> QueryKind::Query
| --- required by a bound in this associated function
239 | where
240 | KArg1: EncodeLike<Key1>,
| ^^^^^^^^^^^^^^^^ required by this bound in `StorageDoubleMap::<Prefix, Hasher1, Key1, Hasher2, Key2, Value, QueryKind, OnEmpty, MaxValues>::get`
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
110 | impl<T: Config<I>, I: 'static> Pallet<T, I> where &std::result::Result<<T as frame_system::Config>::AccountId, frame_support::error::LookupError>: parity_scale_codec::EncodeLike<<T as frame_system::Config>::AccountId> {
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
the `?` operator can only be applied to values that implement `std::ops::Try`:
pallets/pass/src/lib.rs#L152
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> pallets/pass/src/lib.rs:152:13
|
152 | Self::account_exists(&account_id)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
|
= help: the trait `std::ops::Try` is not implemented for `bool`
|
mismatched types:
pallets/pass/src/lib.rs#L152
error[E0308]: mismatched types
--> pallets/pass/src/lib.rs:152:34
|
152 | Self::account_exists(&account_id)?;
| -------------------- ^^^^^^^^^^^ expected `&<T as Config>::AccountId`, found `&Result<..., ...>`
| |
| arguments to this function are incorrect
|
= note: expected reference `&<T as frame_system::Config>::AccountId`
found reference `&std::result::Result<<T as frame_system::Config>::AccountId, frame_support::error::LookupError>`
note: associated function defined here
--> pallets/pass/src/lib.rs:220:19
|
220 | pub(crate) fn account_exists(who: &T::AccountId) -> bool {
| ^^^^^^^^^^^^^^ ------------------
|
mismatched types:
pallets/pass/src/lib.rs#L151
error[E0308]: mismatched types
--> pallets/pass/src/lib.rs:151:48
|
151 | let account_id = T::Lookup::lookup(credential.user_id());
| ----------------- ^^^^^^^^^^^^^^^^^^^^ expected associated type, found `[u8; 32]`
| |
| arguments to this function are incorrect
|
= note: expected associated type `<<T as frame_system::Config>::Lookup as sp_runtime::traits::StaticLookup>::Source`
found array `[u8; 32]`
= help: consider constraining the associated type `<<T as frame_system::Config>::Lookup as sp_runtime::traits::StaticLookup>::Source` to `[u8; 32]`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
note: associated function defined here
--> /home/runner/.cargo/git/checkouts/polkadot-sdk-9b4d86516933931c/b788ee6/substrate/primitives/runtime/src/traits.rs:223:5
|
223 | fn lookup(s: Self::Source) -> Result<Self::Target, LookupError>;
| ^^^^^^
|
this function takes 2 arguments but 1 argument was supplied:
pallets/pass/src/lib.rs#L125
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> pallets/pass/src/lib.rs:125:26
|
125 | let device = T::Authenticator::verify_device(&attestation)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------ argument #1 of type `&<T as pallet::Config<I>>::Authenticator` is missing
|
note: method defined here
--> /home/runner/work/frame-contrib/frame-contrib/traits/authn/src/lib.rs:33:8
|
33 | fn verify_device(&self, attestation: &Self::DeviceAttestation) -> Option<Self::Device> {
| ^^^^^^^^^^^^^
help: provide the argument
|
125 | let device = T::Authenticator::verify_device(/* &<T as pallet::Config<I>>::Authenticator */, &attestation)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
no variant or associated item named `Success` found for enum `pallet::Event` in the current scope:
pallets/pass/src/benchmarking.rs#L23
error[E0599]: no variant or associated item named `Success` found for enum `pallet::Event` in the current scope
--> pallets/pass/src/benchmarking.rs:23:39
|
23 | assert_last_event::<T>(Event::Success.into());
| ^^^^^^^ variant or associated item not found in `Event<_, _>`
|
::: pallets/pass/src/lib.rs:84:5
|
84 | pub enum Event<T: Config<I>, I: 'static = ()> {
| --------------------------------------------- variant or associated item `Success` not found for this enum
|
function takes 2 generic arguments but 1 generic argument was supplied:
pallets/pass/src/benchmarking.rs#L23
error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied
--> pallets/pass/src/benchmarking.rs:23:9
|
23 | assert_last_event::<T>(Event::Success.into());
| ^^^^^^^^^^^^^^^^^ - supplied 1 generic argument
| |
| expected 2 generic arguments
|
note: function defined here, with 2 generic parameters: `T`, `I`
--> pallets/pass/src/benchmarking.rs:7:4
|
7 | fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
| ^^^^^^^^^^^^^^^^^ - -
help: add missing generic argument
|
23 | assert_last_event::<T, I>(Event::Success.into());
| +++
|
this function takes 2 arguments but 0 arguments were supplied:
pallets/pass/src/benchmarking.rs#L11
error[E0061]: this function takes 2 arguments but 0 arguments were supplied
--> pallets/pass/src/benchmarking.rs:11:1
|
11 | #[benchmarks]
| ^^^^^^^^^^^^^ two arguments of type `[u8; 32]` and `<<T as pallet::Config>::Authenticator as fc_traits_authn::Authenticator>::DeviceAttestation` are missing
|
note: associated function defined here
--> pallets/pass/src/lib.rs:113:16
|
113 | pub fn register(
| ^^^^^^^^
114 | origin: OriginFor<T>,
115 | user: HashedUserId,
| ------------------
116 | attestation: DeviceAttestationOf<T, I>,
| --------------------------------------
= note: this error originates in the attribute macro `benchmarks` (in Nightly builds, run with -Z macro-backtrace for more info)
help: provide the arguments
|
11 | #[benchmarks](/* [u8; 32] */, /* <<T as pallet::Config>::Authenticator as fc_traits_authn::Authenticator>::DeviceAttestation */)
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
failed to resolve: use of undeclared type `RawOrigin`:
pallets/pass/src/benchmarking.rs#L20
error[E0433]: failed to resolve: use of undeclared type `RawOrigin`
--> pallets/pass/src/benchmarking.rs:20:11
|
20 | _(RawOrigin::Root);
| ^^^^^^^^^ use of undeclared type `RawOrigin`
|
help: consider importing one of these enums
|
13 + use frame_support::dispatch::RawOrigin;
|
13 + use frame_system::RawOrigin;
|
|
check
Process completed with exit code 101.
|
clippy
Clippy had exited with the 101 exit code
|
test
Process completed with exit code 101.
|
duplicated attribute:
pallets/template/src/benchmarking.rs#L1
warning: duplicated attribute
--> pallets/template/src/benchmarking.rs:1:8
|
1 | #![cfg(feature = "runtime-benchmarks")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first defined here
--> pallets/template/src/lib.rs:10:7
|
10 | #[cfg(feature = "runtime-benchmarks")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: remove this attribute
--> pallets/template/src/benchmarking.rs:1:8
|
1 | #![cfg(feature = "runtime-benchmarks")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
= note: `#[warn(clippy::duplicated_attributes)]` on by default
|
using `map_err` over `inspect_err`:
pallets/gas-transaction-payment/src/lib.rs#L32
warning: using `map_err` over `inspect_err`
--> pallets/gas-transaction-payment/src/lib.rs:32:15
|
32 | #[pallet::pallet]
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
= note: `#[warn(clippy::manual_inspect)]` on by default
help: try
|
32 - #[pallet::pallet]
32 + #[pallet::&inspect_err]
|
|
using `clone` on type `DispatchInfo` which implements the `Copy` trait:
pallets/gas-transaction-payment/src/extensions.rs#L120
warning: using `clone` on type `DispatchInfo` which implements the `Copy` trait
--> pallets/gas-transaction-payment/src/extensions.rs:120:22
|
120 | &info.clone().into(),
| ^^^^^^^^^^^^ help: try dereferencing it: `(*info)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
useless conversion to the same type: `frame_support::dispatch::DispatchInfo`:
pallets/gas-transaction-payment/src/extensions.rs#L120
warning: useless conversion to the same type: `frame_support::dispatch::DispatchInfo`
--> pallets/gas-transaction-payment/src/extensions.rs:120:22
|
120 | &info.clone().into(),
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `info.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
redundant pattern matching, consider using `is_some()`:
pallets/gas-transaction-payment/src/extensions.rs#L102
warning: redundant pattern matching, consider using `is_some()`
--> pallets/gas-transaction-payment/src/extensions.rs:102:16
|
102 | if let Some(_) = T::GasBurner::check_available_gas(who, &info.weight) {
| -------^^^^^^^------------------------------------------------------- help: try: `if T::GasBurner::check_available_gas(who, &info.weight).is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
|
`self.0.saturating_sub(n.get())` is never smaller than `Self::MIN.0` and has therefore no effect:
traits/memberships/src/lib.rs#L98
warning: `self.0.saturating_sub(n.get())` is never smaller than `Self::MIN.0` and has therefore no effect
--> traits/memberships/src/lib.rs:98:14
|
98 | Self(self.0.saturating_sub(n.get()).max(Self::MIN.0))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.0.saturating_sub(n.get())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_min_or_max
= note: `#[warn(clippy::unnecessary_min_or_max)]` on by default
|
clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
clippy
The following actions use a deprecated Node.js version and will be forced to run on node20: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|