Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is worth making it a trait or something with a default implementation, something more idiomatic and easy to extend.
Also, FYI, perhaps this should be part of the signatory, and the mintd just uses whatever is given to it by the signatory, as it may eventually run as its crate either in the same memory space or with an external service through grpc (#509) /cc @thesimplekid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as the codebase currently is, I reckon, converting
Id
into a trait is unfeasible: this small struct is used in so many places that converting all of them into generic code over a parameterimpl<ID> [...] where ID: Id
would be a bloodbath.Side note: if ( and I hope it will) the signatory and key management subsystem will become an external service communicating with the mint via grpc, protecting the internals of the keyset Id and how it is built is going to become even less relevant for the security level of the mint itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree with codingpeanut that this would end up being a pretty big change. However, we are going to need to something to support keysetv2 whether that be making it a trait or an enum like we do with token, if I remember correctly I started trying to do token as a trait and ended up with an enum forget exactly why.
We still need the type in
cashu
as we want this crate to be an implementation of all the cashu types and can be used without the other crates.