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

HoldReason composite enum in instatiable pallets #1839

Closed
gpestana opened this issue Oct 10, 2023 · 0 comments · Fixed by #1857
Closed

HoldReason composite enum in instatiable pallets #1839

gpestana opened this issue Oct 10, 2023 · 0 comments · Fixed by #1857
Assignees
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@gpestana
Copy link
Contributor

There seems to be a problem with the HoldReason composite enum when the pallet can have multiple instances in the runtime. Given that the composite enum is implemented with a macro, the compilation error is not very helpful:

  warning: `pallet-contracts` (lib) generated 1 warning (run `cargo fix --lib -p pallet-contracts` to apply 1 suggestion)
  error[E0119]: conflicting implementations of trait `From<pallet_referenda::HoldReason>` for type `RuntimeHoldReason`
      --> /Users/gpestana/parity/polkadot-sdk/substrate/bin/node/runtime/src/lib.rs:2057:1
       |
  652  |   |     type Reward = (); // rewards are minted from the void
       |   |         ^
       |   |         |
       |   |_________first implementation here
       |             conflicting implementation for `RuntimeHoldReason`
  ...
  2057 | / / construct_runtime!(
  2058 | |       pub struct Runtime

This PR #1785 is a good place to reproduce the error.

@gpestana gpestana added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Oct 10, 2023
@gupnik gupnik self-assigned this Oct 10, 2023
gupnik added a commit that referenced this issue Oct 13, 2023
Fixes #1839

Currently, `composite_enum`s do not support pallet instances. This PR
allows the following:
```rust
	#[pallet::composite_enum]
	pub enum HoldReason<I: 'static = ()> {
		SomeHoldReason
	}
```

### Todo

- [x]  UI Test
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this issue Mar 25, 2024
Fixes paritytech#1839

Currently, `composite_enum`s do not support pallet instances. This PR
allows the following:
```rust
	#[pallet::composite_enum]
	pub enum HoldReason<I: 'static = ()> {
		SomeHoldReason
	}
```

### Todo

- [x]  UI Test
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 26, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 27, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants