zebra-chain: Port array-wrapper types to const generics #2042
Labels
A-rust
Area: Updates to Rust code
C-cleanup
Category: This is a cleanup
C-enhancement
Category: This is an improvement
E-help-wanted
Call for participation: Help is requested to fix this issue.
good first issue
Is your feature request related to a problem? Please describe.
We created several types that wrap arrays of bytes that are longer than 32, such as the Groth16Proof and Halo2Proof types. Since they are longer, Rust did not automatically derive several common traits for them, so we had to do that manually. Now that const generics have been stablized, we can clean up some of this code.
Describe the solution you'd like
Define the types in zebra-chain that wrap arrays of bytes longer than 32 as wrapping arrays with lengths defined by a const. This will allow us to
#[derive()]
common traits on the wrapper type that we could not before, and get rid of the directly implemented traits, likeCopy
,Clone
, etc.Describe alternatives you've considered
Leave the impls as they are.
Additional context
I think this should just work? But I haven't tested it.
The text was updated successfully, but these errors were encountered: