Skip to content

Feat(SPV-1544): admin record transaction for user endpoint #949

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

dzolt-4chain
Copy link
Contributor

Pull Request Checklist

  • πŸ“– I created my PR using provided : CODE_STANDARDS
  • πŸ“– I have read the short Code of Conduct: CODE_OF_CONDUCT
  • 🏠 I tested my changes locally.
  • βœ… I have provided tests for my changes.
  • πŸ“ I have used conventional commits.
  • πŸ“— I have updated any related documentation.
  • πŸ’Ύ PR was issued based on the Github or Jira issue.

@dzolt-4chain dzolt-4chain requested a review from a team as a code owner March 4, 2025 12:51
Copy link

github-actions bot commented Mar 4, 2025

Manual Tests

ℹ️ Remember to ask team members to perform manual tests and to assign tested label after testing.

@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 4.97925% with 229 lines in your changes missing coverage. Please review.

Project coverage is 34.15%. Comparing base (3ad6ae4) to head (ab860fc).

Files with missing lines Patch % Lines
api/gen.models.go 0.00% 156 Missing ⚠️
actions/v2/admin/internal/mapping/transaction.go 0.00% 46 Missing ⚠️
actions/v2/admin/transactions/record.go 27.27% 12 Missing and 4 partials ⚠️
api/gen.api.go 0.00% 11 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #949      +/-   ##
==========================================
- Coverage   34.50%   34.15%   -0.36%     
==========================================
  Files         437      440       +3     
  Lines       20826    21067     +241     
==========================================
+ Hits         7186     7195       +9     
- Misses      13041    13268     +227     
- Partials      599      604       +5     
Flag Coverage Ξ”
unittests 34.15% <4.97%> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Ξ”
actions/v2/admin/server.go 100.00% <100.00%> (ΓΈ)
actions/v2/admin/transactions/server.go 100.00% <100.00%> (ΓΈ)
api/gen.api.go 0.00% <0.00%> (ΓΈ)
actions/v2/admin/transactions/record.go 27.27% <27.27%> (ΓΈ)
actions/v2/admin/internal/mapping/transaction.go 0.00% <0.00%> (ΓΈ)
api/gen.models.go 0.00% <0.00%> (ΓΈ)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update 3ad6ae4...ab860fc. Read the comment docs.

πŸš€ New features to boost your workflow:
  • ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

})
}

func TestDoubleSpending(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would skip error cases for admin-endpoints because since it is handled by the same engine method it is already tested by other tests anyway.

Copy link
Collaborator

@dorzepowski dorzepowski Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't, those are kind'a blackbox tests, to skip them, it would need to know that we're using the same service.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general idea of these tests was to test the behaviour of admin delete user. They are the same now, but if something changes under the hood they might use different implementation so I think it would be better to have them here even if they are "the same". It doesn't affect any performance that much but keeps us ensured that everything works correctly

})
}

func TestTransactionWithChange(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would skip this test since it is already covered by the one for "user"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't

})
}

func TestExternalOutgoingTransaction(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would skip one of these: TestExternalOutgoingTransaction or TestInternalOutgoingTransaction.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't

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.

4 participants