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

Upgrading to polkadot-0.9.37 packages some deprecation errors need handling #8

Open
decentration opened this issue Feb 7, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@decentration
Copy link
Contributor

decentration commented Feb 7, 2023

git checkout kab-release-v0.2.6

mostly for pallet/relay_schedule

breaking changes related to handling of weights

  --- stderr
     Compiling pallet-relay_schedule v1.0.0 (/Users/ramsey/decentration/parachain/pallets/relay_schedule)
  warning: use of deprecated struct `pallet::warnings::schedule`: 
                       Implicit call indices are deprecated in favour of explicit ones.
                       Please ensure that all calls have the `pallet::call_index` attribute or that the
                       `dev-mode` of the pallet is enabled. For more info see:
                       <https://github.com/paritytech/substrate/pull/12891> and
                       <https://github.com/paritytech/substrate/pull/11381>.
     --> /Users/ramsey/decentration/parachain/pallets/relay_schedule/src/lib.rs:106:10
      |
  106 |         pub fn schedule(origin: OriginFor<T>, call: Box<<T as Config>::Call>) -> DispatchResult {
      |                ^^^^^^^^
      |
      = note: `#[warn(deprecated)]` on by default

  warning: use of deprecated struct `pallet::warnings::set_at_block_number`: 
                       Implicit call indices are deprecated in favour of explicit ones.
                       Please ensure that all calls have the `pallet::call_index` attribute or that the
                       `dev-mode` of the pallet is enabled. For more info see:
                       <https://github.com/paritytech/substrate/pull/12891> and
                       <https://github.com/paritytech/substrate/pull/11381>.
     --> /Users/ramsey/decentration/parachain/pallets/relay_schedule/src/lib.rs:124:10
      |
  124 |         pub fn set_at_block_number(origin: OriginFor<T>, block: u32) -> DispatchResult {
      |                ^^^^^^^^^^^^^^^^^^^

  error[E0308]: mismatched types
    --> /Users/ramsey/decentration/parachain/pallets/relay_schedule/src/lib.rs:62:29
     |
  62 |             let mut weight: Weight = 0;
     |                             ------   ^ expected `Weight`, found integer
     |                             |
     |                             expected due to this

  error[E0369]: binary operation `>=` cannot be applied to type `frame_support::dispatch::Weight`
    --> /Users/ramsey/decentration/parachain/pallets/relay_schedule/src/lib.rs:87:18
     |
  87 | ...                   if weight >= T::MaxBlockWeight::get() / 100 {
     |                          ------ ^^ ------------------------------ frame_support::dispatch::Weight
     |                          |
     |                          frame_support::dispatch::Weight

  error[E0277]: cannot add `frame_support::dispatch::Weight` to `{integer}`
     --> /Users/ramsey/decentration/parachain/pallets/relay_schedule/src/lib.rs:105:27
      |
  105 |         #[pallet::weight(10_000 + T::DbWeight::get().writes(1))]
      |                                 ^ no implementation for `{integer} + frame_support::dispatch::Weight`
      |
      = help: the trait `Add<frame_support::dispatch::Weight>` is not implemented for `{integer}`
      = help: the following other types implement trait `Add<Rhs>`:
                <&'a f32 as Add<f32>>
                <&'a f64 as Add<f64>>
                <&'a i128 as Add<i128>>
                <&'a i16 as Add<i16>>
                <&'a i32 as Add<i32>>
                <&'a i64 as Add<i64>>
                <&'a i8 as Add<i8>>
                <&'a isize as Add<isize>>
              and 48 others

  Some errors have detailed explanations: E0277, E0308, E0369.
  For more information about an error, try `rustc --explain E0277`.
  warning: `pallet-relay_schedule` (lib) generated 2 warnings
  error: could not compile `pallet-relay_schedule` due to 3 previous errors; 2 warnings emitted

Here is the Weights docs

  • May have to use their no_std math operations
  • WeightInfo and weights may need to be added
@decentration decentration added the bug Something isn't working label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants