-
Notifications
You must be signed in to change notification settings - Fork 254
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
config: Add Debug Clone for common configs #1542
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I do believe they should never be necessary, I'm happy adding these on the concrete types just to make life easier :)
(We used to have such bounds on the trait itself iirc and that I'd object to)
core/src/config/polkadot.rs
Outdated
@@ -11,6 +11,7 @@ pub use crate::utils::{AccountId32, MultiAddress, MultiSignature}; | |||
pub use primitive_types::{H256, U256}; | |||
|
|||
/// Default set of commonly used types by Polkadot nodes. | |||
#[derive(Debug, Clone)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could probably add Copy as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we hsould just add all of the "standard" traits? eg perhaps:
Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default
and maybe also a quick dev note that the traits exist just to make life easier but shouldn't strictly be necessary since you can't instantiate this type
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This tiny PR implements
Debug, Clone
forSubstrateConfig
andPolkadotConfig
.This might be useful for developers that have wrappers over these types, or that store these types in other structs.
cc @AndreiEres let me know if this solves the issue with debugging types from polkadot-interceptor 🙏