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(api/nonfungibles): pallet + devnet runtime #339

Closed

Merge remote-tracking branch 'refs/remotes/origin/chungquantin/feat-n…

dcb4e33
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Closed

feat(api/nonfungibles): pallet + devnet runtime #339

Merge remote-tracking branch 'refs/remotes/origin/chungquantin/feat-n…
dcb4e33
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy failed Nov 19, 2024 in 6s

clippy

15 errors, 345 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 15
Warning 345
Note 0
Help 0

Versions

  • rustc 1.82.0 (f6e511eec 2024-10-15)
  • cargo 1.82.0 (8f40fc59f 2024-08-21)
  • clippy 0.1.82 (f6e511e 2024-10-15)

Annotations

Check failure on line 327 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 3 arguments but 5 arguments were supplied

error[E0061]: this function takes 3 arguments but 5 arguments were supplied
   --> pallets/api/src/nonfungibles/mod.rs:327:20
    |
327 |         #[pallet::weight(NftsWeightInfoOf::<T>::destroy(
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
331 |             witness.item_holders,
    |             -------------------- unexpected argument #4
332 |             witness.allowances,
    |             ------------------ unexpected argument #5
    |
note: associated function defined here
   --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/weights.rs:56:5
    |
56  |     fn destroy(m: u32, c: u32, a: u32, ) -> Weight;
    |        ^^^^^^^
help: remove the extra arguments
    |
330 -             witness.attributes,
331 -             witness.item_holders,
330 +             witness.attributes,
    |

Check failure on line 332 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no field `allowances` on type `&pallet_nfts::DestroyWitness`

error[E0609]: no field `allowances` on type `&pallet_nfts::DestroyWitness`
   --> pallets/api/src/nonfungibles/mod.rs:332:21
    |
332 |             witness.allowances,
    |                     ^^^^^^^^^^ unknown field
    |
    = note: available fields are: `item_metadatas`, `item_configs`, `attributes`

Check failure on line 331 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no field `item_holders` on type `&pallet_nfts::DestroyWitness`

error[E0609]: no field `item_holders` on type `&pallet_nfts::DestroyWitness`
   --> pallets/api/src/nonfungibles/mod.rs:331:21
    |
331 |             witness.item_holders,
    |                     ^^^^^^^^^^^^ unknown field
    |
    = note: available fields are: `item_metadatas`, `item_configs`, `attributes`

Check failure on line 258 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 0 arguments but 1 argument was supplied

error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> pallets/api/src/nonfungibles/mod.rs:258:7
    |
258 |             NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------------- unexpected argument of type `u32`
    |
note: associated function defined here
   --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/weights.rs:80:5
    |
80  |     fn cancel_approval() -> Weight;
    |        ^^^^^^^^^^^^^^^
help: remove the extra argument
    |
258 -             NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32)
258 +             NftsWeightInfoOf::<T>::cancel_approval()
    |

Check failure on line 257 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 0 arguments but 1 argument was supplied

error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> pallets/api/src/nonfungibles/mod.rs:257:13
    |
257 |             NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32) +
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------------- unexpected argument of type `u32`
    |
note: associated function defined here
   --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/weights.rs:79:5
    |
79  |     fn approve_transfer() -> Weight;
    |        ^^^^^^^^^^^^^^^^
help: remove the extra argument
    |
257 -             NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32) +
257 +             NftsWeightInfoOf::<T>::approve_transfer() +
    |

Check failure on line 583 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no function or associated item named `item_metadata` found for struct `pallet_nfts::Pallet` in the current scope

error[E0599]: no function or associated item named `item_metadata` found for struct `pallet_nfts::Pallet` in the current scope
   --> pallets/api/src/nonfungibles/mod.rs:583:19
    |
583 |                     NftsOf::<T>::item_metadata(collection, item).map(|metadata| metadata.into()),
    |                                  ^^^^^^^^^^^^^ function or associated item not found in `Pallet<T, <T as Config>::NftsInstance>`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `nonfungibles::weights::WeightInfo` defines an item `item_metadata`, perhaps you need to implement it
   --> pallets/api/src/nonfungibles/weights.rs:34:1
    |
34  | pub trait WeightInfo {
    | ^^^^^^^^^^^^^^^^^^^^
help: there is an associated function `set_item_metadata` with a similar name
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frame-support-36.0.0/src/traits/tokens/nonfungibles_v2.rs:316:2
    |
316 | /     fn set_item_metadata(
317 | |         _who: Option<&AccountId>,
318 | |         _collection: &Self::CollectionId,
319 | |         _item: &Self::ItemId,
320 | |         _data: &[u8],
321 | |     ) -> DispatchResult {
    | |_______________________^

Check failure on line 572 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no function or associated item named `check_allowance` found for struct `pallet_nfts::Pallet` in the current scope

error[E0599]: no function or associated item named `check_allowance` found for struct `pallet_nfts::Pallet` in the current scope
   --> pallets/api/src/nonfungibles/mod.rs:572:19
    |
572 |                     NftsOf::<T>::check_allowance(&collection, &item, &owner, &operator).is_ok(),
    |                                  ^^^^^^^^^^^^^^^ function or associated item not found in `Pallet<T, <T as Config>::NftsInstance>`

Check failure on line 567 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no function or associated item named `collection_items` found for struct `pallet_nfts::Pallet` in the current scope

error[E0599]: no function or associated item named `collection_items` found for struct `pallet_nfts::Pallet` in the current scope
   --> pallets/api/src/nonfungibles/mod.rs:567:19
    |
567 |                     NftsOf::<T>::collection_items(collection).unwrap_or_default() as u128,
    |                                  ^^^^^^^^^^^^^^^^ function or associated item not found in `Pallet<T, <T as Config>::NftsInstance>`
    |
help: there is an associated function `collections` with a similar name
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frame-support-36.0.0/src/traits/tokens/nonfungibles_v2.rs:171:2
    |
171 |     fn collections() -> Self::CollectionsIterator;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 290 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 0 arguments but 1 argument was supplied

error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> pallets/api/src/nonfungibles/mod.rs:290:5
    |
290 |                 NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------------- unexpected argument of type `u32`
    |
note: associated function defined here
   --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/weights.rs:80:5
    |
80  |     fn cancel_approval() -> Weight;
    |        ^^^^^^^^^^^^^^^
help: remove the extra argument
    |
290 -                 NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32)
290 +                 NftsWeightInfoOf::<T>::cancel_approval()
    |

Check failure on line 288 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 0 arguments but 1 argument was supplied

error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> pallets/api/src/nonfungibles/mod.rs:288:20
    |
288 |                     e.with_weight(NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32))
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------------- unexpected argument of type `u32`
    |
note: associated function defined here
   --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/weights.rs:80:5
    |
80  |     fn cancel_approval() -> Weight;
    |        ^^^^^^^^^^^^^^^
help: remove the extra argument
    |
288 -                     e.with_weight(NftsWeightInfoOf::<T>::cancel_approval(item.is_some() as u32))
288 +                     e.with_weight(NftsWeightInfoOf::<T>::cancel_approval())
    |

Check failure on line 284 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

mismatched types

error[E0308]: mismatched types
    --> pallets/api/src/nonfungibles/mod.rs:284:6
     |
281  |                 NftsOf::<T>::cancel_approval(
     |                 ---------------------------- arguments to this function are incorrect
...
284  |                     item,
     |                     ^^^^ expected associated type, found `Option<<T as Config<...>>::ItemId>`
     |
     = note: expected associated type `<T as pallet_nfts::Config<<T as nonfungibles::pallet::Config>::NftsInstance>>::ItemId`
                           found enum `std::option::Option<<T as pallet_nfts::Config<<T as nonfungibles::pallet::Config>::NftsInstance>>::ItemId>`
note: associated function defined here
    --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/lib.rs:1328:10
     |
1328 |         pub fn cancel_approval(
     |                ^^^^^^^^^^^^^^^
help: consider using `Option::expect` to unwrap the `std::option::Option<<T as pallet_nfts::Config<<T as nonfungibles::pallet::Config>::NftsInstance>>::ItemId>` value, panicking if the value is an `Option::None`
     |
284  |                     item.expect("REASON"),
     |                         +++++++++++++++++

Check failure on line 279 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 0 arguments but 1 argument was supplied

error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> pallets/api/src/nonfungibles/mod.rs:279:5
    |
279 |                 NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------------- unexpected argument of type `u32`
    |
note: associated function defined here
   --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/weights.rs:79:5
    |
79  |     fn approve_transfer() -> Weight;
    |        ^^^^^^^^^^^^^^^^
help: remove the extra argument
    |
279 -                 NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32)
279 +                 NftsWeightInfoOf::<T>::approve_transfer()
    |

Check failure on line 277 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 0 arguments but 1 argument was supplied

error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> pallets/api/src/nonfungibles/mod.rs:277:20
    |
277 |                     e.with_weight(NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32))
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------------- unexpected argument of type `u32`
    |
note: associated function defined here
   --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/weights.rs:79:5
    |
79  |     fn approve_transfer() -> Weight;
    |        ^^^^^^^^^^^^^^^^
help: remove the extra argument
    |
277 -                     e.with_weight(NftsWeightInfoOf::<T>::approve_transfer(item.is_some() as u32))
277 +                     e.with_weight(NftsWeightInfoOf::<T>::approve_transfer())
    |

Check failure on line 272 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

mismatched types

error[E0308]: mismatched types
    --> pallets/api/src/nonfungibles/mod.rs:272:6
     |
269  |                 NftsOf::<T>::approve_transfer(
     |                 ----------------------------- arguments to this function are incorrect
...
272  |                     item,
     |                     ^^^^ expected associated type, found `Option<<T as Config<...>>::ItemId>`
     |
     = note: expected associated type `<T as pallet_nfts::Config<<T as nonfungibles::pallet::Config>::NftsInstance>>::ItemId`
                           found enum `std::option::Option<<T as pallet_nfts::Config<<T as nonfungibles::pallet::Config>::NftsInstance>>::ItemId>`
note: associated function defined here
    --> /home/runner/work/pop-node/pop-node/pallets/nfts/src/lib.rs:1292:10
     |
1292 |         pub fn approve_transfer(
     |                ^^^^^^^^^^^^^^^^
help: consider using `Option::expect` to unwrap the `std::option::Option<<T as pallet_nfts::Config<<T as nonfungibles::pallet::Config>::NftsInstance>>::ItemId>` value, panicking if the value is an `Option::None`
     |
272  |                     item.expect("REASON"),
     |                         +++++++++++++++++

Check failure on line 40 in pallets/api/src/nonfungibles/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find type `AccountBalance` in crate `pallet_nfts`

error[E0412]: cannot find type `AccountBalance` in crate `pallet_nfts`
  --> pallets/api/src/nonfungibles/mod.rs:40:52
   |
40 | pub(super) type AccountBalanceOf<T> = pallet_nfts::AccountBalance<T, NftsInstanceOf<T>>;
   |                                                    ^^^^^^^^^^^^^^ not found in `pallet_nfts`

Check warning on line 595 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:595:4
    |
595 |             value: BoundedVec<u8, T::ValueLimit>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 594 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:594:4
    |
594 |             attribute: PalletAttributes<T::CollectionId>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 593 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:593:4
    |
593 |             item: Option<T::ItemId>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 592 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:592:4
    |
592 |             collection: T::CollectionId,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 587 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:587:4
    |
587 |             namespace: AttributeNamespace<T::AccountId>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 586 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:586:4
    |
586 |             item: T::ItemId,
    |             ^^^^^^^^^^^^^^^

Check warning on line 585 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:585:4
    |
585 |             collection: T::CollectionId,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 581 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:581:4
    |
581 |             deadline: BlockNumberFor<T>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 580 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:580:4
    |
580 |             price: Option<PriceWithDirection<ItemPrice<T, I>>>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 579 in pallets/nfts/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a struct field

warning: missing documentation for a struct field
   --> pallets/nfts/src/lib.rs:579:4
    |
579 |             received_item_owner: T::AccountId,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^