KomodoPlatform / komodo-defi-framework

This is the official Komodo DeFi Framework repository
https://komodoplatform.com/en/docs/komodo-defi-framework/
106 stars 94 forks source link

PrivKeyPolicy type must not implement Clone or Derive #2241

Open Alrighttt opened 1 month ago

Alrighttt commented 1 month ago

https://github.com/KomodoPlatform/komodo-defi-framework/blob/4e8bc50a7d0657cf37d68601bde2e76d280032ef/mm2src/coins/lp_coins.rs#L3869

We should remove Clone and Debug implementations for this type since it handles private keys. There seems to be no instance of using Debug. There are two instances of using Clone which must be refactored:

https://github.com/KomodoPlatform/komodo-defi-framework/blob/4e8bc50a7d0657cf37d68601bde2e76d280032ef/mm2src/coins/eth/v2_activation.rs#L424

https://github.com/KomodoPlatform/komodo-defi-framework/blob/4e8bc50a7d0657cf37d68601bde2e76d280032ef/mm2src/coins/eth/v2_activation.rs#L515

Alrighttt commented 1 month ago

We should consider if it makes sense to also remove pub from this type.

Alrighttt commented 1 month ago

This is a more significant refactor than first stated due to the common pattern of cloning the "Coin" structs such as UtxoStandardCoin, EthCoin, ZCoin, etc.