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

feat(SPV-1160): new record outline endpoint with actual repository for op_return txs #777

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

Conversation

chris-4chain
Copy link
Contributor

This pull request introduces several new functionalities and improvements to the SPV Wallet project, particularly focusing on transaction recording and testing capabilities. The key changes include the addition of new services, interfaces, and test fixtures to support transaction recording and handling.

Transaction Recording Enhancements:

  • New Service for Recording Transactions:

    • Added a new service for recording transactions in the engine/transaction/record package. [1] [2] [3]
    • Introduced transactionRecordOutline function in actions/transactions/outlines_record.go to handle recording transaction outlines.
    • Updated routes to include the new endpoint for recording transaction outlines.
  • Database Integration:

    • Integrated new database models (Transaction, Output, Data) for handling transaction data. [1] [2] [3]
    • Updated the auto-migration logic to include new database models. [1] [2]

Testing Improvements:

  • New Test Fixtures:

    • Added ARCFixture interface and implementation to support testing of ARC-related functionalities. [1] [2]
    • Updated SPVWalletApplicationFixture to include the new ARC method.
  • New Test Cases:

    • Added tests for the new transaction recording endpoint in actions/transactions/outlines_record_test.go.

Code Refactoring:

  • Refactored Import Statements:

    • Updated import statements across multiple files to include new packages and models. [1] [2] [3] [4]
  • Service Initialization:

    • Added initialization logic for the new transaction recording service in the client setup. [1] [2]

These enhancements significantly improve the functionality and testability of the SPV Wallet project, especially in terms of handling and recording transaction data.

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.

@chris-4chain chris-4chain requested a review from a team as a code owner November 21, 2024 08:44
Copy link

github-actions bot commented Nov 21, 2024

Manual Tests

💚 Manual testing by @dorzepowski resulted in success.

@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2024

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

Codecov Report

Attention: Patch coverage is 70.76023% with 50 lines in your changes missing coverage. Please review.

Project coverage is 45.16%. Comparing base (18e6389) to head (dec5784).

Files with missing lines Patch % Lines
engine/testabilities/testmode/db_mode.go 33.33% 12 Missing ⚠️
...ransaction/record/testabilities/mock_repository.go 0.00% 10 Missing ⚠️
...ping/annotatedtx/annotated_tx_request_to_engine.go 66.66% 6 Missing and 1 partial ⚠️
engine/database/dao/transactions.go 78.57% 4 Missing and 2 partials ⚠️
...ansaction/record/testabilities/mock_broadcaster.go 0.00% 5 Missing ⚠️
engine/client.go 0.00% 2 Missing and 1 partial ⚠️
engine/client_transaction.go 0.00% 3 Missing ⚠️
engine/testabilities/fixture_engine.go 0.00% 1 Missing and 2 partials ⚠️
engine/client_internal.go 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #777      +/-   ##
==========================================
+ Coverage   44.88%   45.16%   +0.28%     
==========================================
  Files         350      358       +8     
  Lines       17217    17360     +143     
==========================================
+ Hits         7727     7841     +114     
- Misses       8922     8949      +27     
- Partials      568      570       +2     
Flag Coverage Δ
unittests 45.16% <70.76%> (+0.28%) ⬆️

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

Files with missing lines Coverage Δ
...ons/testabilities/fixture_spvwallet_application.go 75.55% <100.00%> (+1.13%) ⬆️
actions/transactions/outlines_record.go 100.00% <100.00%> (ø)
actions/transactions/routes.go 100.00% <100.00%> (ø)
engine/database/data.go 100.00% <ø> (ø)
engine/database/models.go 100.00% <100.00%> (ø)
engine/database/output.go 100.00% <100.00%> (ø)
engine/database/tracked_transaction.go 100.00% <100.00%> (ø)
engine/definitions.go 100.00% <100.00%> (ø)
engine/testabilities/fixture_arc.go 100.00% <100.00%> (ø)
engine/transaction/record/record_outline.go 90.10% <100.00%> (ø)
... and 10 more

... 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 18e6389...dec5784. Read the comment docs.

@chris-4chain chris-4chain changed the title feat(SPV-1160): actual repository for new record outline feat(SPV-1160): new record outline endpoint with actual repository for op_return txs Nov 21, 2024
actions/transactions/routes.go Outdated Show resolved Hide resolved
actions/transactions/outlines_record_test.go Show resolved Hide resolved
actions/transactions/outlines_record_test.go Show resolved Hide resolved
engine/transaction/record/record_outline.go Outdated Show resolved Hide resolved
engine/database/transaction.go Outdated Show resolved Hide resolved
engine/testabilities/testmode/db_mode.go Outdated Show resolved Hide resolved
engine/testabilities/testmode/db_mode.go Show resolved Hide resolved
engine/testabilities/fixture_engine.go Show resolved Hide resolved
engine/record_tx_repository.go Outdated Show resolved Hide resolved
engine/record_tx_repository.go Outdated Show resolved Hide resolved
engine/database/transaction.go Outdated Show resolved Hide resolved
return
}

c.JSON(200, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor

this will return null as body. Instead you can simple use
c.Status(200)

@dorzepowski dorzepowski added the tested PR was tested by a team member label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tested PR was tested by a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants