Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename getadjustednetworkweight to getestimatedannualroi #785

Merged
merged 1 commit into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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