-
Notifications
You must be signed in to change notification settings - Fork 183
Remove/merge redundant RPC calls #1232
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
Remove/merge redundant RPC calls #1232
Conversation
Regarding
So the output should look something like:
I think that should retain the information people want from the existing commands. After that we can remove Edit: We might not even need to show the RAC here. |
Agree with @denravonska , that is some nice output. |
will redo that* |
src/rpcblockchain.cpp
Outdated
@@ -2242,6 +1897,28 @@ UniValue projects(const UniValue& params, bool fHelp) | |||
entry.pushKV("Project", sProjectName); | |||
entry.pushKV("URL", sProjectURL); | |||
|
|||
if (mvCPIDs.size() > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small changes:
- Change size check to
mvCPIDs.empty()
. Same when doingHarvestCPIDs
. - Do a find (like this) on mvCPIDs or else we insert an element if it was missing before.
- Merge the
structcpid.initialized
check with theIsResearcher
checks below it to remove one depth.
@@ -1422,34 +1241,6 @@ UniValue magnitude(const UniValue& params, bool fHelp) | |||
return results; | |||
} | |||
|
|||
UniValue mymagnitude(const UniValue& params, bool fHelp) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make magnitude
default to the user's current CPID now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so rename that to magnitude and simply display the magnitude of the user (current user in msPrimaryCPID?)
and cpid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can reuse the current magnitude
:) Just make it default to msPrimaryCPID
if the user doesn't specify one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lost train on thought of where this one was to be changed since mymagnitude is removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added it to magnitude report. maybe that will satisfy instead of re adding this rpc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking we change magnitude
to default to the user's CPID:
Change
std::string cpid;
if (params.size() > 0)
cpid = params[0].get_str();
to
const std::string cpid = !params.empty()
? params[0]
: msPrimaryCPID;
if(cpid.empty())
throw... something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh so revive magnitude to have this information then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magnitude
was never axed. We have magnitude
which allows you to specify a CPID, and mymagnitude
which is exactly the same but works on msPrimaryCPID
(?). We can merge this to make magniude
work on any specified CPID, or fall back to msPrimaryCPID
if none is specified.
|
||
res.pushKV("RSA Weight", RSAWEIGHT); | ||
res.pushKV("Magnitude", out_magnitude); | ||
res.pushKV("RSA Owed", out_owed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge the owed field into MagnitudeReport
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its untrustedmagnitude here. does the fulfillment in MagnitudeReport not more accurate?
// Fulfillment %
double fulfilled = ((structMag.payments/14) / ((dExpected14/14)+.01)) * 100;
entry.pushKV("Fulfillment %", fulfilled);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could figure out difference and name is estimated rsa owed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's just for display we can use "owed": structMag.owed
. I think.
Can/Would you please change PR name to something more descriptive? |
Issue #1228