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

test: remove mempool mocks #362

Merged
merged 3 commits into from
Apr 30, 2024
Merged

test: remove mempool mocks #362

merged 3 commits into from
Apr 30, 2024

Conversation

panleone
Copy link
Member

@panleone panleone commented Apr 30, 2024

Abstract

Do not mock the mempool. Mocking only makes tests boring to change each time we add a new function to the mempool.

In place of mocking the mempool I have created a utils function setUpMainnetWallet() which sets up a mainnet wallet with a mempool (with an UTXO), a legacy master key and a dummy shield handler.

The utils function reduces a lot of copy and paste, as you can see.

for future: In setUpMainnetWallet instead of feeding the transactions directly to the wallet, we can simulate better by creating a mock to the network (in particular a mock of getLatestTxs)


Testing

Check that tests are still passing as before

@panleone panleone requested a review from Duddino April 30, 2024 08:51
@panleone panleone self-assigned this Apr 30, 2024
@panleone panleone added the Test Addition of unit or functional test label Apr 30, 2024
Copy link

netlify bot commented Apr 30, 2024

Deploy Preview for cheery-moxie-4f1121 ready!

Name Link
🔨 Latest commit 40286bc
🔍 Latest deploy log https://app.netlify.com/sites/cheery-moxie-4f1121/deploys/6630b18568cf06000821d82f
😎 Deploy Preview https://deploy-preview-362--cheery-moxie-4f1121.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

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

ACK

@Duddino Duddino merged commit 8c3522d into PIVX-Labs:master Apr 30, 2024
7 checks passed
panleone added a commit to panleone/MyPIVXWallet that referenced this pull request May 3, 2024
* test: do not mock the mempool

* test: remove mempool mocks

* test: remove unused mock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Addition of unit or functional test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants