Skip to content

Commit

Permalink
Rename mint & burn to convertPublicToPrivate &convertPrivateToPrivate (
Browse files Browse the repository at this point in the history
…#2871)

* Rename mint and burn to convertPublicToPrivate and convertPrivateToPrivate respectively

* address reviews
  • Loading branch information
Yehonatan Buchnik authored Nov 23, 2022
1 parent f2af0ec commit 9a23edc
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions utt/wallet-cli/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@
void printHelp() {
std::cout << "\nCommands:\n";
std::cout << "config -- configures wallets with the privacy application.\n";
std::cout << "show -- prints information about the user managed by this wallet\n";
std::cout << "register <user-id> -- requests user registration required for spending coins\n";
std::cout << "mint <amount> -- mint the requested amount of public funds.\n";
std::cout << "show -- prints information about the user managed by this wallet.\n";
std::cout << "register <user-id> -- requests user registration required for spending coins.\n";
std::cout << "convertPublicToPrivate <amount> -- converts the specified amount of public funds to "
"private funds.\n";
std::cout << "transfer <amount> <to-user-id> -- transfers the specified amount between users.\n";
std::cout
<< "public-transfer <amount> <to-user-id> -- transfers the specified amount of public funds between users.\n";
std::cout << "burn <amount> -- burns the specified amount of private funds to public funds.\n";
std::cout << "convertPrivateToPublic <amount> -- converts the specified amount of private funds to "
"public funds.\n";
std::cout << '\n';
}

Expand Down Expand Up @@ -113,12 +115,12 @@ struct CLIApp {

void mintCmd(const std::vector<std::string>& cmdTokens) {
if (cmdTokens.size() != 2) {
std::cout << "Usage: mint <amount>\n";
std::cout << "Usage: convertPublicToPrivate <amount>\n";
return;
}
int amount = std::atoi(cmdTokens[1].c_str());
if (amount <= 0) {
std::cout << "Expected a positive mint amount!\n";
std::cout << "Expected a positive public funds amount!\n";
return;
}
wallet->mint(chan, (uint64_t)amount);
Expand Down Expand Up @@ -155,12 +157,12 @@ struct CLIApp {

void burnCmd(const std::vector<std::string>& cmdTokens) {
if (cmdTokens.size() != 2) {
std::cout << "Usage: burn <amount>\n";
std::cout << "Usage: convertPrivateToPublic <amount>\n";
return;
}
int amount = std::atoi(cmdTokens[1].c_str());
if (amount <= 0) {
std::cout << "Expected a positive burn amount!\n";
std::cout << "Expected a positive private funds amount!\n";
return;
}
wallet->burn(chan, (uint64_t)amount);
Expand Down Expand Up @@ -227,13 +229,13 @@ int main(int argc, char* argv[]) {
std::cout << "You must first register the user. Use the 'register' command.\n";
} else if (cmdTokens[0] == "show") {
app.showCmd();
} else if (cmdTokens[0] == "mint") {
} else if (cmdTokens[0] == "convertPublicToPrivate") {
app.mintCmd(cmdTokens);
} else if (cmdTokens[0] == "transfer") {
app.transferCmd(cmdTokens);
} else if (cmdTokens[0] == "public-transfer") {
app.publicTransferCmd(cmdTokens);
} else if (cmdTokens[0] == "burn") {
} else if (cmdTokens[0] == "convertPrivateToPublic") {
app.burnCmd(cmdTokens);
} else if (cmdTokens[0] == "debug") {
app.debugCmd();
Expand Down

0 comments on commit 9a23edc

Please sign in to comment.