-
Notifications
You must be signed in to change notification settings - Fork 98
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
Expand unit test coverage #453
Conversation
In the commits above I have migrated various zcash and bitcoin tests to include them in the run of komodo-tests |
Make TestWallet derive from CWallet
this should be rebased to include the S6 updates |
src/komodo_globals.h
Outdated
#define _COINBASE_MATURITY 100 | ||
int COINBASE_MATURITY = _COINBASE_MATURITY;//100; | ||
unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+10; | ||
unsigned int WITNESS_CACHE_SIZE = 100+10; // coinbase maturity plus 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could it be a named constant instead of '100'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to replace it with something other than a global. It is only used in wallet functions, so I put it there. See 8db798b
@@ -78,7 +77,7 @@ static const bool DEFAULT_ALERTS = true; | |||
/** Minimum alert priority for enabling safe mode. */ | |||
static const int ALERT_PRIORITY_SAFE_MODE = 4000; | |||
/** Maximum reorg length we will accept before we shut down and alert the user. */ | |||
static unsigned int MAX_REORG_LENGTH = _COINBASE_MATURITY - 1; | |||
static unsigned int MAX_REORG_LENGTH = 100 - 1; // based on COINBASE_MATURITY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could use a named constant here (isn't it originalCoinbaseMaturity)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed MAX_REORG_LENGTH, see comment above
|
||
# tool for generating our public parameters | ||
komodo_gtest_SOURCES = \ | ||
zcash_gtest_SOURCES = \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha, renamed to zcash_gtest as in fact it tests just zcash features
these changes implemented in combined PR: #559 |
While not strictly "unit testing", more like mini system/integration testing, developers sometimes need to test their code alongside portions of the existing system. In the case that brought about this change, a new CryptoCondition needed to be tested in the context of the whole create transaction/spend transaction process.
testutils already existed to do some of this, but it did not seem to be used often. Existing functions were collected and adjusted to work inside a class. Now simple chain transactions can be tested by writing a gtest: