forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
43f6f1b Add unit test for budget value. (presstab) 9ee7d98 Update protocol to 70914. (presstab) ebc4527 [Budget] Fix wrong budget amount (Mrs-X) Tree-SHA512: 6d813ee5e9cc548ffd8b3c816f669a9b79a6b8118de73941fd3fc6d7be46ae2dbfa935d94d1b62c32c1700165ad5a637f87eeaa8cd36927d4d281193b9c84ada
- Loading branch information
Showing
4 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) 2018 The PIVX developers | ||
// Distributed under the MIT/X11 software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <boost/test/unit_test.hpp> | ||
#include <tinyformat.h> | ||
#include <utilmoneystr.h> | ||
#include "masternode-budget.h" | ||
|
||
BOOST_AUTO_TEST_SUITE(budget_tests) | ||
|
||
void CheckBudgetValue(int nHeight, std::string strNetwork, CAmount nExpectedValue) | ||
{ | ||
CBudgetManager budget; | ||
CAmount nBudget = budget.GetTotalBudget(nHeight); | ||
std::string strError = strprintf("Budget is not as expected for %s. Result: %s, Expected: %s", strNetwork, FormatMoney(nBudget), FormatMoney(nExpectedValue)); | ||
BOOST_CHECK_MESSAGE(nBudget == nExpectedValue, strError); | ||
} | ||
|
||
BOOST_AUTO_TEST_CASE(budget_value) | ||
{ | ||
SelectParams(CBaseChainParams::MAIN); | ||
int nHeightTest = Params().Zerocoin_Block_V2_Start() + 1; | ||
CheckBudgetValue(nHeightTest, "mainnet", 43200*COIN); | ||
|
||
SelectParams(CBaseChainParams::TESTNET); | ||
nHeightTest = Params().Zerocoin_Block_V2_Start() + 1; | ||
CheckBudgetValue(nHeightTest, "testnet", 7300*COIN); | ||
} | ||
|
||
BOOST_AUTO_TEST_SUITE_END() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters