ZcashFoundation / frost

Rust implementation of FROST (Flexible Round-Optimised Schnorr Threshold signatures) by the Zcash Foundation
https://frost.zfnd.org
Other
133 stars 50 forks source link

Add `'static` to Ciphersuite trait #693

Closed conradoplg closed 1 month ago

conradoplg commented 2 months ago

It's a common pattern to use Box<dyn std::error::Error> to represent any type of error. However, if you try to convert a frost_core::Error<C> into it, the compiler requires adding a 'static bound to the function (e.g. <C: Ciphersuite + 'static>. The reason is explained here.

We can simply add the 'static bound to Ciphersuite ourselves, which would then not require doing it in every function that uses that pattern. (This came up while converting the demo code to use generics).

This is a breaking change (and a simple one) so I think we can add it to the 2.0.0 release.