paritytech / parity-common

Collection of crates used in Parity projects
https://www.paritytech.io/
Apache License 2.0
290 stars 218 forks source link

Define and implement the Incrementable trait for uints #840

Closed Moliholy closed 7 months ago

Moliholy commented 7 months ago

Currently the Incrementable trait is defined in frame-support and only used in asset-conversion and nfts. This prevents types like U256 to be used in such pallets, which is particularly inconvenient when facing Ethereum compatibility.

This PR redefines the Incrementable trait and implements it for uints, with the intention remove it from frame-support and use this one instead.

bkchr commented 7 months ago

That will not work. You basically just create a different trait here. To achieve what you want to achieve, you need to implement the trait for these types in the crate where the trait is declared. It is also done for the other fundamental types there: https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/support/src/traits/storage.rs#L282