-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add masternode
timelock
to CCustomTxRpcVisitor
, now can be retrie…
…ved via relevant RPCs. (#679) * Added masternode timelock to CCustomTxRpcVisitor, now can be retrived via decodecustomtx RPC. * Updated NOTIMELOCK to NONE. Co-authored-by: Prasanna Loganathar <[email protected]>
- Loading branch information
1 parent
949a5ef
commit b10e7a8
Showing
4 changed files
with
32 additions
and
0 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
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,21 @@ | ||
#include <test/setup_common.h> | ||
|
||
#include <masternodes/masternodes.h> | ||
|
||
#include <boost/test/unit_test.hpp> | ||
|
||
BOOST_FIXTURE_TEST_SUITE(mn_timelock_tests, TestingSetup) | ||
|
||
BOOST_AUTO_TEST_CASE(GetTimelockToString) | ||
{ | ||
BOOST_CHECK_EQUAL(CMasternode::GetTimelockToString(CMasternode::ZEROYEAR), "NONE"); | ||
BOOST_CHECK_EQUAL(CMasternode::GetTimelockToString(CMasternode::FIVEYEAR), "FIVEYEARTIMELOCK"); | ||
BOOST_CHECK_EQUAL(CMasternode::GetTimelockToString(CMasternode::TENYEAR), "TENYEARTIMELOCK"); | ||
|
||
// from unit16_t | ||
BOOST_CHECK_EQUAL(CMasternode::GetTimelockToString(static_cast<CMasternode::TimeLock>(uint16_t {0})), "NONE"); | ||
BOOST_CHECK_EQUAL(CMasternode::GetTimelockToString(static_cast<CMasternode::TimeLock>(uint16_t {260})), "FIVEYEARTIMELOCK"); | ||
BOOST_CHECK_EQUAL(CMasternode::GetTimelockToString(static_cast<CMasternode::TimeLock>(uint16_t {520})), "TENYEARTIMELOCK"); | ||
} | ||
|
||
BOOST_AUTO_TEST_SUITE_END() |