Skip to content
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

return sql.ErrNotFound if account doesn't exist #6508

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Nov 29, 2024

Motivation

The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.

Description

Previously, it returned an empty account. Now the error handling decision is left for the caller.

Test Plan

Updated tests

Previously, it returned an empty account. Now the error handling
decision is left for the caller.
genvm/core/types.go Show resolved Hide resolved
genvm/vm.go Outdated Show resolved Hide resolved
genvm/vm_test.go Show resolved Hide resolved
sql/accounts/accounts_test.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 85.36585% with 6 lines in your changes missing coverage. Please review.

Project coverage is 79.9%. Comparing base (feda54f) to head (d3183ae).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
genvm/vm.go 69.2% 4 Missing ⚠️
genvm/core/context.go 75.0% 1 Missing ⚠️
genvm/rewards.go 75.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #6508   +/-   ##
=======================================
  Coverage     79.9%   79.9%           
=======================================
  Files          353     353           
  Lines        46517   46534   +17     
=======================================
+ Hits         37211   37225   +14     
- Misses        7199    7208    +9     
+ Partials      2107    2101    -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@poszu
Copy link
Contributor Author

poszu commented Nov 29, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Nov 29, 2024
## Motivation
The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.
@spacemesh-bors
Copy link

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Nov 29, 2024

Bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Nov 29, 2024
## Motivation
The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.
@spacemesh-bors
Copy link

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Nov 30, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Nov 30, 2024
## Motivation
The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.
@spacemesh-bors
Copy link

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Dec 2, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Dec 2, 2024
## Motivation
The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 2, 2024

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Dec 2, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Dec 2, 2024
## Motivation
The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 2, 2024

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Dec 2, 2024

bors merge

@poszu poszu closed this Dec 2, 2024
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 2, 2024

Already running a review

@poszu poszu reopened this Dec 2, 2024
@poszu
Copy link
Contributor Author

poszu commented Dec 2, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Dec 2, 2024
## Motivation
The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 2, 2024

Build failed:

  • systest-status

@poszu poszu marked this pull request as draft December 2, 2024 21:09
@poszu poszu marked this pull request as ready for review December 2, 2024 21:57
@poszu
Copy link
Contributor Author

poszu commented Dec 3, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Dec 3, 2024
## Motivation
The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 3, 2024

Build failed:

  • systest-status

@poszu
Copy link
Contributor Author

poszu commented Dec 3, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Dec 3, 2024
## Motivation
The decision how to handle a situation when the queried account doesn't exist should be left to the caller - it's not the responsibility of the code accessing the cache/database.
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 3, 2024

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Dec 3, 2024

bors try

spacemesh-bors bot added a commit that referenced this pull request Dec 3, 2024
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 3, 2024

try

Build failed:

@poszu
Copy link
Contributor Author

poszu commented Dec 3, 2024

bors try

spacemesh-bors bot added a commit that referenced this pull request Dec 3, 2024
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 3, 2024

try

Build failed:

@poszu poszu marked this pull request as draft December 3, 2024 16:26
@dsmello
Copy link
Contributor

dsmello commented Dec 4, 2024

@poszu I'm just using your PR to check if the new systest is working as expected.

@dsmello
Copy link
Contributor

dsmello commented Dec 4, 2024

bors try

spacemesh-bors bot added a commit that referenced this pull request Dec 4, 2024
@spacemesh-bors
Copy link

spacemesh-bors bot commented Dec 4, 2024

try

Build succeeded:

@poszu
Copy link
Contributor Author

poszu commented Dec 5, 2024

@poszu I'm just using your PR to check if the new systest is working as expected.

OK, but keep in mind that this change might actually be unsound as the systests failed few times in a way they hadn't fail before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants