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

Fixes transaction lists #10

Closed

Conversation

matthiasdebernardini
Copy link
Collaborator

Previously, if you had a pg instance with multiple wallets and you loaded a wallet and collected all its known transactions youd end up with other txs from other wallets.

This was an issue with the sql which is now fixed.

The tests create three wallets, sync them with electrum, insert into pg, then load them again from pg and have its transactions compared with an unpersisted wallet that gets synced with electrum. They should both match.

@notmandatory notmandatory added the bug Something isn't working label Oct 3, 2024
Copy link
Member

@notmandatory notmandatory left a comment

Choose a reason for hiding this comment

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

ACK 8d8fe3d

But with a suggestion for improving tests in the future.

src/test.rs Outdated
Ok(())
}

async fn electrum_full_scan(wallet: &mut PersistedWallet<Store>) -> anyhow::Result<()> {
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not having unit tests that depend on external network services like mempool.space since the tests will be flaky if mempool.space rate limits tests. Also even though DB tests are more of integration tests, they should be focused as much as possible just on the code being tested plus the local postgres DB.

But if you don't have time to create more self contained tests right now I'm ok with merging this as-is as long as we rework the tests in a future PR.

@notmandatory
Copy link
Member

It looks like you need to rebase this PR too.

@notmandatory
Copy link
Member

Hey sorry I had to rebase this and then manually pushed it to the repo master branch. But github got confused since you used your fork master branch. For future PRs be sure to make a feature branch and push that to github.

@notmandatory
Copy link
Member

You can see the merged commit here: aae892e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants