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

Make TestWallet derive from CWallet #22

Merged
merged 1 commit into from
May 20, 2022

Conversation

jmjatlanta
Copy link
Owner

The primary goal of this PR is to push the TestWallet closer to CWallet. This gives greater functionality to TestWallet, and gives greater chances that it works like a "real" wallet.

Also in this PR:

  • Adjust COINBASE_MATURITY for regtest
  • make the CDBEnv something that can be reset, to allow for testing

TransactionInProcess aliceToCharlie = alice->CreateSpendTransaction(charlie, 10000, 5000, useThisTransaction);
CValidationState state;
EXPECT_FALSE(alice->CommitTransaction(aliceToCharlie.transaction, aliceToCharlie.reserveKey, state));
EXPECT_EQ(state.GetRejectReason(), "mempool conflict");
Copy link
Owner Author

Choose a reason for hiding this comment

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

Need to investigate: Why did this change? Should the mempool accept transactions that spend the same prevout? It seems that it used to. Could this be related to the COINBASE_MATURITY change? Doubtful, but possible.

Copy link
Owner Author

Choose a reason for hiding this comment

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

The old code skipped the mempool validation. The new code is more accurate.

@jmjatlanta jmjatlanta merged commit 770f6eb into jmj_testutils May 20, 2022
@jmjatlanta jmjatlanta deleted the jmj_testutils_wallet branch May 20, 2022 22:02
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.

1 participant