feat: use Uuid as mint and melt quote ids #469
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.
Description
This PR changes the type of mint and melt quote Ids to Uuid rather than
String
.It required changes in some field types along with some trait signatures.
It will improve the code security by manipulating check Uuid, instead of string that can be anything.
It will also improve performances as Uuid fit on less memory [u8; 16] than its string representation. Same for database.
It also avoids some memory allocation by being
Copy
. So no need to clone.It also avoids mixing different types into
String
. Eg. In nut17 there was a part where both PublicKeys and Uuid were represented as the same typeString
and fed to the same method. This is really error prone and should be avoided.Notes to the reviewers
I did not write the migration to modify the Ids of the tables in the different database from string to uuid/bytes or whatever is the underlying representation.
Can you do it as you are more familiar with the multiple database supported and the way to write and test those migrations.
Suggested CHANGELOG Updates
CHANGED: use uuid as identifier for mint and melt quotes
Checklist
just final-check
before committing