Skip to content

Commit

Permalink
Merge pull request #785 from qtumproject/time/renameroi
Browse files Browse the repository at this point in the history
Rename getadjustednetworkweight to getestimatedannualroi
  • Loading branch information
qtum-neil committed Nov 20, 2019
2 parents 29c45fa + e9f32eb commit fea659b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/interfaces/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ class NodeImpl : public Node
LOCK(::cs_main);
return GetPoSKernelPS();
}
double getAdjustedNetworkWeight() override
double getEstimatedAnnualROI() override
{
LOCK(::cs_main);
return GetAdjustedNetworkWeight();
return GetEstimatedAnnualROI();
}
int64_t getMoneySupply() override
{
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ class Node
//! Get the network stake weight
virtual uint64_t getNetworkStakeWeight() = 0;

//! Get the adjusted network weight
virtual double getAdjustedNetworkWeight() = 0;
//! Get the estimated annual roi
virtual double getEstimatedAnnualROI() = 0;

//! Get the money supply
virtual int64_t getMoneySupply() = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/qt/stakepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void StakePage::setClientModel(ClientModel *_clientModel)
ui->labelHeight->setText(QString::number(height));
m_subsidy = _clientModel->node().getBlockSubsidy(height);
m_networkWeight = _clientModel->node().getNetworkStakeWeight();
m_expectedAnnualROI = _clientModel->node().getAdjustedNetworkWeight();
m_expectedAnnualROI = _clientModel->node().getEstimatedAnnualROI();
updateNetworkWeight();
updateAnnualROI();
}
Expand Down Expand Up @@ -120,7 +120,7 @@ void StakePage::numBlocksChanged(int count, const QDateTime &, double, bool head
ui->labelHeight->setText(BitcoinUnits::formatInt(count));
m_subsidy = clientModel->node().getBlockSubsidy(count);
m_networkWeight = clientModel->node().getNetworkStakeWeight();
m_expectedAnnualROI = clientModel->node().getAdjustedNetworkWeight();
m_expectedAnnualROI = clientModel->node().getEstimatedAnnualROI();
updateSubsidy();
updateNetworkWeight();
updateAnnualROI();
Expand Down
18 changes: 9 additions & 9 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ double GetPoSKernelPS()
return result;
}

double GetAdjustedNetworkWeight()
double GetEstimatedAnnualROI()
{
double result = 0;
double networkWeight = GetPoSKernelPS();
Expand Down Expand Up @@ -305,24 +305,24 @@ UniValue transactionReceiptToJSON(const dev::eth::TransactionReceipt& txRec)
}
////////////////////////////////////////////////////////////////////////////

static UniValue getadjustednetworkweight(const JSONRPCRequest& request)
static UniValue getestimatedannualroi(const JSONRPCRequest& request)
{
if (request.fHelp || request.params.size() != 0)
throw std::runtime_error(
RPCHelpMan{"getadjustednetworkweight",
"\nReturns the adjusted network weight.\n",
RPCHelpMan{"getestimatedannualroi",
"\nReturns the estimated annual roi.\n",
{},
RPCResult{
"n (numeric) The current adjusted network weight\n"
"n (numeric) The current estimated annual roi\n"
},
RPCExamples{
HelpExampleCli("getadjustednetworkweight", "")
+ HelpExampleRpc("getadjustednetworkweight", "")
HelpExampleCli("getestimatedannualroi", "")
+ HelpExampleRpc("getestimatedannualroi", "")
},
}.ToString());

LOCK(cs_main);
return GetAdjustedNetworkWeight();
return GetEstimatedAnnualROI();
}

static UniValue getblockcount(const JSONRPCRequest& request)
Expand Down Expand Up @@ -3402,7 +3402,7 @@ static const CRPCCommand commands[] =
{ "blockchain", "searchlogs", &searchlogs, {"fromBlock", "toBlock", "address", "topics"} },

{ "blockchain", "waitforlogs", &waitforlogs, {"fromBlock", "nblocks", "address", "topics"} },
{ "blockchain", "getadjustednetworkweight", &getadjustednetworkweight, {} },
{ "blockchain", "getestimatedannualroi", &getestimatedannualroi, {} },
};
// clang-format on

Expand Down
2 changes: 1 addition & 1 deletion src/rpc/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ extern std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKe
extern CAmount AmountFromValue(const UniValue& value);
extern double GetPoWMHashPS();
extern double GetPoSKernelPS();
extern double GetAdjustedNetworkWeight();
extern double GetEstimatedAnnualROI();
extern std::string HelpExampleCli(const std::string& methodname, const std::string& args);
extern std::string HelpExampleRpc(const std::string& methodname, const std::string& args);

Expand Down

0 comments on commit fea659b

Please sign in to comment.