0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-09 15:37:00 -04:00
bitcoin-core/src/rpc
fanquake 73a0d6d0d4
Merge bitcoin/bitcoin#25611: univalue: Avoid brittle, narrowing and verbose integral type confusions
fa23c19750 univalue: Avoid narrowing and verbose int constructors (MacroFake)
fa3a9a1e8d rpc: Select int-UniValue constructor for enum value in upgradewallet RPC (MacroFake)

Pull request description:

  As UniValue provides several constructors for integral types, the
  compiler is unable to select one if the passed type does not exactly
  match. This is unintuitive for developers and forces them to write
  verbose and brittle code. (Refer to `-Wnarrowing` compiler warning)

  For example, there are many places where an unsigned int is cast to a
  signed int. While the cast is safe in practice, it is still needlessly
  verbose and confusing as the value can never be negative. In fact it
  might even be unsafe if the unsigned value is large enough to map to a
  negative signed one.

  Fix this issue and other (minor) type issues.

ACKs for top commit:
  aureleoules:
    ACK fa23c19750.

Tree-SHA512: 7d99b5b90c7d8eed2e3448167255a59e817dd6b8fcfc1b17c69ddefd0db33d1bf4344fbcd8b7f8685b58182c0f572ab9ffa99467afa666ac21843df7ea645033
2022-07-25 15:12:41 +01:00
..
blockchain.cpp RPC: Document "asm" and "hex" fields for scripts 2022-07-25 06:06:15 +00:00
blockchain.h Use AutoFile where possible 2022-06-29 10:33:13 +02:00
client.cpp [rpc] add new submitpackage RPC 2022-06-23 14:35:04 +01:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
external_signer.cpp Remove not needed clang-format off comments 2022-04-25 10:55:07 +02:00
fees.cpp Remove unused includes in rpc/fees.cpp 2022-07-19 14:34:19 +02:00
mempool.cpp Add missing includes 2022-07-19 14:12:33 +02:00
mempool.h rpc: Move mempool RPCs to new file 2022-03-11 17:46:58 +01:00
mining.cpp miner: Make mempool optional for BlockAssembler 2022-06-06 15:38:09 -04:00
mining.h rpc: create rpc/mining.h, hoist default max tries values to constant 2020-06-01 15:08:36 +02:00
net.cpp Merge bitcoin/bitcoin#25611: univalue: Avoid brittle, narrowing and verbose integral type confusions 2022-07-25 15:12:41 +01:00
node.cpp scripted-diff: Use getInt<T> over get_int/get_int64 2022-05-18 19:15:03 +02:00
output_script.cpp refactor: remove unused using directives 2022-07-18 17:25:03 +01:00
protocol.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
rawtransaction.cpp RPC: Document "asm" and "hex" fields for scripts 2022-07-25 06:06:15 +00:00
rawtransaction_util.cpp scripted-diff: Use getInt<T> over get_int/get_int64 2022-05-18 19:15:03 +02:00
rawtransaction_util.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
register.h scripted-diff: Rename rpc/misc.cpp to rpc/node.cpp 2022-05-03 09:05:15 +02:00
request.cpp scripted-diff: Use getInt<T> over get_int/get_int64 2022-05-18 19:15:03 +02:00
request.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
server.cpp rpc: Use steady_clock for getrpcinfo durations 2022-06-23 15:32:17 +02:00
server.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
server_util.cpp Add src/node/* code to node:: namespace 2022-01-06 22:14:16 -05:00
server_util.h Add src/node/* code to node:: namespace 2022-01-06 22:14:16 -05:00
signmessage.cpp rpc: Move signmessage RPC util to new file 2022-04-28 11:19:29 +02:00
txoutproof.cpp Do not call global Params() when chainman is in scope 2022-05-18 18:46:48 +02:00
util.cpp rpc: Capture potentially large UniValue by ref for rpcdoccheck 2022-05-29 14:36:53 +02:00
util.h includes: Remove rpc/util.h -> node/coinstats.h 2022-05-20 16:33:24 -04:00