Page MenuHomePhabricator

[backport#15638] [build] Add several util units
ClosedPublic

Authored by majcosta on May 7 2020, 17:40.

Details

Summary

Adds the following util units and adds them to libbitcoin_util:

  • util/url.cpp takes urlDecode from httpserver.cpp
  • util/error.cpp takes TransactionErrorString from node/transaction.cpp and AmountHighWarn and AmountErrMsg from ui_interface.cpp

- util/fees.cpp takes StringForFeeReason and FeeModeFromString from policy/fees.cpp
- util/rbf.cpp takes SignalsOptInRBF from policy/rbf.cpp

  • 'util/validation.cpp` takes FormatStateMessage and strMessageMagic from 'validation.cpp`

https://github.com/bitcoin/bitcoin/pull/15638/commits/91a25d1e711bfc0617027eee18b9777ff368d6b9


Depends on D5994

This is a partial backport of Core PR15638

Test Plan
ninja check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

majcosta requested review of this revision.May 7 2020, 17:40

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.May 7 2020, 18:30
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/policy/policy.cpp
16 ↗(On Diff #19805)

likestamp

src/policy/policy.h
9 ↗(On Diff #19805)

I'm not convinced we really want to add that include rather than the forward declaration. Everything else being equal, forward declaration are preferred in headers to avoid including the whole universe in each module.

src/util/error.cpp
30 ↗(On Diff #19805)

This is literally never used, so it can be removed.

src/util/error.h
22 ↗(On Diff #19805)

remove

test/lint/lint-circular-dependencies.sh
13 ↗(On Diff #19805)

likestamp

This revision now requires changes to proceed.May 7 2020, 18:30

replaced header include with forward declaration, added include to cpp file, removed UNKNOWN_ERROR from enum

This revision is now accepted and ready to land.May 7 2020, 19:18