scripted-diff: Use scoped enumerations (C++11, “enum class”) #10742

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:scoped-enums changing 38 files +295 −295
  1. practicalswift commented at 3:48 pm on July 4, 2017: contributor

    Rationale (from Bjarne Stroustrup’s “C++11 FAQ”):

    The enum classes (“new enums”, “strong enums”) address three problems with traditional C++ enumerations:

    • conventional enums implicitly convert to int, causing errors when someone does not want an enumeration to act as an integer.
    • conventional enums export their enumerators to the surrounding scope, causing name clashes.
    • the underlying type of an enum cannot be specified, causing confusion, compatibility problems, and makes forward declaration impossible.

    The new enums are “enum class” because they combine aspects of traditional enumerations (names values) with aspects of classes (scoped members and absence of conversions).

  2. practicalswift force-pushed on Jul 4, 2017
  3. practicalswift force-pushed on Jul 4, 2017
  4. fanquake added the label Refactoring on Jul 5, 2017
  5. in src/rpc/protocol.h:32 in 4602120ea3 outdated
    28@@ -29,7 +29,7 @@ enum HTTPStatusCode
    29 };
    30 
    31 //! Bitcoin RPC error codes
    32-enum RPCErrorCode
    33+enum class RPCErrorCode
    


    ArielLorenzo-Luaces commented at 7:47 am on July 5, 2017:

    Using strongly typed enums causes RPCErrorCode to be static_casted too often. To gain strongly typed enums we loose readability.

    Especially when considering that a more correct way to cast a strongly typed enum is static_cast<std::underlying_type<RPCErrorCode>::type>(RPCErrorCode::RPC_MISC_ERROR) Which is even more unreadable.

    Instead I suggest forgetting strong typing for this enum but still solve the scoping problem with:

    0class RPCErrorCode
    1{
    2public:
    3    enum
    4    {
    5    ...
    6    }
    7}
    

    luke-jr commented at 8:40 am on July 5, 2017:
    Why not just make JSONRPCError accept a RPCErrorCode argument?

    practicalswift commented at 8:47 am on July 5, 2017:
    @luke-jr Yes, that’s my plan. I’ll push those changes today hopefully :-)

    ArielLorenzo-Luaces commented at 9:22 am on July 5, 2017:

    @luke-jr there would still be a few code == static_cast<int>(RPCErrorCode:: ...). But I agree it’s not that many.

    However changing JSONRPCError is kicking the can down to Pair where the conversion to int has to be done, or down to UniValue. It just seems to me like RPCErrorCode implicitly should be treated like an int since it will almost always be converted into one.


    practicalswift commented at 9:58 am on July 5, 2017:

    @luke-jr @ArielLorenzo-Luaces Signature now changed:

    0-UniValue JSONRPCError(int code, const std::string& message)
    1+UniValue JSONRPCError(RPCErrorCode code, const std::string& message)
    

    Only three static_cast<int>(RPCErrorCode) remain, and since they are explicit they should not cause any surprises (as opposed to implicit conversions).


    ArielLorenzo-Luaces commented at 11:53 pm on July 5, 2017:

    I still think that RPCErrorCode and HTTPStatusCode are intrinsically different than the other enumerators, since they are sent over HTTP. They are also the only two that have explicit values assigned. They should be treated as integers always and they should require no conversion.

    I would have suggested to hide conversion in encode/decode functions. Then the conversion would only have to be done once after receiving an http status. But then I see response.status >= 400 in bitcoin-cli.cpp. This suggests that HTTP status codes are not treated like enumerators and should not be compared to enumerators either.

    RPCErrorCode and HTTPStatusCode should be treated more like macros instead. Strong typing them would case unnecessary complexity due to the casting. But that would only be a problem if they begin to be used much more often, which is speculation on my part. So these changes are fine for now.

  6. ArielLorenzo-Luaces approved
  7. practicalswift force-pushed on Jul 5, 2017
  8. practicalswift force-pushed on Jul 5, 2017
  9. practicalswift force-pushed on Jul 6, 2017
  10. practicalswift force-pushed on Jul 6, 2017
  11. practicalswift force-pushed on Jul 6, 2017
  12. practicalswift force-pushed on Jul 15, 2017
  13. practicalswift force-pushed on Jul 15, 2017
  14. practicalswift commented at 5:38 pm on July 15, 2017: contributor
    Rebased!
  15. practicalswift force-pushed on Jul 17, 2017
  16. practicalswift force-pushed on Jul 17, 2017
  17. practicalswift force-pushed on Jul 18, 2017
  18. practicalswift commented at 4:04 am on July 18, 2017: contributor
    Rebased again! :-)
  19. practicalswift force-pushed on Jul 18, 2017
  20. practicalswift force-pushed on Jul 18, 2017
  21. practicalswift force-pushed on Jul 18, 2017
  22. practicalswift force-pushed on Jul 24, 2017
  23. practicalswift force-pushed on Jul 24, 2017
  24. practicalswift force-pushed on Jul 24, 2017
  25. practicalswift force-pushed on Jul 30, 2017
  26. practicalswift force-pushed on Jul 30, 2017
  27. practicalswift force-pushed on Jul 30, 2017
  28. practicalswift force-pushed on Jul 30, 2017
  29. practicalswift force-pushed on Aug 1, 2017
  30. practicalswift commented at 9:23 am on August 1, 2017: contributor
    Rebased! :-)
  31. practicalswift force-pushed on Aug 1, 2017
  32. practicalswift force-pushed on Aug 3, 2017
  33. practicalswift commented at 1:00 pm on August 3, 2017: contributor
    Anyone willing to review? :-)
  34. promag commented at 1:41 pm on August 3, 2017: member

    @practicalswift commit a338ad0 fails to build. See #10607 (comment).

    What about casting first?

  35. practicalswift commented at 2:23 pm on August 3, 2017: contributor

    @promag Right now casting is done first?

     0*** Commit 1
     1commit f849a1579df933b4ddefc2486e1459831d693b66
     2    Cast from HTTPStatusCode to int where required
     3
     4*** Commit 2
     5commit a338ad0ae69aadc1d0f4d62cfd2e8dae0317c769
     6    scripted-diff: Convert HTTPStatusCode to a scoped enum (C++11)
     7
     8    -BEGIN VERIFY SCRIPT-
     9    sed -i 's/enum HTTPStatusCode/enum class HTTPStatusCode/g' src/rpc/protocol.h
    10    sed -i 's/\(HTTP_OK\|HTTP_BAD_REQUEST\|HTTP_UNAUTHORIZED\|HTTP_FORBIDDEN\|HTTP_NOT_FOUND\|HTTP_BAD_METHOD\|HTTP_INTERNAL_SERVER_ERROR\|HTTP_SERVICE_UNAVAILABLE\)/HTTPStatusCode::\1/g' src/bitcoin-cli.cpp src/httprpc.cpp src/httpserver.cpp src/rest.cpp
    11    sed -i 's/int nStatus/HTTPStatusCode status/g' src/httprpc.cpp
    12    sed -i 's/nStatus/status/g' src/httprpc.cpp
    13    -END VERIFY SCRIPT-
    14
    15*** Commit 3
    16commit b4bc819716981f80108f852c93c245a35159d3a8
    17    Add WriteReply(HTTPStatusCode, ...) in addition to WriteReply(int, ...)
    

    Commits should be atomic if possible, but the combination of a scripted-diff and two dependent manual commits seems be tricky to get atomic. Do you have any suggestions on how to fix it? A unified diff would be ideal :-)

  36. MarcoFalke commented at 2:24 pm on August 3, 2017: member
    Would it be possible to reduce the number of commits, as each of them has to be reviewed separately?
  37. practicalswift force-pushed on Aug 3, 2017
  38. jgarzik commented at 2:32 pm on August 3, 2017: contributor
    This change appears to add a lot of redundancy: It makes that which can be deduced by the compiler explicit at each use site (kinda the opposite of the auto trend).
  39. practicalswift force-pushed on Aug 3, 2017
  40. practicalswift commented at 2:46 pm on August 3, 2017: contributor
    @jgarzik Is the argument that strongly typed enums should never be used (generally), or that strongly typed enums are not appropriate in these specific cases (this PR)? :-)
  41. TheBlueMatt commented at 2:47 pm on August 3, 2017: member
    Strong Concept ACK, explicit is always better than implicit. Maybe start with adding this to the style guide and requiring it for new code?
  42. practicalswift force-pushed on Aug 3, 2017
  43. practicalswift force-pushed on Aug 3, 2017
  44. practicalswift force-pushed on Aug 3, 2017
  45. ryanofsky commented at 3:08 pm on August 3, 2017: member

    @jgarzik Is the argument that strongly typed enums should never be used (generally), or that strongly typed enums are not appropriate in these specific cases (this PR)? :-)

    A simple way to get rid of some of the redundancy would be to remove prefixes from the enum values (e.g. HTTPStatusCode::HTTP_UNAUTHORIZED -> HTTPStatusCode::UNAUTHORIZED, RPCErrorCode::RPC_PARSE_ERROR -> RPCErrorCode::PARSE_ERROR, etc)

  46. practicalswift commented at 4:02 pm on August 3, 2017: contributor
    @ryanofsky Good idea! Should I do that in this PR or in a follow up PR? :-)
  47. practicalswift commented at 4:03 pm on August 3, 2017: contributor
    @MarcoFalke Good point! Squashed into three commits!
  48. MarcoFalke commented at 4:13 pm on August 3, 2017: member
    @practicalswift The suggestion to remove the prefix could be done in this pull. I imagine it easily couples with the scripted diff.
  49. practicalswift commented at 4:14 pm on August 3, 2017: contributor
    @MarcoFalke Great! I’ll fix a scripted-diff for that!
  50. practicalswift force-pushed on Aug 8, 2017
  51. practicalswift force-pushed on Aug 8, 2017
  52. practicalswift force-pushed on Aug 8, 2017
  53. practicalswift force-pushed on Aug 8, 2017
  54. practicalswift commented at 12:07 pm on August 8, 2017: contributor

    I’ve now added a scripted-diff which removes redundant prefixes from enum values as suggested by @MarcoFalke. Please review :-)

    Changes made:

    • BlockSource::BLOCK_SOURCE_FOOBlockSource::FOO
    • DBErrors::DB_FOODBErrors::FOO
    • FlushStateMode::FLUSH_STATE_FOOFlushStateMode::FOO
    • HTTPStatusCode::HTTP_FOOHTTPStatusCode::FOO
    • HelpMessageMode::HMM_FOOHelpMessageMode::FOO
    • RBFTransactionState::RBF_TRANSACTIONSTATE_FOORBFTransactionState::FOO
    • RPCErrorCode::RPC_FOORPCErrorCode::FOO
    • RetFormat::RF_FOORetFormat::FOO
    • SigVersion::SIGVERSION_FOOSigVersion::FOO
    • ThresholdState::THRESHOLD_FOOThresholdState::FOO
    • txnouttype::TX_FOOtxnouttype::FOO
    • WitnessMode::WITNESS_FOOWitnessMode::FOO
  55. practicalswift force-pushed on Aug 14, 2017
  56. practicalswift force-pushed on Aug 14, 2017
  57. practicalswift renamed this:
    Use scoped enumerations (C++11, "enum class")
    scripted-diff: Use scoped enumerations (C++11, "enum class")
    on Aug 15, 2017
  58. practicalswift force-pushed on Aug 15, 2017
  59. practicalswift commented at 11:49 am on August 15, 2017: contributor
    Rebased!
  60. practicalswift force-pushed on Aug 15, 2017
  61. practicalswift force-pushed on Aug 16, 2017
  62. practicalswift force-pushed on Aug 20, 2017
  63. practicalswift commented at 4:13 pm on August 20, 2017: contributor
    Rebased!
  64. TheBlueMatt commented at 1:43 am on August 21, 2017: member
    Hmm, I dont believe contrib/devtools/commit-script-check.sh supports multiple scripts in a single commit. Personally I’m fine with them being independant commits and dont really mind a 20-commit PR for something like this, but if you want to keep it squashed, you could just make it all one script and put comments in it.
  65. practicalswift force-pushed on Aug 21, 2017
  66. practicalswift commented at 8:05 am on August 21, 2017: contributor
    @TheBlueMatt Ah, thanks for letting me know! I’ve now put it into one script with comments.
  67. practicalswift force-pushed on Aug 21, 2017
  68. practicalswift force-pushed on Aug 22, 2017
  69. practicalswift commented at 8:20 am on August 22, 2017: contributor
    Rebased! Anyone willing to review? Perhaps @laanwj? :-)
  70. TheBlueMatt commented at 8:37 pm on August 22, 2017: member

    Notes on the first script: why the extra “([^:])” in the second sed? It seems to run identically without it? The s/== FLUSH_STATE_/== FlushStateMode::FLUSH_STATE_/g replace seems redundant.

    It would be nice to make it build after the first commit. You could probably just move the two fix commits to before the first scripted-diff.

  71. practicalswift force-pushed on Aug 22, 2017
  72. practicalswift commented at 9:21 pm on August 22, 2017: contributor

    @TheBlueMatt Thanks for reviewing!

    The ([^:]) was left from an earlier attempt at making the scripted-diff idempotent :-) Now removed.

    Removed the redundant FLUSH_STATE_-replacement and re-arranged the commits.

    Looks good now? :-)

  73. practicalswift force-pushed on Sep 10, 2017
  74. practicalswift force-pushed on Sep 10, 2017
  75. practicalswift commented at 7:58 am on September 11, 2017: contributor
    Rebased! :-)
  76. practicalswift commented at 9:26 pm on September 18, 2017: contributor
    Anyone willing to review? :-)
  77. practicalswift force-pushed on Sep 29, 2017
  78. practicalswift force-pushed on Oct 2, 2017
  79. practicalswift force-pushed on Oct 2, 2017
  80. practicalswift force-pushed on Oct 2, 2017
  81. practicalswift force-pushed on Oct 2, 2017
  82. practicalswift commented at 7:25 am on October 3, 2017: contributor
    Rebased!
  83. practicalswift commented at 7:26 am on October 3, 2017: contributor
    @laanwj Is there any chance that this one will make it into 0.16? If so, I’ll keep it updated/rebased :-)
  84. MarcoFalke commented at 8:30 am on October 3, 2017: member
    @practicalswift I guess so. It just needs someone to review ;)
  85. sipa commented at 9:29 am on October 3, 2017: member
    Can you do the cast to int using a C-style cast? Those are preferred for primitive types, and a bit more concise to read.
  86. practicalswift force-pushed on Oct 3, 2017
  87. practicalswift force-pushed on Oct 3, 2017
  88. practicalswift commented at 11:45 am on October 4, 2017: contributor
    Now using C-style casts for primitive types as suggested by @sipa :-)
  89. laanwj commented at 4:07 pm on October 11, 2017: member
    @practicalswift I’m sorry but there are too many all-over-the-place “cosmetic” changes like this lately, it kind of tires me, trying to focus my limited time on PRs that add functionality or fix bugs. So no, I don’t expect to get around to reviewing this any time soon.
  90. practicalswift force-pushed on Nov 9, 2017
  91. practicalswift force-pushed on Nov 9, 2017
  92. practicalswift commented at 9:50 pm on November 9, 2017: contributor

    @laanwj I do not see this PR as cosmetic. Traditional C++ enumerations cause real problems (name clashes, implicit conversion to int, inability to forward declare, etc.) and I would argue that C++11 enum classes are strictly better from a secure coding/“minimize surprises” perspective.

    FWIW the C++ Core Guidelines authors seem to agree .-)

    Hope somebody is willing to review and ACK this scripted-diff PR :-)

  93. practicalswift force-pushed on Nov 16, 2017
  94. practicalswift commented at 9:33 pm on November 16, 2017: contributor
    Rebased! :-)
  95. practicalswift force-pushed on Nov 21, 2017
  96. practicalswift commented at 8:38 am on November 21, 2017: contributor
    Rebased! :-)
  97. practicalswift force-pushed on Dec 13, 2017
  98. practicalswift force-pushed on Dec 21, 2017
  99. practicalswift commented at 12:37 pm on December 21, 2017: contributor
    Rebased!
  100. practicalswift force-pushed on Jan 11, 2018
  101. practicalswift commented at 9:22 pm on January 11, 2018: contributor
    Rebased again! :-) @MarcoFalke @TheBlueMatt – you seemed to be positive to this PR. Would you mind reviewing? :-)
  102. practicalswift force-pushed on Jan 28, 2018
  103. practicalswift force-pushed on Jan 28, 2018
  104. practicalswift commented at 11:20 am on January 28, 2018: contributor
    Rebase number 12 performed! :-)
  105. MarcoFalke commented at 4:29 pm on January 28, 2018: member
    Since this doesn’t get any review, you might want to leave everything that requires a static_cast for later. And regardless, the goal of enum class is to be type safe, whereas for an enum that represents ints, type safety is still preferable, but maybe not as important, since the tradeoff is to blaster the code with static_casts
  106. practicalswift force-pushed on Jan 29, 2018
  107. practicalswift commented at 8:28 am on January 29, 2018: contributor
    @MarcoFalke Good idea! Removed changes to HTTPStatusCode, RPCErrorCode and Base58Type which all required static_cast:s. The scripted-diffs and the resulting changes are now free from static_cast:s and should be easier to review. Thanks!
  108. practicalswift force-pushed on Feb 8, 2018
  109. practicalswift commented at 9:15 am on February 8, 2018: contributor
    Rebase number 13 performed! :-)
  110. practicalswift force-pushed on Feb 12, 2018
  111. practicalswift commented at 3:16 pm on February 12, 2018: contributor
    Rebase number 14 performed! :-)
  112. MarcoFalke commented at 6:16 pm on February 12, 2018: member

    Suggested squash to one commit and scripted diff:

     0scripted-diff: Convert 15 enums into scoped enums (C++11)
     1
     2-BEGIN VERIFY SCRIPT-
     3
     4sed -i 's/enum DBErrors/enum class DBErrors/g' src/wallet/walletdb.h
     5git grep -l DB_ | xargs sed -i 's/DB_\(LOAD_OK\|CORRUPT\|NONCRITICAL_ERROR\|TOO_NEW\|LOAD_FAIL\|NEED_REWRITE\)/DBErrors::\1/g'
     6sed -i 's/^    DBErrors::/    /g' src/wallet/walletdb.h
     7
     8sed -i 's/enum VerifyResult/enum class VerifyResult/g' src/wallet/db.h
     9sed -i 's/\(VERIFY_OK\|RECOVER_OK\|RECOVER_FAIL\)/VerifyResult::\1/g' src/wallet/db.cpp
    10
    11sed -i 's/enum ThresholdState/enum class ThresholdState/g' src/versionbits.h
    12git grep -l THRESHOLD_ | xargs sed -i 's/THRESHOLD_\(DEFINED\|STARTED\|LOCKED_IN\|ACTIVE\|FAILED\)/ThresholdState::\1/g'
    13sed -i 's/^    ThresholdState::/    /g' src/versionbits.h
    14
    15sed -i 's/enum SigVersion/enum class SigVersion/g' src/script/interpreter.h
    16git grep -l SIGVERSION_ | xargs sed -i 's/SIGVERSION_\(BASE\|WITNESS_V0\)/SigVersion::\1/g'
    17sed -i 's/^    SigVersion::/    /g' src/script/interpreter.h
    18
    19sed -i 's/enum RetFormat {/enum class RetFormat {/g' src/rest.cpp
    20sed -i 's/RF_\(UNDEF\|BINARY\|HEX\|JSON\)/RetFormat::\1/g' src/rest.cpp
    21sed -i 's/^    RetFormat::/    /g' src/rest.cpp
    22
    23sed -i 's/enum HelpMessageMode {/enum class HelpMessageMode {/g' src/init.h
    24git grep -l HMM_ | xargs sed -i 's/HMM_BITCOIN/HelpMessageMode::BITCOIN/g' 
    25sed -i 's/^    HelpMessageMode::/    /g' src/init.h
    26
    27sed -i 's/enum FeeEstimateHorizon/enum class FeeEstimateHorizon/g' src/policy/fees.h
    28
    29sed -i 's/enum RBFTransactionState/enum class RBFTransactionState/g' src/policy/rbf.h
    30git grep -l RBF_ | xargs sed -i 's/RBF_TRANSACTIONSTATE_\(UNKNOWN\|REPLACEABLE_BIP125\|FINAL\)/RBFTransactionState::\1/g'
    31sed -i 's/^    RBFTransactionState::/    /g' src/policy/rbf.h
    32
    33sed -i 's/enum BlockSource {/enum class BlockSource {/g' src/qt/clientmodel.h
    34git grep -l BLOCK_SOURCE_ | xargs sed -i 's/BLOCK_SOURCE_\(NONE\|REINDEX\|DISK\|NETWORK\)/BlockSource::\1/g'
    35sed -i 's/^    BlockSource::/    /g' src/qt/clientmodel.h
    36
    37sed -i 's/enum FlushStateMode {/enum class FlushStateMode {/g' src/validation.cpp
    38sed -i 's/FLUSH_STATE_\(NONE\|IF_NEEDED\|PERIODIC\|ALWAYS\)/FlushStateMode::\1/g' src/validation.cpp
    39sed -i 's/^    FlushStateMode::/    /g' src/validation.cpp
    40
    41sed -i 's/enum WitnessMode {/enum class WitnessMode {/g' src/test/script_tests.cpp
    42sed -i 's/WITNESS_\(NONE\|PKH\|SH\)/WitnessMode::\1/g' src/test/script_tests.cpp
    43sed -i 's/^    WitnessMode::/    /g' src/test/script_tests.cpp
    44
    45-END VERIFY SCRIPT-
    
  113. practicalswift force-pushed on Feb 12, 2018
  114. practicalswift commented at 6:43 pm on February 12, 2018: contributor

    @MarcoFalke Good idea! Done!

    Please re-review :-)

  115. practicalswift force-pushed on Mar 6, 2018
  116. practicalswift commented at 10:34 pm on March 6, 2018: contributor
    Rebase number 15 performed! :-)
  117. MarcoFalke commented at 1:10 pm on March 7, 2018: member
    re-utACK 0f201feccd23cf195b6570d775fb709b79c8db5e
  118. scripted-diff: Convert 11 enums into scoped enums (C++11)
    -BEGIN VERIFY SCRIPT-
    
    sed -i 's/enum DBErrors/enum class DBErrors/g' src/wallet/walletdb.h
    git grep -l DB_ | xargs sed -i 's/DB_\(LOAD_OK\|CORRUPT\|NONCRITICAL_ERROR\|TOO_NEW\|LOAD_FAIL\|NEED_REWRITE\)/DBErrors::\1/g'
    sed -i 's/^    DBErrors::/    /g' src/wallet/walletdb.h
    
    sed -i 's/enum VerifyResult/enum class VerifyResult/g' src/wallet/db.h
    sed -i 's/\(VERIFY_OK\|RECOVER_OK\|RECOVER_FAIL\)/VerifyResult::\1/g' src/wallet/db.cpp
    
    sed -i 's/enum ThresholdState/enum class ThresholdState/g' src/versionbits.h
    git grep -l THRESHOLD_ | xargs sed -i 's/THRESHOLD_\(DEFINED\|STARTED\|LOCKED_IN\|ACTIVE\|FAILED\)/ThresholdState::\1/g'
    sed -i 's/^    ThresholdState::/    /g' src/versionbits.h
    
    sed -i 's/enum SigVersion/enum class SigVersion/g' src/script/interpreter.h
    git grep -l SIGVERSION_ | xargs sed -i 's/SIGVERSION_\(BASE\|WITNESS_V0\)/SigVersion::\1/g'
    sed -i 's/^    SigVersion::/    /g' src/script/interpreter.h
    
    sed -i 's/enum RetFormat {/enum class RetFormat {/g' src/rest.cpp
    sed -i 's/RF_\(UNDEF\|BINARY\|HEX\|JSON\)/RetFormat::\1/g' src/rest.cpp
    sed -i 's/^    RetFormat::/    /g' src/rest.cpp
    
    sed -i 's/enum HelpMessageMode {/enum class HelpMessageMode {/g' src/init.h
    git grep -l HMM_ | xargs sed -i 's/HMM_BITCOIN/HelpMessageMode::BITCOIN/g'
    sed -i 's/^    HelpMessageMode::/    /g' src/init.h
    
    sed -i 's/enum FeeEstimateHorizon/enum class FeeEstimateHorizon/g' src/policy/fees.h
    
    sed -i 's/enum RBFTransactionState/enum class RBFTransactionState/g' src/policy/rbf.h
    git grep -l RBF_ | xargs sed -i 's/RBF_TRANSACTIONSTATE_\(UNKNOWN\|REPLACEABLE_BIP125\|FINAL\)/RBFTransactionState::\1/g'
    sed -i 's/^    RBFTransactionState::/    /g' src/policy/rbf.h
    
    sed -i 's/enum BlockSource {/enum class BlockSource {/g' src/qt/clientmodel.h
    git grep -l BLOCK_SOURCE_ | xargs sed -i 's/BLOCK_SOURCE_\(NONE\|REINDEX\|DISK\|NETWORK\)/BlockSource::\1/g'
    sed -i 's/^    BlockSource::/    /g' src/qt/clientmodel.h
    
    sed -i 's/enum FlushStateMode {/enum class FlushStateMode {/g' src/validation.cpp
    sed -i 's/FLUSH_STATE_\(NONE\|IF_NEEDED\|PERIODIC\|ALWAYS\)/FlushStateMode::\1/g' src/validation.cpp
    sed -i 's/^    FlushStateMode::/    /g' src/validation.cpp
    
    sed -i 's/enum WitnessMode {/enum class WitnessMode {/g' src/test/script_tests.cpp
    sed -i 's/WITNESS_\(NONE\|PKH\|SH\)/WitnessMode::\1/g' src/test/script_tests.cpp
    sed -i 's/^    WitnessMode::/    /g' src/test/script_tests.cpp
    
    -END VERIFY SCRIPT-
    1f45e2164a
  119. practicalswift force-pushed on Mar 9, 2018
  120. practicalswift commented at 3:25 pm on March 9, 2018: contributor
    Rebased! Please re-review :-)
  121. sipa commented at 5:31 pm on March 9, 2018: member
    utACK 1f45e2164a7674f716b425a6658c41ca7c30265b
  122. MarcoFalke commented at 2:41 pm on March 12, 2018: member
    re-utACK 1f45e2164a7674f716b425a6658c41ca7c30265b (confirmed the scripted diff is still the same and the rebase was solved correctly)
  123. practicalswift commented at 2:53 pm on March 12, 2018: contributor

    Thanks a lot for reviewing @sipa and @MarcoFalke. Excellent!

    Anyone else who has time for reviewing in order to bring this PR closer to merge? :-)

  124. practicalswift commented at 11:03 am on March 27, 2018: contributor
    @laanwj Would it be possible to get a 0.17.0 milestone for this PR? :-)
  125. laanwj commented at 2:30 pm on March 27, 2018: member
    Probably better to just merge this as there seems agreement to do it… utACK 1f45e21
  126. laanwj merged this on Mar 27, 2018
  127. laanwj closed this on Mar 27, 2018

  128. laanwj referenced this in commit 3de01268b7 on Mar 27, 2018
  129. laanwj referenced this in commit 2d97611c41 on Mar 27, 2018
  130. jonasschnelli referenced this in commit 6a01a50f49 on May 7, 2018
  131. braydonf referenced this in commit e866da81ee on Feb 2, 2019
  132. braydonf referenced this in commit efa78100e0 on Feb 2, 2019
  133. tuxcanfly referenced this in commit 586fef8219 on Apr 19, 2019
  134. PastaPastaPasta referenced this in commit 337c7e4dc3 on Jun 9, 2020
  135. PastaPastaPasta referenced this in commit 9be63ec39c on Jun 9, 2020
  136. PastaPastaPasta referenced this in commit c2ca23b3c2 on Jun 10, 2020
  137. PastaPastaPasta referenced this in commit de904b8e18 on Jun 10, 2020
  138. PastaPastaPasta referenced this in commit e05b5372cc on Jun 11, 2020
  139. PastaPastaPasta referenced this in commit 99a94f4e8e on Jun 11, 2020
  140. PastaPastaPasta referenced this in commit 5745f7fa09 on Jun 11, 2020
  141. PastaPastaPasta referenced this in commit e1de0ba2d0 on Jun 11, 2020
  142. PastaPastaPasta referenced this in commit d37d909d22 on Jun 11, 2020
  143. PastaPastaPasta referenced this in commit 65d16ff803 on Jun 11, 2020
  144. PastaPastaPasta referenced this in commit 518ccbf986 on Jun 12, 2020
  145. PastaPastaPasta referenced this in commit d256db036d on Jun 12, 2020
  146. PastaPastaPasta referenced this in commit 8dea2ad7a6 on Jul 17, 2020
  147. PastaPastaPasta referenced this in commit 52784085cb on Jul 17, 2020
  148. practicalswift deleted the branch on Apr 10, 2021
  149. gades referenced this in commit 93e969ffcb on Feb 23, 2022
  150. gades referenced this in commit 2614d86565 on Mar 28, 2022
  151. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me