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

chore(wallet)_: unit tests for SendTransaction, transaction manager API cleanup #5221

Merged
merged 2 commits into from
May 31, 2024

Conversation

IvanBelyakoff
Copy link
Contributor

@IvanBelyakoff IvanBelyakoff commented May 23, 2024

Improvements in code structure to make package more clean and testable:

  • exported API methods left at the same place
  • private methods moved to helpers.go
  • stuff for testing moved to testutils.go
  • created storage interface with clean API and multi transaction related db calls moved to MultiTransactionDBStorage implementation
  • created dummy in-mem storage for tests with multi transactions

Test related changes:

  • written unit tests for MultiTransactionDBStorage
  • mocked Bridge interface
  • mocked Transactor interface
  • written unit tests for TransactionManager.SendTransactions method

Closes #5148

@status-im-auto
Copy link
Member

status-im-auto commented May 23, 2024

Jenkins Builds

Click to see older builds (42)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 105bb58 #1 2024-05-23 19:37:30 ~2 min tests 📄log
✔️ 105bb58 #1 2024-05-23 19:39:11 ~4 min linux 📦zip
✔️ 105bb58 #1 2024-05-23 19:40:13 ~5 min ios 📦zip
✔️ 105bb58 #1 2024-05-23 19:41:06 ~6 min android 📦aar
✔️ 766084b #2 2024-05-23 19:51:52 ~2 min android 📦aar
✔️ 766084b #2 2024-05-23 19:53:06 ~3 min ios 📦zip
✔️ 766084b #2 2024-05-23 19:53:57 ~4 min linux 📦zip
✖️ 766084b #2 2024-05-23 19:52:38 ~2 min tests 📄log
✔️ 62d2114 #3 2024-05-23 21:38:13 ~1 min android 📦aar
✔️ 62d2114 #3 2024-05-23 21:38:31 ~2 min linux 📦zip
✔️ 62d2114 #3 2024-05-23 21:39:31 ~3 min ios 📦zip
✔️ 62d2114 #3 2024-05-23 22:20:39 ~44 min tests 📄log
✖️ 4f834cb #4 2024-05-26 15:03:04 ~1 min tests 📄log
✔️ 4f834cb #4 2024-05-26 15:04:28 ~2 min linux 📦zip
✔️ 4f834cb #4 2024-05-26 15:04:37 ~2 min android 📦aar
✔️ 4f834cb #4 2024-05-26 15:06:16 ~4 min ios 📦zip
✖️ c86f59a #5 2024-05-26 15:13:48 ~1 min tests 📄log
✔️ c86f59a #5 2024-05-26 15:14:56 ~2 min android 📦aar
✔️ c86f59a #5 2024-05-26 15:14:58 ~2 min linux 📦zip
✔️ c86f59a #5 2024-05-26 15:15:51 ~3 min ios 📦zip
✖️ e1ce3ca #6 2024-05-26 15:36:50 ~1 min tests 📄log
✔️ e1ce3ca #6 2024-05-26 15:37:35 ~2 min android 📦aar
✔️ e1ce3ca #6 2024-05-26 15:38:01 ~2 min linux 📦zip
✔️ e1ce3ca #6 2024-05-26 15:38:58 ~3 min ios 📦zip
✔️ 3a91b00 #7 2024-05-27 04:52:59 ~1 min android 📦aar
✔️ 3a91b00 #7 2024-05-27 04:53:24 ~2 min linux 📦zip
✔️ 3a91b00 #7 2024-05-27 04:54:21 ~3 min ios 📦zip
✔️ 3a91b00 #7 2024-05-27 05:33:53 ~42 min tests 📄log
✔️ b3a3909 #8 2024-05-27 15:32:11 ~2 min linux 📦zip
✔️ b3a3909 #8 2024-05-27 15:32:26 ~2 min android 📦aar
✔️ b3a3909 #8 2024-05-27 15:33:47 ~4 min ios 📦zip
✔️ b3a3909 #8 2024-05-27 16:12:38 ~42 min tests 📄log
✔️ 2a5f67d #9 2024-05-31 05:34:43 ~2 min linux 📦zip
✔️ 2a5f67d #9 2024-05-31 05:34:50 ~2 min android 📦aar
✔️ 2a5f67d #9 2024-05-31 05:36:21 ~4 min ios 📦zip
✔️ 2a5f67d #9 2024-05-31 06:15:17 ~43 min tests 📄log
✔️ eec24a5 #10 2024-05-31 06:34:03 ~4 min linux 📦zip
✔️ eec24a5 #10 2024-05-31 06:35:42 ~6 min ios 📦zip
✔️ eec24a5 #10 2024-05-31 06:35:54 ~6 min android 📦aar
✔️ 5b553dd #11 2024-05-31 06:53:48 ~3 min linux 📦zip
✔️ 5b553dd #11 2024-05-31 06:53:49 ~3 min ios 📦zip
✔️ 5b553dd #11 2024-05-31 06:55:58 ~5 min android 📦aar
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ eec24a5 #10 2024-05-31 07:11:57 ~42 min tests 📄log
✔️ 5b553dd #11 2024-05-31 07:53:40 ~41 min tests 📄log

@IvanBelyakoff IvanBelyakoff changed the title chore(wallet)_: code structure improved for multi_transaction manager chore(wallet)_: API cleanup for transaction manager, test, improvements May 23, 2024
@IvanBelyakoff IvanBelyakoff force-pushed the test/send_transaction branch 2 times, most recently from 766084b to 62d2114 Compare May 23, 2024 21:36
@IvanBelyakoff IvanBelyakoff changed the title chore(wallet)_: API cleanup for transaction manager, test, improvements chore(wallet)_: unit tests for SendTransaction, transaction manager API cleanup May 26, 2024
@IvanBelyakoff IvanBelyakoff marked this pull request as ready for review May 26, 2024 15:13
@IvanBelyakoff IvanBelyakoff force-pushed the test/send_transaction branch 3 times, most recently from 3a91b00 to b3a3909 Compare May 27, 2024 15:29
Copy link
Contributor

@saledjenic saledjenic left a comment

Choose a reason for hiding this comment

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

@IvanBelyakoff nice separation and a good step forward towards testing transactions part.

services/wallet/transfer/helpers.go Outdated Show resolved Hide resolved
services/wallet/transfer/helpers.go Outdated Show resolved Hide resolved
services/wallet/transfer/helpers.go Outdated Show resolved Hide resolved
- exported API methods left at the same place
- private methods moved to helpers.go
- stuff for testing moved to testutils.go
- created storage interface with clean API and multi transaction related db calls moved
  to MultiTransactionDBStorage implementation
- created dummy in-mem storage for tests with multi transactions
- written tests for MultiTransactionDBStorage
- Moved some methods from Transactor to users of it to clean interface.
- Mocked Bridge interface and Transactor interface for tests
- Wrote unit tests for SendTransaction
@IvanBelyakoff IvanBelyakoff merged commit a135b27 into develop May 31, 2024
10 of 12 checks passed
@IvanBelyakoff IvanBelyakoff deleted the test/send_transaction branch May 31, 2024 07:58
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.

Add UT tests for SendTransaction
3 participants