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

tendermint::PrivateKey doesn't derive Copy or Clone #1077

Closed
zbuc opened this issue Jan 12, 2022 · 2 comments · Fixed by #1082
Closed

tendermint::PrivateKey doesn't derive Copy or Clone #1077

zbuc opened this issue Jan 12, 2022 · 2 comments · Fixed by #1082
Assignees

Comments

@zbuc
Copy link

zbuc commented Jan 12, 2022

The tendermint::PrivateKey enum doesn't derive Copy or Clone, but the underlying ed25519_consensus::SigningKey contained by the enum supports both.

I was able to work around this by cloning the inner value:

let cloned_key = tendermint::PrivateKey::Ed25519(
   other_key.ed25519_signing_key().unwrap().clone(),
);

but it'd be nicer to be able to Copy/Clone the type directly if possible.

@tony-iqlusion
Copy link
Collaborator

Would strongly recommend explicit Clone over Copy. You don't want to indiscriminately make copies of private keys.

@zbuc
Copy link
Author

zbuc commented Jan 13, 2022

Good point, we'll update ed25519-consensus as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants