mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
commit
212015e2e0
@ -5840,12 +5840,15 @@ public:
|
||||
*/
|
||||
|
||||
|
||||
void CDarkSendPool::SetCollateralAddress(std::string strAddress){
|
||||
bool CDarkSendPool::SetCollateralAddress(std::string strAddress){
|
||||
CBitcoinAddress address;
|
||||
if (!address.SetString(strAddress))
|
||||
{
|
||||
printf("CDarkSendPool::SetCollateralAddress - Invalid DarkSend collateral address\n");
|
||||
|
||||
return false;
|
||||
}
|
||||
collateralPubKey.SetDestination(address.Get());
|
||||
return true;
|
||||
}
|
||||
|
||||
//Get last block hash
|
||||
|
@ -2516,7 +2516,7 @@ public:
|
||||
SetCollateralAddress(strAddress);
|
||||
}
|
||||
|
||||
void SetCollateralAddress(std::string strAddress);
|
||||
bool SetCollateralAddress(std::string strAddress);
|
||||
bool GetLastValidBlockHash(uint256& hash, int mod=10);
|
||||
int GetCurrentMasterNode(int mod=10);
|
||||
void NewBlock();
|
||||
|
@ -27,6 +27,36 @@ BOOST_AUTO_TEST_CASE(darksend_sign)
|
||||
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(set_collateral_address_bad)
|
||||
{
|
||||
CDarkSendPool * dsp_ptr = new CDarkSendPool();
|
||||
|
||||
string crappy = "badaddress";
|
||||
|
||||
BOOST_CHECK( dsp_ptr->SetCollateralAddress(crappy) == false );
|
||||
delete dsp_ptr;
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(set_collateral_address_production)
|
||||
{
|
||||
CDarkSendPool * dsp_ptr = new CDarkSendPool();
|
||||
|
||||
string prod = "Xq19GqFvajRrEdDHYRKGYjTsQfpV5jyipF";
|
||||
|
||||
BOOST_CHECK( dsp_ptr->SetCollateralAddress(prod) == true );
|
||||
delete dsp_ptr;
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(set_collateral_address_testnet)
|
||||
{
|
||||
CDarkSendPool * dsp_ptr = new CDarkSendPool();
|
||||
|
||||
string testnet = "mxE2Rp3oYpSEFdsN5TdHWhZvEHm3PJQQVm";
|
||||
|
||||
BOOST_CHECK( dsp_ptr->SetCollateralAddress(testnet) == true );
|
||||
delete dsp_ptr;
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(darksend_vote)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user