You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code is not tested, it is also not documented. Should we simply drop it or fix it?
Yes, @gui1117 we can go ahead and drop it. This was added by Sam, as the requirements were not completely clear at the time. Later, when the macros were implemented, it was left under the assumption that the manual specification still worked. But, I don't think its worthwhile spending the time to fix it.
TLDR:
there is some code to handle manual definition of tasks. But the code is wrong AFAICT, not tested, and not documented. Should we fix it or drop it?
Details:
In
pallet
macro, there is some specific code to retrieve an item like the following, without any explicit attribute:The code is here:
polkadot-sdk/substrate/frame/support/procedural/src/pallet/parse/mod.rs
Lines 296 to 352 in 21b3a46
But writing such code fails to compile, the macro panics.
Because the item is removed from input, then expanded here:
polkadot-sdk/substrate/frame/support/procedural/src/pallet/expand/tasks.rs
Line 118 in 21b3a46
Then parsed again but as 2 items:
polkadot-sdk/substrate/frame/support/procedural/src/pallet/expand/tasks.rs
Line 241 in 21b3a46
so it fails to compile with
End of input, expect token impl
.This code is not tested, it is also not documented. Should we simply drop it or fix it?
If we want to fix it I suggest a new attribute which just check that it declares an enum with the name
Task
and sensible generics:The text was updated successfully, but these errors were encountered: