diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2023-12-07 17:11:27 -0500 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2024-05-16 10:16:08 -0500 |
commit | 4d05d3f3b42a41525aa6ec44b90f543dfab53ecf (patch) | |
tree | 91b4256b9154bfb5b8d65ea22b6544a5f1bc8d1f /src/rpc | |
parent | 680eafdc74021c1e0893c3a62404e607fd4724f5 (diff) |
util: add TransactionError includes and namespace declarations
Add TransactionError to node namespace and include it directly instead of
relying on indirect include through common/messages.h
This is a followup to a previous commit which moved the TransactionError enum.
These changes were done in a separate followup just to keep the previous commit
more minimal and easy to review.
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/mempool.cpp | 2 | ||||
-rw-r--r-- | src/rpc/rawtransaction.cpp | 1 | ||||
-rw-r--r-- | src/rpc/util.cpp | 2 | ||||
-rw-r--r-- | src/rpc/util.h | 8 |
4 files changed, 10 insertions, 3 deletions
diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp index e599c7dc92..17d576920b 100644 --- a/src/rpc/mempool.cpp +++ b/src/rpc/mempool.cpp @@ -11,6 +11,7 @@ #include <core_io.h> #include <kernel/mempool_entry.h> #include <node/mempool_persist_args.h> +#include <node/types.h> #include <policy/rbf.h> #include <policy/settings.h> #include <primitives/transaction.h> @@ -32,6 +33,7 @@ using node::DEFAULT_MAX_BURN_AMOUNT; using node::DEFAULT_MAX_RAW_TX_FEE_RATE; using node::MempoolPath; using node::NodeContext; +using node::TransactionError; static RPCHelpMan sendrawtransaction() { diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 674f9bfe90..40d78128bc 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -16,6 +16,7 @@ #include <node/context.h> #include <node/psbt.h> #include <node/transaction.h> +#include <node/types.h> #include <policy/packages.h> #include <policy/policy.h> #include <policy/rbf.h> diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index f1cff640fa..d18b28fa1f 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -12,6 +12,7 @@ #include <consensus/amount.h> #include <script/interpreter.h> #include <key_io.h> +#include <node/types.h> #include <outputtype.h> #include <rpc/util.h> #include <script/descriptor.h> @@ -35,6 +36,7 @@ using common::PSBTError; using common::PSBTErrorString; using common::TransactionErrorString; +using node::TransactionError; const std::string UNIX_EPOCH_TIME = "UNIX epoch time"; const std::string EXAMPLE_ADDRESS[2] = {"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl", "bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3"}; diff --git a/src/rpc/util.h b/src/rpc/util.h index 5522e346d2..869edd3a46 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -34,12 +34,14 @@ class JSONRPCRequest; enum ServiceFlags : uint64_t; enum class OutputType; -enum class TransactionError; struct FlatSigningProvider; struct bilingual_str; namespace common { enum class PSBTError; } // namespace common +namespace node { +enum class TransactionError; +} // namespace node static constexpr bool DEFAULT_RPC_DOC_CHECK{ #ifdef RPC_DOC_CHECK @@ -130,9 +132,9 @@ int ParseSighashString(const UniValue& sighash); //! Parse a confirm target option and raise an RPC error if it is invalid. unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target); -RPCErrorCode RPCErrorFromTransactionError(TransactionError terr); +RPCErrorCode RPCErrorFromTransactionError(node::TransactionError terr); UniValue JSONRPCPSBTError(common::PSBTError err); -UniValue JSONRPCTransactionError(TransactionError terr, const std::string& err_string = ""); +UniValue JSONRPCTransactionError(node::TransactionError terr, const std::string& err_string = ""); //! Parse a JSON range specified as int64, or [int64, int64] std::pair<int64_t, int64_t> ParseDescriptorRange(const UniValue& value); |