Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Kreivo APIs for Contracts #445

Merged
merged 7 commits into from
Jan 27, 2025

fix: fmt

c053d1a
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

feat: Kreivo APIs for Contracts #445

fix: fmt
c053d1a
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Jan 27, 2025 in 0s

clippy

37 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 37
Note 0
Help 0

Versions

  • rustc 1.84.0 (9fc6b4312 2025-01-07)
  • cargo 1.84.0 (66221abde 2024-11-19)
  • clippy 0.1.84 (9fc6b43126 2025-01-07)

Annotations

Check warning on line 19 in runtime/kreivo/src/config/contracts/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

match expression looks like `matches!` macro

warning: match expression looks like `matches!` macro
  --> runtime/kreivo/src/config/contracts/mod.rs:16:3
   |
16 | /         match call {
17 | |             RuntimeCall::Balances(BalancesCall::transfer_allow_death { .. }) | RuntimeCall::Assets(_) => true,
18 | |             _ => false,
19 | |         }
   | |_________^ help: try: `matches!(call, RuntimeCall::Balances(BalancesCall::transfer_allow_death { .. }) | RuntimeCall::Assets(_))`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
   = note: `#[warn(clippy::match_like_matches_macro)]` on by default

Check warning on line 26 in runtime/kreivo/src/config/governance/origins.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `map_err` over `inspect_err`

warning: using `map_err` over `inspect_err`
  --> runtime/kreivo/src/config/governance/origins.rs:26:12
   |
26 |     #[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
   |
26 -     #[pallet::pallet]
26 +     #[pallet::&inspect_err]
   |

Check warning on line 35 in runtime/kreivo/src/config/communities/governance.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `u16` which implements the `Copy` trait

warning: using `clone` on type `u16` which implements the `Copy` trait
  --> runtime/kreivo/src/config/communities/governance.rs:35:49
   |
35 |         Ok(pallet_communities::Origin::<Runtime>::new(id.clone()).into())
   |                                                       ^^^^^^^^^^ help: try dereferencing it: `*id`
   |
   = 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

Check warning on line 87 in runtime/kreivo/src/benchmarking/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

warning: this operation has no effect
  --> runtime/kreivo/src/benchmarking/impls.rs:87:18
   |
87 |             fun: Fungible(1 * UNITS),
   |                           ^^^^^^^^^ help: consider reducing it to: `UNITS`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check warning on line 89 in runtime/kreivo/src/benchmarking/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `cumulus_primitives_core::Asset`

warning: useless conversion to the same type: `cumulus_primitives_core::Asset`
  --> runtime/kreivo/src/benchmarking/impls.rs:85:3
   |
85 | /         Asset {
86 | |             id: AssetId(RelayLocation::get()),
87 | |             fun: Fungible(1 * UNITS),
88 | |         }
89 | |         .into()
   | |_______________^
   |
   = 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
help: consider removing `.into()`
   |
85 ~         Asset {
86 ~             id: AssetId(RelayLocation::get()),
87 ~             fun: Fungible(1 * UNITS),
88 ~         }
   |

Check warning on line 71 in runtime/kreivo/src/benchmarking/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

warning: this operation has no effect
  --> runtime/kreivo/src/benchmarking/impls.rs:71:25
   |
71 |         Asset { fun: Fungible(1 * UNITS), id: AssetId(RelayLocation::get()) },
   |                               ^^^^^^^^^ help: consider reducing it to: `UNITS`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
   = note: `#[warn(clippy::identity_op)]` on by default

Check warning on line 20 in apis/src/runtime/assets.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> apis/src/runtime/assets.rs:20:3
   |
20 |         &self.1
   |         ^^^^^^^ help: change this to: `self.1`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 37 in apis/src/apis/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
  --> apis/src/apis/error.rs:37:39
   |
37 |             KreivoApisError::Assets(e) => Self(1u32 << 16 | e as u16 as u32),
   |                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(1u32 << 16) | e as u16 as u32`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
   = note: `#[warn(clippy::precedence)]` on by default

Check warning on line 113 in pallets/communities-manager/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `map_err` over `inspect_err`

warning: using `map_err` over `inspect_err`
   --> pallets/communities-manager/src/lib.rs:113:12
    |
113 |     #[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
    |
113 -     #[pallet::pallet]
113 +     #[pallet::&inspect_err]
    |

Check warning on line 272 in /home/runner/.cargo/git/checkouts/polkadot-sdk-3d4658ffc5e737d7/d13cf29/polkadot/runtime/common/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `fast-runtime`

warning: unexpected `cfg` condition value: `fast-runtime`
  --> runtime/runtime-constants/src/lib.rs:60:51
   |
60 |     pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(HOURS, MINUTES);
   |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`, `paseo`, and `std`
   = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
   = help: try referring to `prod_or_fast` crate for guidance on how handle this unexpected cfg
   = help: the macro `prod_or_fast` may come from an old version of the `polkadot_runtime_common` crate, try updating your dependency with `cargo update -p polkadot_runtime_common`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default
   = note: this warning originates in the macro `prod_or_fast` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 569 in pallets/communities/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`

warning: useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`
   --> pallets/communities/src/lib.rs:569:29
    |
569 |         pub fn dispatch_as_account(origin: OriginFor<T>, call: Box<RuntimeCallFor<T>>) -> DispatchResultWithPostInfo {
    |                                   ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 569 in pallets/communities/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`

warning: useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`
   --> pallets/communities/src/lib.rs:569:29
    |
569 |         pub fn dispatch_as_account(origin: OriginFor<T>, call: Box<RuntimeCallFor<T>>) -> DispatchResultWithPostInfo {
    |                                   ^ help: consider removing
    |
    = 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

Check warning on line 151 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `map_err` over `inspect_err`

warning: using `map_err` over `inspect_err`
   --> pallets/payments/src/lib.rs:151:12
    |
151 |     #[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
    |
151 -     #[pallet::pallet]
151 +     #[pallet::&inspect_err]
    |

Check warning on line 492 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`

warning: useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`
   --> pallets/payments/src/lib.rs:492:25
    |
492 |         pub fn resolve_dispute(
    |                               ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 492 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`

warning: useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`
   --> pallets/payments/src/lib.rs:492:25
    |
492 |         pub fn resolve_dispute(
    |                               ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 466 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`

warning: useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`
   --> pallets/payments/src/lib.rs:466:25
    |
466 |         pub fn request_payment(
    |                               ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 466 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`

warning: useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`
   --> pallets/payments/src/lib.rs:466:25
    |
466 |         pub fn request_payment(
    |                               ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 427 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`

warning: useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`
   --> pallets/payments/src/lib.rs:427:24
    |
427 |         pub fn dispute_refund(origin: OriginFor<T>, payment_id: T::PaymentId) -> DispatchResultWithPostInfo {
    |                              ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 427 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`

warning: useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`
   --> pallets/payments/src/lib.rs:427:24
    |
427 |         pub fn dispute_refund(origin: OriginFor<T>, payment_id: T::PaymentId) -> DispatchResultWithPostInfo {
    |                              ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 396 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`

warning: useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`
   --> pallets/payments/src/lib.rs:396:16
    |
396 |         pub fn cancel(origin: OriginFor<T>, payment_id: T::PaymentId) -> DispatchResultWithPostInfo {
    |                      ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 396 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`

warning: useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`
   --> pallets/payments/src/lib.rs:396:16
    |
396 |         pub fn cancel(origin: OriginFor<T>, payment_id: T::PaymentId) -> DispatchResultWithPostInfo {
    |                      ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 358 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`

warning: useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`
   --> pallets/payments/src/lib.rs:358:24
    |
358 |         pub fn accept_and_pay(origin: OriginFor<T>, payment_id: T::PaymentId) -> DispatchResultWithPostInfo {
    |                              ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 358 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`

warning: useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`
   --> pallets/payments/src/lib.rs:358:24
    |
358 |         pub fn accept_and_pay(origin: OriginFor<T>, payment_id: T::PaymentId) -> DispatchResultWithPostInfo {
    |                              ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 321 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`

warning: useless conversion to the same type: `frame_support::dispatch::PostDispatchInfo`
   --> pallets/payments/src/lib.rs:321:24
    |
321 |         pub fn request_refund(origin: OriginFor<T>, payment_id: T::PaymentId) -> DispatchResultWithPostInfo {
    |                              ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 321 in pallets/payments/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`

warning: useless conversion to the same type: `sp_runtime::DispatchErrorWithPostInfo<frame_support::dispatch::PostDispatchInfo>`
   --> pallets/payments/src/lib.rs:321:24
    |
321 |         pub fn request_refund(origin: OriginFor<T>, payment_id: T::PaymentId) -> DispatchResultWithPostInfo {
    |                              ^ help: consider removing
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion