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

Using AccountId (or Option<AccountId> as the type of a dynamic_params parameter fails parsing #7165

Open
2 tasks done
pandres95 opened this issue Jan 14, 2025 · 0 comments
Open
2 tasks done
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@pandres95
Copy link
Contributor

pandres95 commented Jan 14, 2025

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

Due to the fact that dynamic_params macro only allows for static items, if you do something like this:

#[dynamic_params(RuntimeParameters, pallet_parameters::Parameters::<Runtime>)]
pub mod dynamic_params {
	use super::*;

	#[dynamic_pallet_params]
	#[codec(index = 0)]
	pub mod inflation {
		#[codec(index = 0)
		pub static Account: AccountId = AccountId::from([0u8; 32]);

		// OR THIS

		#[codec(index = 0)
		pub static MaybeAccount: Option<AccountId> = None;
	}
}

The expansion process will fail, with this error:

error[E0119]: conflicting implementations of trait `From<BurnDestinationValue>` for type `core::option::Option<BurnDestinationValue>`
     --> /Users/pandres95/Documents/Virto/Development/Fellowship/runtimes/relay/kusama/src/lib.rs:692:2
      |
  692 |     #[dynamic_pallet_params]
      |     ^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: conflicting implementation in crate `core`:
              - impl<T> From<T> for core::option::Option<T>;
      = note: this error originates in the attribute macro `dynamic_pallet_params` (in Nightly builds, run with -Z macro-backtrace for more info)

Notes

Found in runtimes#511.

@pandres95 pandres95 added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

1 participant