Skip to content

[bridge]: first batch of changes related to bridge#1453

Merged
Jaguar0625 merged 7 commits into
feature/bridgefrom
task/bridge/workflow-download
Jul 7, 2025
Merged

[bridge]: first batch of changes related to bridge#1453
Jaguar0625 merged 7 commits into
feature/bridgefrom
task/bridge/workflow-download

Conversation

@Jaguar0625

@Jaguar0625 Jaguar0625 commented Jun 27, 2025

Copy link
Copy Markdown
Contributor
[bridge]: add initial logic for calculating conversion and sending wrapped tokens

 problem: wrapped tokens need to be sent to destination addresses
solution: add TransactionSender to simplify sending transactions to network(s)
          update `calculate_conversions` workflow to send wrapped tokens
             and set database request status to SENT
             (this workflow is a WIP and likely to change)

[bridge]: add payout_transaction table to WrapRequestDatabase

 problem: need to track payout/issuance transactions
solution: add payout_transaction table

[bridge]: support custom message validation to support custom networks

 problem: code assumes destination (wrapped) address is on ethereum network
solution: relax assumption to allow nem <> symbol bridging

[bridge]: add support for creating (redemption) transactions

 problem: need to be able to create transfer transactions for unwrap/redemption process
solution: add create_transfer_transaction to nem and symbol NetworkFacade

[bridge]: add new calculate_conversion workflow

 problem: need to calculate wrapped token : native token conversion rate
solution: add (temporary) workflow to perform calculation and add missing functions

[bridge]: add Symbol support for downloading wrap requests

 problem: download_wrap_request_transactions needs to work with Symbol too
solution: add Symbol adapters to `download_wrap_request_transactions`
          generalize database to allow multiple wrap requests and/or errors per transaction

[bridge]: add initial workflow for downloading wrap requests

 problem: step one of bridge requires downloading and validating wrap requests from native network
solution: add `download_wrap_request_transactions` workflow to
          * download transactions from network
          * map each tranaction into a wrap request or wrap error
          * populate a database with these requests and errors

          at time of this commit,  NEM downloads are fully supported
          but workflow is generic enough to work with other networks

@Jaguar0625 Jaguar0625 requested a review from Wayonb June 27, 2025 13:51
@Jaguar0625 Jaguar0625 changed the base branch from dev to feature/bridge June 27, 2025 13:51
@Jaguar0625 Jaguar0625 force-pushed the task/bridge/workflow-download branch 2 times, most recently from 7832dbb to 7c9ae73 Compare June 27, 2025 13:56
@codecov

codecov Bot commented Jun 27, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.34%. Comparing base (2241833) to head (b196dbd).
Report is 7 commits behind head on feature/bridge.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##           feature/bridge    #1453      +/-   ##
==================================================
+ Coverage           98.28%   98.34%   +0.06%     
==================================================
  Files                 161      170       +9     
  Lines                6763     7024     +261     
  Branches              143      143              
==================================================
+ Hits                 6647     6908     +261     
  Misses                116      116              
Flag Coverage Δ
bridge 100.00% <100.00%> (ø)

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

Files with missing lines Coverage Δ
bridge/bridge/NetworkFacadeLoader.py 100.00% <100.00%> (ø)
bridge/bridge/NetworkUtils.py 100.00% <100.00%> (ø)
bridge/bridge/db/Databases.py 100.00% <100.00%> (ø)
bridge/bridge/db/WrapRequestDatabase.py 100.00% <100.00%> (ø)
bridge/bridge/models/BridgeConfiguration.py 100.00% <100.00%> (ø)
bridge/bridge/models/WrapRequest.py 100.00% <100.00%> (ø)
bridge/bridge/nem/NemNetworkFacade.py 100.00% <100.00%> (ø)
bridge/bridge/nem/NemUtils.py 100.00% <100.00%> (ø)
bridge/bridge/symbol/SymbolNetworkFacade.py 100.00% <100.00%> (ø)
bridge/bridge/symbol/SymbolUtils.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

 problem: step one of bridge requires downloading and validating wrap requests from native network
solution: add `download_wrap_request_transactions` workflow to
          * download transactions from network
          * map each tranaction into a wrap request or wrap error
          * populate a database with these requests and errors

          at time of this commit,  NEM downloads are fully supported
          but workflow is generic enough to work with other networks
 problem: download_wrap_request_transactions needs to work with Symbol too
solution: add Symbol adapters to `download_wrap_request_transactions`
          generalize database to allow multiple wrap requests and/or errors per transaction
 problem: need to calculate wrapped token : native token conversion rate
solution: add (temporary) workflow to perform calculation and add missing functions
 problem: need to be able to create transfer transactions for unwrap/redemption process
solution: add create_transfer_transaction to nem and symbol NetworkFacade
 problem: code assumes destination (wrapped) address is on ethereum network
solution: relax assumption to allow nem <> symbol bridging
@Jaguar0625 Jaguar0625 force-pushed the task/bridge/workflow-download branch from e8aad53 to 9b3f068 Compare July 4, 2025 13:49
@Jaguar0625 Jaguar0625 changed the title [bridge]: add initial workflow for downloading wrap requests [bridge]: first batch of changes related to bridge Jul 4, 2025
 problem: need to track payout/issuance transactions
solution: add payout_transaction table
…apped tokens

 problem: wrapped tokens need to be sent to destination addresses
solution: add TransactionSender to simplify sending transactions to network(s)
          update `calculate_conversions` workflow to send wrapped tokens
             and set database request status to SENT
             (this workflow is a WIP and likely to change)
@Jaguar0625 Jaguar0625 force-pushed the task/bridge/workflow-download branch from 1f249dc to b196dbd Compare July 4, 2025 22:29

@Wayonb Wayonb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍🏾

Comment thread bridge/scripts/ci/test.sh

TEST_RUNNER=$([ "$1" = "code-coverage" ] && echo "coverage run --append" || echo "python3")
${TEST_RUNNER} -m pytest --asyncio-mode=auto -v
PYTHONPATH=.:./../lightapi/python ${TEST_RUNNER} -m pytest --asyncio-mode=auto -v

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this until lightapi is released?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yea

@Jaguar0625 Jaguar0625 merged commit b196dbd into feature/bridge Jul 7, 2025
14 checks passed
@Jaguar0625 Jaguar0625 deleted the task/bridge/workflow-download branch July 7, 2025 13:15
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.

2 participants