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.
feat(frontend): implement pow worker and service layer #5887
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
base: main
Are you sure you want to change the base?
feat(frontend): implement pow worker and service layer #5887
Changes from all commits
4405c08
443feb8
cd5da75
503c082
def3055
0f19642
0f1b97f
319a318
ddd1684
6a89abd
6330049
c9fa579
9e6a759
65a86f1
62deee5
c690937
7d99423
92815c9
1231c15
2bc4fd1
bf7990b
4dcde38
ee221f6
25da25d
f279b8c
dfd4282
1e86f6f
cfbe97b
f5aa18a
1614d99
827b99a
1040770
643468a
2b3c0e2
2c9ec2f
b1cd580
b82a2b3
4819ab9
576b5b8
7633c44
400460f
9781c5f
b2864d5
84154cd
6d5b695
52a33b6
a142422
8ae18de
4b2279b
d1f1541
fef0347
21b10e2
ba25cd4
4f38603
f39f1b5
c377763
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 use the docstring like the other functions, so that you define the params and the results directly in it
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 agree. I will add a complete docstring here.
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.
remove them from here?
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 make it functional? maybe with self-called functions?
const nonce = ...
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 can do that but It could reduce readability. Since this is a critical code a more 'procedural' presentation could therefore be desired here. I will give it a try.
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.
thank you! in any case, if you prefer this implementation, maybe preferable to use
while (prefix > target)
and refactor the logic?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.
A do-while-loop and a conditional-loop will be less readable since they duplicate the condition.
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.
Yes, my idea was something like
But anyway, let's proceed with the
while
loop for readability. May you please change it to have a condition instead ofwhile(true)
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.
Ah! and for safety, let's put an hard coded limit of N iterations that raise an error
P.S. and tests