cleaned up naming of budget functions

This commit is contained in:
Evan Duffield 2015-05-27 10:11:00 -07:00
parent 41eb74dc82
commit 66dcf6bbc7
3 changed files with 10 additions and 13 deletions

View File

@ -639,12 +639,12 @@ int CBudgetProposal::GetBlockEndCycle()
return nBlockEnd-(GetBudgetPaymentCycleBlocks()/2); return nBlockEnd-(GetBudgetPaymentCycleBlocks()/2);
} }
int CBudgetProposal::GetPaymentCountTotal() int CBudgetProposal::GetTotalPaymentCount()
{ {
return (GetBlockEndCycle()-GetBlockStartCycle())/GetBudgetPaymentCycleBlocks(); return (GetBlockEndCycle()-GetBlockStartCycle())/GetBudgetPaymentCycleBlocks();
} }
int CBudgetProposal::GetPaymentCountLeft() int CBudgetProposal::GetRemainingPaymentCount()
{ {
return (GetBlockEndCycle()-GetBlockCurrentCycle())/GetBudgetPaymentCycleBlocks(); return (GetBlockEndCycle()-GetBlockCurrentCycle())/GetBudgetPaymentCycleBlocks();
} }

View File

@ -321,8 +321,8 @@ public:
int GetBlockStart() {return nBlockStart;} int GetBlockStart() {return nBlockStart;}
int GetBlockEnd() {return nBlockEnd;} int GetBlockEnd() {return nBlockEnd;}
CScript GetPayee() {return address;} CScript GetPayee() {return address;}
int GetPaymentCountTotal(); int GetTotalPaymentCount();
int GetPaymentCountLeft(); int GetRemainingPaymentCount();
int GetBlockStartCycle(); int GetBlockStartCycle();
int GetBlockCurrentCycle(); int GetBlockCurrentCycle();
int GetBlockEndCycle(); int GetBlockEndCycle();

View File

@ -47,7 +47,7 @@ Value mnbudget(const Array& params, bool fHelp)
mnEntries = masternodeConfig.getEntries(); mnEntries = masternodeConfig.getEntries();
if (params.size() != 8) if (params.size() != 8)
throw runtime_error("Correct usage of vote-many is 'mnbudget vote-many PROPOSAL-NAME URL PAYMENT_COUNT BLOCK_START DASH_ADDRESS USD_AMOUNT YES|NO|ABSTAIN'"); throw runtime_error("Correct usage of vote-many is 'mnbudget vote-many PROPOSAL-NAME URL PAYMENT_COUNT BLOCK_START DASH_ADDRESS DASH_AMOUNT YES|NO|ABSTAIN'");
std::string strProposalName = params[1].get_str(); std::string strProposalName = params[1].get_str();
if(strProposalName.size() > 20) if(strProposalName.size() > 20)
@ -143,7 +143,7 @@ Value mnbudget(const Array& params, bool fHelp)
mnEntries = masternodeConfig.getEntries(); mnEntries = masternodeConfig.getEntries();
if (params.size() != 8) if (params.size() != 8)
throw runtime_error("Correct usage of vote-many is 'mnbudget vote PROPOSAL-NAME URL PAYMENT_COUNT BLOCK_START DASH_ADDRESS USD_AMOUNT YES|NO|ABSTAIN'"); throw runtime_error("Correct usage of vote-many is 'mnbudget vote PROPOSAL-NAME URL PAYMENT_COUNT BLOCK_START DASH_ADDRESS DASH_AMOUNT YES|NO|ABSTAIN'");
std::string strProposalName = params[1].get_str(); std::string strProposalName = params[1].get_str();
if(strProposalName.size() > 20) if(strProposalName.size() > 20)
@ -226,8 +226,8 @@ Value mnbudget(const Array& params, bool fHelp)
bObj.push_back(Pair("Hash", prop->GetHash().ToString().c_str())); bObj.push_back(Pair("Hash", prop->GetHash().ToString().c_str()));
bObj.push_back(Pair("BlockStart", (int64_t)prop->GetBlockStart())); bObj.push_back(Pair("BlockStart", (int64_t)prop->GetBlockStart()));
bObj.push_back(Pair("BlockEnd", (int64_t)prop->GetBlockEnd())); bObj.push_back(Pair("BlockEnd", (int64_t)prop->GetBlockEnd()));
bObj.push_back(Pair("PaymentCountTotal", (int64_t)prop->GetPaymentCountTotal())); bObj.push_back(Pair("TotalPaymentCount", (int64_t)prop->GetTotalPaymentCount()));
bObj.push_back(Pair("PaymentCountLeft", (int64_t)prop->GetPaymentCountLeft())); bObj.push_back(Pair("RemainingPaymentCount", (int64_t)prop->GetRemainingPaymentCount()));
bObj.push_back(Pair("PaymentAddress", address2.ToString().c_str())); bObj.push_back(Pair("PaymentAddress", address2.ToString().c_str()));
bObj.push_back(Pair("Ratio", prop->GetRatio())); bObj.push_back(Pair("Ratio", prop->GetRatio()));
bObj.push_back(Pair("Yeas", (int64_t)prop->GetYeas())); bObj.push_back(Pair("Yeas", (int64_t)prop->GetYeas()));
@ -262,8 +262,8 @@ Value mnbudget(const Array& params, bool fHelp)
obj.push_back(Pair("URL", prop->GetURL().c_str())); obj.push_back(Pair("URL", prop->GetURL().c_str()));
obj.push_back(Pair("BlockStart", (int64_t)prop->GetBlockStart())); obj.push_back(Pair("BlockStart", (int64_t)prop->GetBlockStart()));
obj.push_back(Pair("BlockEnd", (int64_t)prop->GetBlockEnd())); obj.push_back(Pair("BlockEnd", (int64_t)prop->GetBlockEnd()));
obj.push_back(Pair("PaymentCountTotal", (int64_t)prop->GetPaymentCountTotal())); obj.push_back(Pair("TotalPaymentCount", (int64_t)prop->GetTotalPaymentCount()));
obj.push_back(Pair("PaymentCountLeft", (int64_t)prop->GetPaymentCountLeft())); obj.push_back(Pair("RemainingPaymentCount", (int64_t)prop->GetRemainingPaymentCount()));
obj.push_back(Pair("PaymentAddress", address2.ToString().c_str())); obj.push_back(Pair("PaymentAddress", address2.ToString().c_str()));
obj.push_back(Pair("Ratio", prop->GetRatio())); obj.push_back(Pair("Ratio", prop->GetRatio()));
obj.push_back(Pair("Yeas", (int64_t)prop->GetYeas())); obj.push_back(Pair("Yeas", (int64_t)prop->GetYeas()));
@ -469,12 +469,9 @@ Value mnfinalbudget(const Array& params, bool fHelp)
{ {
Object resultObj; Object resultObj;
printf("1\n");
std::vector<CFinalizedBudget*> winningFbs = budget.GetFinalizedBudgets(); std::vector<CFinalizedBudget*> winningFbs = budget.GetFinalizedBudgets();
BOOST_FOREACH(CFinalizedBudget* prop, winningFbs) BOOST_FOREACH(CFinalizedBudget* prop, winningFbs)
{ {
printf("2\n");
Object bObj; Object bObj;
bObj.push_back(Pair("SubmittedBy", prop->GetSubmittedBy().c_str())); bObj.push_back(Pair("SubmittedBy", prop->GetSubmittedBy().c_str()));
bObj.push_back(Pair("Hash", prop->GetHash().ToString().c_str())); bObj.push_back(Pair("Hash", prop->GetHash().ToString().c_str()));