-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting blindedMessages by amount #100
Conversation
This is now ready for review. As outline above I changed createSplitPayload to return a payload containing a list of proofs ordered by amount, as well as a list of booleans indicating which proof to keep and which to send. |
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.
Looks good! Only thing missing is a Unit test testing the behaviour.
amount: sendBlindedMessages.amounts[i], | ||
keep: false | ||
})); | ||
const keepVector: Array<boolean> = []; | ||
const blindedMessages: BlindedTransaction = { |
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.
let's rename this variable to blindedTransaction. blindedMessages
seems kinda confusing. What do you think?
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.
Oh yes absolutely. Will do
blindedMessages: [], | ||
secrets: [], | ||
rs: [], | ||
amounts: [] |
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.
we could add the keep vector here instead
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.
True, I was not sure how many lines of code depend on the type BlindedTransaction
and wanted to reduce this PRs footprint. But I will check that out in my next iteration.
I was under the assumption that the old units tests for this method would still suffice, but we should probably add one to check wether the amount is actually sorted (will do asap). Or am I missing something? |
What would be good way to easily generate secrets and signatures for the Unit tests? |
If you're only trying to test the sorting, you don't need valid secrets. It doesn't get validated anyways. You should be able to just mock it! |
Fixes: #90
Description
Ordered blindedMessages returned by createSplitPayload by amount and added a keepVector
Changes
PR Tasks
npm run test
--> no failing unit testsnpm run format