-
Notifications
You must be signed in to change notification settings - Fork 38
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
Refactor user nonce logic. #649
Merged
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b859963
Refactor & removed get_or_create_nonce function.
mariacarmina 01923bb
Skipped c2d tests. Removed c2d from workflow.
mariacarmina dc1c539
Updated pytest.yml.
mariacarmina 79aa45e
Fixed import.
mariacarmina 14ca7d1
tweak.
mariacarmina 99946a5
Skipped tests for compute. Fixed nonce functions.
mariacarmina 2b7acae
Synchronized nonce operations in compute endpoints.
mariacarmina cf57911
Removed locks.
mariacarmina c6bff5c
Fixed bug in nonce endpoint.
mariacarmina 1d5c4c3
Converted timestamp to simple integer for nonce. Updated build_nonce …
mariacarmina 84c69fd
Added couple fixes. Removed timestamp computation for nonce.
mariacarmina 07eb54c
Added test for nonce.
mariacarmina 1913c5b
Fixed requests tweak.
mariacarmina 44150ec
Replace text with content.
mariacarmina 3d62f55
Refactored _compute_nonce function.
mariacarmina a901b36
Changed parameter.
mariacarmina 1170977
Deleted _compute_nonce.
mariacarmina f899a36
Update API.md.
mariacarmina fce9b4f
Bump version: 2.0.2 → 2.1.0
alexcos20 6a61185
Merge branch 'main' into invalid-signature
alexcos20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
from datetime import datetime, timezone | ||
from ocean_provider.user_nonce import get_nonce, update_nonce | ||
|
||
|
||
def build_nonce(): | ||
return str(datetime.now(timezone.utc).timestamp()) | ||
def build_nonce(address) -> int: | ||
nonce = get_nonce(address) | ||
if nonce: | ||
nonce = int(float(nonce)) + 1 | ||
update_nonce(address, nonce) | ||
|
||
return int(nonce) | ||
|
||
update_nonce(address, 1) | ||
return 1 |
Oops, something went wrong.
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.
if we handle this in a new issue, then lgtm