-
Notifications
You must be signed in to change notification settings - Fork 649
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
Change address constructors to explicit #1151
Conversation
The equality operator here boils down to a memcmp of the 2 ripemd160 hashes. Are you attempting to replace the GRAPHENE_ASSERT with something else? What would you suggest they be replaced with? Perhaps I am misunderstanding why you are questioning whether it is good to have the equality operators. |
My question was: does it make sense to compare a |
As mentioned on Telegram, I'm undecided if we should merge this in the upcoming release. I generally think explicit constructors are better, because that avoids surprising automatic conversion. OTOH making existing constructors explicit can have surprising side effects, so the change is a bit dangerous. |
Surprising side-effects could be avoided by changing all one-argument constructors to explicit. |
Makes sense. I've removed it from this milestone. |
Is there a desire to revisit this PR for the 201810 Feature Release? |
Like I said, we should make all one-arg constructors explicit in one go. But I think we have more important stuff and little time for the next release, so I'd drop it from this one. |
Moving to next milestone. |
@pmconrad Sorry, my meeting notes are lacking, so request you comment here with proper instructions for this PR. This is what I captured: "recommendation for now until we decide how to do all explicit constructors" |
See my comment above - merging this now could have unforeseeable side effects. Better to switch all one-arg constructors to |
Resolved conflicts: - libraries/chain/include/graphene/chain/protocol/types.hpp - libraries/chain/protocol/types.cpp - libraries/protocol/include/graphene/protocol/address.hpp - libraries/wallet/wallet.cpp
Kudos, SonarCloud Quality Gate passed! |
This PR is mainly for making clear how public keys are being ordered in the system, aka explicitly implement
and make sure it's backward-compatible (convert the public keys to addresses and compare the addresses).
More info is here: cryptonomex/graphene#630 (comment) .
The
==
operators are mainly used in balance_evaluator.cpp, actually I'm not sure whether it's good to have them (does it make sense to compare a pts_address with an address, or compare a public key to an address?), please advise.bitshares-core/libraries/chain/balance_evaluator.cpp
Lines 33 to 38 in 76ab28e