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

Remove unused TransactionError constants #15408

Merged
merged 1 commit into from
Feb 22, 2019

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Feb 14, 2019

Fixup to #14978, which introduced a bunch of unused enum values, such as UNKNOWN_ERROR, ERROR_COUNT and TRANSACTION_ERR_LAST. None of those have a meaning in the context of an enum class, where the compiler can infer if all cases have been covered in a switch-case.

Also, move the global ::maxTxFee back to the rpc caller, so it can be set on a per call basis (in the future).

@practicalswift
Copy link
Contributor

Concept ACK

Nice cleanup!

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 14, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #13541 (wallet/rpc: sendrawtransaction maxfeerate by kallewoof)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@gwillen
Copy link
Contributor

gwillen commented Feb 15, 2019

utACK

The only thing I feel weird about here is the caller of BroadcastTransaction needing to know that there is a maxTxFee they are supposed to be using. Would it be possible to default that parameter to maxTxFee? (So that calls to BroadcastTransaction automatically obey the -maxtxfee command line flag if not overridden deliberately?)

@maflcko
Copy link
Member Author

maflcko commented Feb 15, 2019

The goal in the future is to have it as a per-call default that can be overwritten by each individual rpc call. So the default should really live in the scope of the rpc method.

@maflcko maflcko merged commit fa9b60c into bitcoin:master Feb 22, 2019
maflcko pushed a commit that referenced this pull request Feb 22, 2019
fa9b60c Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to #14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
@maflcko maflcko deleted the Mf1902-TransactionErrorConst branch February 22, 2019 16:25
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 11, 2020
Summary:
Fixup to #14978, which introduced a bunch of unused enum values, such as UNKNOWN_ERROR, ERROR_COUNT and TRANSACTION_ERR_LAST. None of those have a meaning in the context of an enum class, where the compiler can infer if all cases have been covered in a switch-case.

Also, move the global ::maxTxFee back to the rpc caller, so it can be set on a per call basis (in the future).

bitcoin/bitcoin@fa9b60c

---

Depends on D6000

This is a backport of Core [[bitcoin/bitcoin#15408 | PR15408]] plus:

A few code cleanups in util/error.h/.cpp
Corrected a comment in validation.cpp (regtest no longer supporting non-standard transactions re: D5764)

Test Plan:
  cmake .. -GNinja -DENABLE_WERROR=ON
  ninja check-all
  cmake .. -GNinja -DENABLE_WERROR=ON -DBUILD_BITCOIN_WALLET=OFF
  ninja check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6012
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Sep 7, 2021
fa9b60c Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to bitcoin#14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 24, 2021
fa9b60c Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to bitcoin#14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 24, 2021
fa9b60c Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to bitcoin#14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 24, 2021
fa9b60c Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to bitcoin#14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 27, 2021
fa9b60c Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to bitcoin#14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 30, 2021
fa9b60c Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to bitcoin#14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
UdjinM6 added a commit to dashpay/dash that referenced this pull request Oct 1, 2021
kwvg pushed a commit to kwvg/dash that referenced this pull request Oct 12, 2021
fa9b60c Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to bitcoin#14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants