Skip to content

Commit faa6179

Browse files
committed
docs: move comments from the old code to the new implementation of governance RPC
1 parent 39cd5e4 commit faa6179

File tree

1 file changed

+12
-53
lines changed

1 file changed

+12
-53
lines changed

src/rpc/governance.cpp

Lines changed: 12 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static RPCHelpMan gobject_count()
5555
};
5656
}
5757

58+
// DEBUG : TEST DESERIALIZATION OF GOVERNANCE META DATA
5859
static RPCHelpMan gobject_deserialize()
5960
{
6061
return RPCHelpMan{"gobject deserialize",
@@ -79,6 +80,7 @@ static RPCHelpMan gobject_deserialize()
7980
};
8081
}
8182

83+
// VALIDATE A GOVERNANCE OBJECT PRIOR TO SUBMISSION
8284
static RPCHelpMan gobject_check()
8385
{
8486
return RPCHelpMan{"gobject check",
@@ -120,6 +122,7 @@ static RPCHelpMan gobject_check()
120122
}
121123

122124
#ifdef ENABLE_WALLET
125+
// PREPARE THE GOVERNANCE OBJECT BY CREATING A COLLATERAL TRANSACTION
123126
static RPCHelpMan gobject_prepare()
124127
{
125128
return RPCHelpMan{"gobject prepare",
@@ -276,6 +279,12 @@ static RPCHelpMan gobject_list_prepared()
276279
}
277280
#endif // ENABLE_WALLET
278281

282+
// AFTER COLLATERAL TRANSACTION HAS MATURED USER CAN SUBMIT GOVERNANCE OBJECT TO PROPAGATE NETWORK
283+
/*
284+
------ Example Governance Item ------
285+
286+
gobject submit 6e622bb41bad1fb18e7f23ae96770aeb33129e18bd9efe790522488e580a0a03 0 1 1464292854 "beer-reimbursement" 5b5b22636f6e7472616374222c207b2270726f6a6563745f6e616d65223a20225c22626565722d7265696d62757273656d656e745c22222c20227061796d656e745f61646472657373223a20225c225879324c4b4a4a64655178657948726e34744744514238626a6876464564615576375c22222c2022656e645f64617465223a202231343936333030343030222c20226465736372697074696f6e5f75726c223a20225c227777772e646173687768616c652e6f72672f702f626565722d7265696d62757273656d656e745c22222c2022636f6e74726163745f75726c223a20225c22626565722d7265696d62757273656d656e742e636f6d2f3030312e7064665c22222c20227061796d656e745f616d6f756e74223a20223233342e323334323232222c2022676f7665726e616e63655f6f626a6563745f6964223a2037342c202273746172745f64617465223a202231343833323534303030227d5d5d1
287+
*/
279288
static RPCHelpMan gobject_submit()
280289
{
281290
return RPCHelpMan{"gobject submit",
@@ -646,6 +655,7 @@ static UniValue ListObjects(CGovernanceManager& govman, const CDeterministicMNLi
646655
return objResult;
647656
}
648657

658+
// USERS CAN QUERY THE SYSTEM FOR A LIST OF VARIOUS GOVERNANCE ITEMS
649659
static RPCHelpMan gobject_list()
650660
{
651661
return RPCHelpMan{"gobject list",
@@ -717,6 +727,7 @@ static RPCHelpMan gobject_diff()
717727
};
718728
}
719729

730+
// GET SPECIFIC GOVERNANCE ENTRY
720731
static RPCHelpMan gobject_get()
721732
{
722733
return RPCHelpMan{"gobject get",
@@ -810,6 +821,7 @@ static RPCHelpMan gobject_get()
810821
};
811822
}
812823

824+
// GET VOTES FOR SPECIFIC GOVERNANCE OBJECT
813825
static RPCHelpMan gobject_getcurrentvotes()
814826
{
815827
return RPCHelpMan{"gobject getcurrentvotes",
@@ -895,59 +907,6 @@ static RPCHelpMan gobject()
895907
};
896908
}
897909

898-
/*
899-
static UniValue gobject(const JSONRPCRequest& request)
900-
{
901-
const JSONRPCRequest new_request{request.strMethod == "gobject" ? request.squashed() : request};
902-
const std::string command{new_request.strMethod};
903-
904-
if (command == "gobjectcount") {
905-
return gobject_count(new_request);
906-
} else if (command == "gobjectdeserialize") {
907-
// DEBUG : TEST DESERIALIZATION OF GOVERNANCE META DATA
908-
return gobject_deserialize(new_request);
909-
} else if (command == "gobjectcheck") {
910-
// VALIDATE A GOVERNANCE OBJECT PRIOR TO SUBMISSION
911-
return gobject_check(new_request);
912-
#ifdef ENABLE_WALLET
913-
} else if (command == "gobjectprepare") {
914-
// PREPARE THE GOVERNANCE OBJECT BY CREATING A COLLATERAL TRANSACTION
915-
return gobject_prepare(new_request);
916-
} else if (command == "gobjectlist-prepared") {
917-
return gobject_list_prepared(new_request);
918-
#endif // ENABLE_WALLET
919-
} else if (command == "gobjectsubmit") {
920-
// AFTER COLLATERAL TRANSACTION HAS MATURED USER CAN SUBMIT GOVERNANCE OBJECT TO PROPAGATE NETWORK
921-
/*
922-
------ Example Governance Item ------
923-
924-
gobject submit 6e622bb41bad1fb18e7f23ae96770aeb33129e18bd9efe790522488e580a0a03 0 1 1464292854 "beer-reimbursement" 5b5b22636f6e7472616374222c207b2270726f6a6563745f6e616d65223a20225c22626565722d7265696d62757273656d656e745c22222c20227061796d656e745f61646472657373223a20225c225879324c4b4a4a64655178657948726e34744744514238626a6876464564615576375c22222c2022656e645f64617465223a202231343936333030343030222c20226465736372697074696f6e5f75726c223a20225c227777772e646173687768616c652e6f72672f702f626565722d7265696d62757273656d656e745c22222c2022636f6e74726163745f75726c223a20225c22626565722d7265696d62757273656d656e742e636f6d2f3030312e7064665c22222c20227061796d656e745f616d6f756e74223a20223233342e323334323232222c2022676f7665726e616e63655f6f626a6563745f6964223a2037342c202273746172745f64617465223a202231343833323534303030227d5d5d1
925-
*/
926-
/*
927-
return gobject_submit(new_request);
928-
#ifdef ENABLE_WALLET
929-
} else if (command == "gobjectvote-many") {
930-
return gobject_vote_many(new_request);
931-
} else if (command == "gobjectvote-alias") {
932-
return gobject_vote_alias(new_request);
933-
#endif
934-
} else if (command == "gobjectlist") {
935-
// USERS CAN QUERY THE SYSTEM FOR A LIST OF VARIOUS GOVERNANCE ITEMS
936-
return gobject_list(new_request);
937-
} else if (command == "gobjectdiff") {
938-
return gobject_diff(new_request);
939-
} else if (command == "gobjectget") {
940-
// GET SPECIFIC GOVERNANCE ENTRY
941-
return gobject_get(new_request);
942-
} else if (command == "gobjectgetcurrentvotes") {
943-
// GET VOTES FOR SPECIFIC GOVERNANCE OBJECT
944-
return gobject_getcurrentvotes(new_request);
945-
} else {
946-
gobject_help();
947-
}
948-
}
949-
*/
950-
951910
static UniValue voteraw(const JSONRPCRequest& request)
952911
{
953912
RPCHelpMan{"voteraw",

0 commit comments

Comments
 (0)