diff options
| author | Patrick Lodder <[email protected]> | 2021-06-27 00:37:10 +0200 |
|---|---|---|
| committer | Patrick Lodder <[email protected]> | 2021-08-05 18:24:17 +0200 |
| commit | 4c46af04830cec3da6ecfbf677ef3d826a5892e6 (patch) | |
| tree | 8e2c6490458c57ff690788195b298cc4edd07891 /src/wallet/test/wallet_tests.cpp | |
| parent | Merge pull request #2415 from rnicoll/1.14.4-rbf-fee (diff) | |
| download | discoin-4c46af04830cec3da6ecfbf677ef3d826a5892e6.tar.xz discoin-4c46af04830cec3da6ecfbf677ef3d826a5892e6.zip | |
[fees] introduce configurable hard dust limit
Co-authored-by: Ross Nicoll <[email protected]>
Diffstat (limited to 'src/wallet/test/wallet_tests.cpp')
| -rw-r--r-- | src/wallet/test/wallet_tests.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 4e84bb688..79a994bf6 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -36,6 +36,8 @@ std::vector<std::unique_ptr<CWalletTx>> wtxn; typedef set<pair<const CWalletTx*,unsigned int> > CoinSet; +extern unsigned int nDustLimit; + BOOST_FIXTURE_TEST_SUITE(wallet_tests, WalletTestingSetup) static const CWallet wallet; @@ -524,6 +526,18 @@ BOOST_AUTO_TEST_CASE(GetMinimumFee_dust_test) BOOST_CHECK_EQUAL(CWallet::GetMinimumFee(tx, 963, 0, pool), 2 * nMinTxFee); BOOST_CHECK_EQUAL(CWallet::GetMinimumFee(tx, 1000, 0, pool), 2 * nMinTxFee); BOOST_CHECK_EQUAL(CWallet::GetMinimumFee(tx, 1999, 0, pool), 3 * nMinTxFee); + + // change the hard dust limit + + nDustLimit = COIN / 10; + + // Confirm dust penalty fees are not added + + BOOST_CHECK_EQUAL(CWallet::GetMinimumFee(tx, 963, 0, pool), 1 * nMinTxFee); + BOOST_CHECK_EQUAL(CWallet::GetMinimumFee(tx, 1000, 0, pool), 1 * nMinTxFee); + BOOST_CHECK_EQUAL(CWallet::GetMinimumFee(tx, 1999, 0, pool), 2 * nMinTxFee); + + nDustLimit = COIN; } BOOST_AUTO_TEST_SUITE_END() |