phoenix-core icon indicating copy to clipboard operation
phoenix-core copied to clipboard

Avoid redefinition of types in different crates

Open ureeves opened this issue 2 years ago • 0 comments

Summary

We should try and avoid redefining types defined in other crates, or using "untyped" fields. Currently the Transaction::proof field is a Vec<u8>, when it really should be a dusk_plonk::Proof, and there is also a ModuleId type alias that really should be piecrust_uplink::ModuleId.

Possible solution design or implementation

One possible solution is to include the appropriate dependencies, even at the risk of increasing binary size for users of this crate.

Additional context

Although this is clearly an improvement to the previous version where we don't add a type alias and only use BlsScalars as an ID, wouldn't it make sense to use the piecrust ModuleId here even though it would include an extra dependency? It doesn't feel 'right' to define the same thing in two different crates.

Originally posted by @moCello in https://github.com/dusk-network/phoenix-core/pull/120#discussion_r1081274067

ureeves avatar Jan 19 '23 22:01 ureeves