5

I have substrate node template with babe and i want to integrate orml-currencies.

I'm using this in cargo.toml:

orml-currencies = { default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v1.0.0" }

Then I'm getting this error:

--> /Users/deepak/.cargo/git/checkouts/open-runtime-module-library-d3634ee624a28945/6819d3f/tokens/src/lib.rs:433:18
      |
  433 |     impl<T: Config> GenesisBuild<T> for GenesisConfig<T> {
      |                     ^^^^^^^^^^^^ not found in this scope
      |
  help: consider importing this trait
      |
  179 +     use frame_support::traits::GenesisBuild;
      |

  error[E0220]: associated type `BlockNumber` not found for `T`
      --> /Users/deepak/.cargo/git/checkouts/open-runtime-module-library-d3634ee624a28945/6819d3f/tokens/src/lib.rs:1277:19
       |
  1277 |     type Moment = T::BlockNumber;
       |                      ^^^^^^^^^^^ there is a similarly named associated type `BlockNumber` in the trait `BlockNumberProvider`

  error[E0220]: associated type `BlockNumber` not found for `T`
      --> /Users/deepak/.cargo/git/checkouts/open-runtime-module-library-d3634ee624a28945/6819d3f/tokens/src/lib.rs:2403:19
       |
  2403 |     type Moment = T::BlockNumber;
       |                      ^^^^^^^^^^^ there is a similarly named associated type `BlockNumber` in the trait `BlockNumberProvider`

How to solve this issue?

Thanks in advance!

1 Answer 1

3

According to the Polkadot Release Analysis v1.0.0, GenesisBuild has been has been deprecated in favor of BuildGenesisConfig. Here is an example of how to use:

#[pallet::genesis_config]
#[derive(frame_support::DefaultNoBound)]
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
     _config: sp_std::marker::PhantomData<(T,I)>,
    _myfield: u32,
}
    
#[pallet::genesis_build]
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
    fn build(&self) {}
}

I believe there was a change with BlockNumber as well:

I believe you can use BlockNumberFor<T> instead of BlockNumber.

You can reference the Cumulus PR for examples:

2
  • Thank you for the support. But I'm not able to understand where I need to implement this genesisConfig or BlockNumberFor? I just want to integrate the orml pallets in our project and when I add this in cargo.toml, I'm getting error. Can you please elaborate the solution more? Sep 30, 2023 at 9:10
  • The best help I can give you is to check out the associated Cumulus PRs for each of these PRs. They show concrete examples of what changes you would need to make in your node.
    – Bruno
    Oct 1, 2023 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.