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

name_pending Qt GUI #406

Merged
merged 2 commits into from
Apr 15, 2021
Merged

name_pending Qt GUI #406

merged 2 commits into from
Apr 15, 2021

Conversation

JeremyRand
Copy link
Member

@JeremyRand JeremyRand commented Jan 29, 2021

This PR adds the name_pending GUI, and also adds the GUI for the ismine and expired fields in name_list.

@JeremyRand
Copy link
Member Author

@randy-waterhouse You may be interested in reviewing this.

@JeremyRand JeremyRand force-pushed the qt-name-pending branch 2 times, most recently from 1b9fd38 to 18fd8fd Compare January 30, 2021 13:57
@JeremyRand JeremyRand changed the title (WIP) name_pending Qt GUI name_pending Qt GUI Jan 30, 2021
@JeremyRand
Copy link
Member Author

@domob1812 This PR is ready for review.

Copy link

@domob1812 domob1812 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks very good. Just a few remarks as usual.

vNamesO[name] = NameTableEntry(name, data, height, expiresIn, "confirmed");

bool isMine = find_value ( v, "ismine").get_bool();
bool isExpired = find_value ( v, "expired").get_bool();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Please make them const. Also the whitespace is again weird, but I see it matches the lines above.

std::string data = maybeData.get_str();

bool isMine = find_value ( v, "ismine").get_bool();
std::string op = find_value ( v, "op").get_str();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the variables above can be const, right?

bool isMine = find_value ( v, "ismine").get_bool();
std::string op = find_value ( v, "op").get_str();

auto confirmedEntryExists = vNamesO.count(name);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would suggest to explicitly use const bool as the type. This makes the intent of the code more explicit, is not any longer, and in fact explicitly makes the value bool instead of an integer.

int expiresIn = 0;
std::string status;

if (!confirmedEntryExists)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional nit: I think it helps code readability in general if negative conditions are avoided as much as possible. In this case, you have both an "if" and an "else" clause. So I would suggest to swap the two, so that the if is for the positive confirmedEntryExists.

status = NameTableEntry::NAME_STATUS_INCOMING_TRANSFER_PENDING;
}
}
else if (confirmedStatus == "Confirmed")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we have constants for all the status strings but not "Confirmed"?

@JeremyRand
Copy link
Member Author

@domob1812 Feedback addressed; feel free to review again. Let me know if/when it's approved and I'll squash before you merge it.

@JeremyRand
Copy link
Member Author

@domob1812 Any chance you could review this?

@domob1812
Copy link

ACK 769090e. Please squash and then I'll merge the PR.

@JeremyRand
Copy link
Member Author

@domob1812 Squashed. (Left the name_list and name_pending components as distinct commits since each is atomic.)

@domob1812 domob1812 merged commit f6cbc82 into namecoin:master Apr 15, 2021
@domob1812
Copy link

Merged, thanks!

@domob1812 domob1812 added this to the nc0.22 milestone May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants