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

fix(test): Fixes bugs in the lightwalletd integration tests #9052

Merged
merged 18 commits into from
Dec 11, 2024

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Nov 22, 2024

Motivation

This PR fixes a bug in the sending_transactions_using_lightwalletd test where transactions from multiple future blocks are being sent to the mempool without committing prior blocks to the chain.

It also fixes a bug in the lightwalletd_wallet_grpc_tests where the test expects the ZF funding stream address balance to always be greater than zero.

Solution

  • Submits blocks to the state after sending their transactions to the mempool in the sending_transactions_using_lightwalletd test, and
  • Only check that active funding stream addresses have a balance that's greater than zero in the lightwalletd_wallet_grpc_tests test.

Tests

The test should pass in CI.

PR Author's Checklist

  • The PR name will make sense to users.
  • The PR provides a CHANGELOG summary.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.

PR Reviewer's Checklist

  • The PR Author's checklist is complete.
  • The PR resolves the issue.

@arya2 arya2 self-assigned this Nov 22, 2024
@github-actions github-actions bot added C-bug Category: This is a bug C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG labels Nov 22, 2024
@arya2 arya2 marked this pull request as ready for review November 22, 2024 19:33
@arya2 arya2 requested a review from a team as a code owner November 22, 2024 19:33
@arya2 arya2 requested review from upbqdn and removed request for a team November 22, 2024 19:33
@arya2 arya2 requested a review from a team as a code owner November 29, 2024 12:05
@conradoplg
Copy link
Collaborator

@Mergifyio update

Copy link
Contributor

mergify bot commented Dec 4, 2024

update

✅ Branch has been successfully updated

Copy link
Collaborator

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Sorry, I missed this PR before. It looks good, I just have some questions about parts of it.

@conradoplg
Copy link
Collaborator

FYI I got this error on another PR:

  left: SendResponse { error_code: 0, error_message: "failed to validate tx: transaction::Hash(\"private\"), error: transaction did not pass consensus validation: could not validate nullifiers and anchors on best chain: immature transparent coinbase spend: attempt to spend OutPoint { hash: transaction::Hash(\"47bc05a53a5f270604f9d6a52bdc48cb9a5c7a1efc4ff6eb00f8842f287a3f2c\"), index: 0 } at Height(2739104), but spends are invalid before Height(2739107), which is 100 blocks after it was created at Height(2739007)" }
 right: SendResponse { error_code: 0, error_message: "\"0f85fada75a7a59a02e15363f8bd62150c9148d133b50d570952bb89bc713a1f\"" }

which does seems like something that might be fixed by this PR

conradoplg
conradoplg previously approved these changes Dec 5, 2024
Copy link
Collaborator

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Looks good, just needs solving conflicts

@arya2
Copy link
Contributor Author

arya2 commented Dec 5, 2024

I still need to fix the new test failure before this merges (error trying to connect when calling Zebra's RPC server) first, but I'm happy for this to merge without a fix for the invalid script issue.

@arya2 arya2 added do-not-merge Tells Mergify not to merge this PR and removed do-not-merge Tells Mergify not to merge this PR labels Dec 5, 2024
@arya2 arya2 requested a review from conradoplg December 9, 2024 19:09
@arya2
Copy link
Contributor Author

arya2 commented Dec 9, 2024

The test is now passing locally.

conradoplg
conradoplg previously approved these changes Dec 9, 2024
Copy link
Collaborator

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Looks good! I left a question just to be sure about the fix of the last issue

zebrad/tests/common/lightwalletd/send_transaction_test.rs Outdated Show resolved Hide resolved
@arya2 arya2 changed the title fix(test): Fixes a bug in the sending_transactions_using_lightwalletd test fix(test): Fixes bugs in the lightwalletd integration tests Dec 9, 2024
@arya2 arya2 added the C-testing Category: These are tests label Dec 9, 2024
@arya2 arya2 requested a review from conradoplg December 10, 2024 00:19
conradoplg
conradoplg previously approved these changes Dec 10, 2024
Copy link
Contributor

mergify bot commented Dec 10, 2024

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #9052 has been dequeued. The pull request rule doesn't match anymore.

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@conradoplg
Copy link
Collaborator

(It was dequeued because I noticed that issue I commented just after I approved it)

mergify bot added a commit that referenced this pull request Dec 11, 2024
@mergify mergify bot merged commit eb1d129 into main Dec 11, 2024
147 checks passed
@mergify mergify bot deleted the fix-send-tx-test branch December 11, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug C-testing Category: These are tests C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG P-High 🔥
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: some Zebra and Lightwalletd logs have changed, causing some tests to fail
3 participants