Skip to content

Gov cleanup + copyright bump#2324

Merged
UdjinM6 merged 15 commits into
dashpay:developfrom
PastaPastaPasta:gov-cleanup
Sep 28, 2018
Merged

Gov cleanup + copyright bump#2324
UdjinM6 merged 15 commits into
dashpay:developfrom
PastaPastaPasta:gov-cleanup

Conversation

@PastaPastaPasta
Copy link
Copy Markdown
Member

Clang formatting based, with a few manual changes

Copy link
Copy Markdown

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

Nice :) Noticed a couple of places where some manual fixing/refactoring could be a good idea, see inline comments.

Comment thread src/governance-classes.cpp Outdated
<< strDataAsPlainString
<< std::endl;
);
} std::cout
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This part is weird.

Comment thread src/governance-object.cpp Outdated
return true;
}
case GOVERNANCE_OBJECT_TRIGGER: {
if (!fCheckCollateral)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's add braces while at it.

Comment thread src/governance-vote.cpp
switch (nOutcome) {
case VOTE_OUTCOME_NONE:
return "NONE";
break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Interesting.. break;s make no sense here..

Comment thread src/governance-vote.cpp
break;
switch (nSignal) {
case VOTE_SIGNAL_NONE:
strReturn = "NONE";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sigh... Two similar functions, two different approaches... And both could actually be refactored/simplified to work the way ConvertVoteSignal does it.

Comment thread src/governance.cpp Outdated
case MSG_GOVERNANCE_OBJECT_VOTE:
{
if(cmapVoteToObject.HasKey(inv.hash)) {
} break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's move this break; inside (i.e. smth like s/} break;/break;\n }/).

Comment thread src/governance.cpp Outdated
}
}
break;
} break;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

same

Comment thread src/governance.cpp Outdated

if (fUpdateFailStatus)
it->second.fStatusOK = false;
if (fUpdateFailStatus) it->second.fStatusOK = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd rather add braces in original code here.

@PastaPastaPasta
Copy link
Copy Markdown
Member Author

PastaPastaPasta commented Sep 27, 2018

@UdjinM6 resolved comments, specifically take a look at 41bc3d3 could be a prob in that one
Looking at that commit, should those strings be capitalized or not? Some where some wheren't rn all aren't

@UdjinM6 UdjinM6 added this to the 12.4 milestone Sep 27, 2018
Copy link
Copy Markdown

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

I wasn't able to find any place where enum->string conversion results were used besides some log messages. I think the reason for uppercase was to make them easily grep-able when debugging. In any case, this changes the functionality, so doesn't quite qualify for refactoring and we shouldn't mix the two. IMO should keep enum->string conversion (SmthToString()) results uppercase as they were, they could be adjusted in future PRs if needed (StringToSmth() input strings should be kept lowercase).

Also, found one unused function which can be dropped, see inline comments.

Comment thread src/governance-vote.h Outdated
void Relay(CConnman& connman) const;

std::string GetVoteString() const {
std::string GetVoteString() const
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks like this function is not used anywhere at all. Can be dropped imo.

@PastaPastaPasta
Copy link
Copy Markdown
Member Author

Yeah, I expected us not to want that commit in this pr. Dropped that function. Re-review

Copy link
Copy Markdown

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

Looks good 👍

utACK

@UdjinM6 UdjinM6 merged commit ee6a5a3 into dashpay:develop Sep 28, 2018
@PastaPastaPasta PastaPastaPasta deleted the gov-cleanup branch November 22, 2018 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants