From 47ce2269621b89fa6b7ef104f815ff66e18ec367 Mon Sep 17 00:00:00 2001 From: Fuzzbawls Date: Sun, 20 Dec 2020 00:58:05 -0800 Subject: [PATCH] [Build] Unify header file extensions We adopted a global `.h` header file extension convention from bitcoin, this renames a number of header files coming from ZCash's sapling base to conform to that convention. --- src/Makefile.am | 10 +++++----- src/coins.h | 6 +++--- src/keystore.h | 2 +- src/rpc/rawtransaction.cpp | 2 +- src/sapling/address.cpp | 4 ++-- src/sapling/{address.hpp => address.h} | 0 src/sapling/incrementalmerkletree.cpp | 2 +- ...crementalmerkletree.hpp => incrementalmerkletree.h} | 0 src/sapling/note.cpp | 2 +- src/sapling/{note.hpp => note.h} | 6 +++--- src/sapling/noteencryption.cpp | 2 +- src/sapling/{noteencryption.hpp => noteencryption.h} | 2 +- src/sapling/proof.cpp | 2 +- src/sapling/{proof.hpp => proof.h} | 0 src/sapling/sapling_transaction.h | 4 ++-- src/sapling/saplingscriptpubkeyman.h | 4 ++-- src/sapling/transaction_builder.h | 8 ++++---- src/sapling/zip32.h | 2 +- src/test/coins_tests.cpp | 2 +- src/test/librust/merkletree_tests.cpp | 2 +- src/test/librust/noteencryption_tests.cpp | 8 ++++---- src/test/librust/sapling_key_tests.cpp | 4 +++- src/test/librust/sapling_keystore_tests.cpp | 3 ++- src/test/librust/sapling_note_tests.cpp | 5 +++-- src/test/librust/sapling_rpc_wallet_tests.cpp | 2 +- src/test/librust/sapling_wallet_tests.cpp | 4 ++-- src/test/librust/utiltest.h | 8 ++++---- src/test/librust/wallet_zkeys_tests.cpp | 2 +- src/validationinterface.h | 2 +- src/wallet/test/wallet_shielded_balances_tests.cpp | 4 ++-- src/wallet/wallet.h | 2 +- 31 files changed, 55 insertions(+), 51 deletions(-) rename src/sapling/{address.hpp => address.h} (100%) rename src/sapling/{incrementalmerkletree.hpp => incrementalmerkletree.h} (100%) rename src/sapling/{note.hpp => note.h} (98%) rename src/sapling/{noteencryption.hpp => noteencryption.h} (98%) rename src/sapling/{proof.hpp => proof.h} (100%) diff --git a/src/Makefile.am b/src/Makefile.am index 513a08125860..edc4f1a6e97f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -131,13 +131,13 @@ LIBSAPLING_H = \ sapling/sapling_core_write.h \ sapling/sapling_util.h \ sapling/prf.h \ - sapling/noteencryption.hpp \ - sapling/address.hpp \ - sapling/note.hpp \ + sapling/noteencryption.h \ + sapling/address.h \ + sapling/note.h \ sapling/zip32.h \ sapling/saplingscriptpubkeyman.h \ - sapling/incrementalmerkletree.hpp \ - sapling/proof.hpp \ + sapling/incrementalmerkletree.h \ + sapling/proof.h \ sapling/sapling_transaction.h \ sapling/transaction_builder.h \ sapling/sapling_operation.h diff --git a/src/coins.h b/src/coins.h index 43e36c5c7726..15e7e2281fcb 100644 --- a/src/coins.h +++ b/src/coins.h @@ -8,10 +8,10 @@ #define BITCOIN_COINS_H #include "compressor.h" +#include "consensus/consensus.h" // can be removed once policy/ established #include "memusage.h" -#include "consensus/consensus.h" // can be removed once policy/ established +#include "sapling/incrementalmerkletree.h" #include "script/standard.h" -#include "sapling/incrementalmerkletree.hpp" #include "serialize.h" #include "uint256.h" @@ -277,7 +277,7 @@ class CCoinsViewCache : public CCoinsViewBacked protected: /** * Make mutable so that we can "fill the cache" even from Get-methods - * declared as "const". + * declared as "const". */ mutable uint256 hashBlock; mutable CCoinsMap cacheCoins; diff --git a/src/keystore.h b/src/keystore.h index 8987b3c28809..9d7d526fdc0e 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -9,7 +9,7 @@ #include "key.h" #include "pubkey.h" -#include "sapling/address.hpp" +#include "sapling/address.h" #include "sapling/zip32.h" #include "sync.h" diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 9c4920251847..35c674a9c1c7 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -20,8 +20,8 @@ #include "uint256.h" #include "utilmoneystr.h" #ifdef ENABLE_WALLET +#include "sapling/address.h" #include "sapling/key_io_sapling.h" -#include "sapling/address.hpp" #include "wallet/wallet.h" #endif diff --git a/src/sapling/address.cpp b/src/sapling/address.cpp index b1cccca558a5..253759a387ad 100644 --- a/src/sapling/address.cpp +++ b/src/sapling/address.cpp @@ -1,5 +1,5 @@ -#include "sapling/address.hpp" -#include "sapling/noteencryption.hpp" +#include "sapling/address.h" +#include "sapling/noteencryption.h" #include "sapling/prf.h" #include "sapling/sapling_util.h" diff --git a/src/sapling/address.hpp b/src/sapling/address.h similarity index 100% rename from src/sapling/address.hpp rename to src/sapling/address.h diff --git a/src/sapling/incrementalmerkletree.cpp b/src/sapling/incrementalmerkletree.cpp index 1a2856560e00..60f333eee4fe 100644 --- a/src/sapling/incrementalmerkletree.cpp +++ b/src/sapling/incrementalmerkletree.cpp @@ -5,8 +5,8 @@ #include -#include "sapling/incrementalmerkletree.hpp" #include "crypto/sha256.h" +#include "sapling/incrementalmerkletree.h" #include namespace libzcash { diff --git a/src/sapling/incrementalmerkletree.hpp b/src/sapling/incrementalmerkletree.h similarity index 100% rename from src/sapling/incrementalmerkletree.hpp rename to src/sapling/incrementalmerkletree.h diff --git a/src/sapling/note.cpp b/src/sapling/note.cpp index eef7bfd94d04..a21ebc2166eb 100644 --- a/src/sapling/note.cpp +++ b/src/sapling/note.cpp @@ -1,4 +1,4 @@ -#include "sapling/note.hpp" +#include "sapling/note.h" #include "sapling/prf.h" #include "sapling/sapling_util.h" diff --git a/src/sapling/note.hpp b/src/sapling/note.h similarity index 98% rename from src/sapling/note.hpp rename to src/sapling/note.h index ddeb148a4992..deb373199305 100644 --- a/src/sapling/note.hpp +++ b/src/sapling/note.h @@ -1,10 +1,10 @@ #ifndef ZC_NOTE_H_ #define ZC_NOTE_H_ -#include "uint256.h" +#include "sapling/address.h" +#include "sapling/noteencryption.h" #include "sapling/sapling.h" -#include "sapling/address.hpp" -#include "sapling/noteencryption.hpp" +#include "uint256.h" #include #include diff --git a/src/sapling/noteencryption.cpp b/src/sapling/noteencryption.cpp index 42e3e3043380..2daa5ccf5b8a 100644 --- a/src/sapling/noteencryption.cpp +++ b/src/sapling/noteencryption.cpp @@ -3,7 +3,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "sapling/noteencryption.hpp" +#include "sapling/noteencryption.h" #include "sapling/prf.h" #include "sapling/sapling_util.h" diff --git a/src/sapling/noteencryption.hpp b/src/sapling/noteencryption.h similarity index 98% rename from src/sapling/noteencryption.hpp rename to src/sapling/noteencryption.h index fd0a7d74a059..e34175bbd281 100644 --- a/src/sapling/noteencryption.hpp +++ b/src/sapling/noteencryption.h @@ -13,8 +13,8 @@ See the Zcash protocol specification for more information. #include "uint256.h" +#include "sapling/address.h" #include "sapling/sapling.h" -#include "sapling/address.hpp" #include diff --git a/src/sapling/proof.cpp b/src/sapling/proof.cpp index 20c585af72a7..04db5a947722 100644 --- a/src/sapling/proof.cpp +++ b/src/sapling/proof.cpp @@ -1,4 +1,4 @@ -#include "sapling/proof.hpp" +#include "sapling/proof.h" namespace libzcash { diff --git a/src/sapling/proof.hpp b/src/sapling/proof.h similarity index 100% rename from src/sapling/proof.hpp rename to src/sapling/proof.h diff --git a/src/sapling/sapling_transaction.h b/src/sapling/sapling_transaction.h index d5c4a5474312..e6e8201722b2 100644 --- a/src/sapling/sapling_transaction.h +++ b/src/sapling/sapling_transaction.h @@ -11,9 +11,9 @@ #include "uint256.h" #include "consensus/consensus.h" -#include "sapling/noteencryption.hpp" +#include "sapling/noteencryption.h" #include "sapling/sapling.h" -#include "sapling/proof.hpp" +#include "sapling/proof.h" #include diff --git a/src/sapling/saplingscriptpubkeyman.h b/src/sapling/saplingscriptpubkeyman.h index 07515575d512..dec4b7b3abac 100644 --- a/src/sapling/saplingscriptpubkeyman.h +++ b/src/sapling/saplingscriptpubkeyman.h @@ -6,11 +6,11 @@ #define PIVX_SAPLINGSCRIPTPUBKEYMAN_H #include "consensus/consensus.h" -#include "sapling/note.hpp" +#include "sapling/note.h" #include "wallet/hdchain.h" #include "wallet/wallet.h" #include "wallet/walletdb.h" -#include "sapling/incrementalmerkletree.hpp" +#include "sapling/incrementalmerkletree.h" //! Size of witness cache // Should be large enough that we can expect not to reorg beyond our cache diff --git a/src/sapling/transaction_builder.h b/src/sapling/transaction_builder.h index c4557ff963a3..e3841983f57c 100644 --- a/src/sapling/transaction_builder.h +++ b/src/sapling/transaction_builder.h @@ -14,10 +14,10 @@ #include "script/script.h" #include "script/standard.h" #include "uint256.h" -#include "sapling/address.hpp" -#include "sapling/incrementalmerkletree.hpp" -#include "sapling/note.hpp" -#include "sapling/noteencryption.hpp" +#include "sapling/address.h" +#include "sapling/incrementalmerkletree.h" +#include "sapling/note.h" +#include "sapling/noteencryption.h" struct SpendDescriptionInfo { libzcash::SaplingExpandedSpendingKey expsk; diff --git a/src/sapling/zip32.h b/src/sapling/zip32.h index 83a407b13f42..03b0e96ca51e 100644 --- a/src/sapling/zip32.h +++ b/src/sapling/zip32.h @@ -10,7 +10,7 @@ #include "blob_uint256.h" #include "key.h" #include "uint256.h" -#include "sapling/address.hpp" +#include "sapling/address.h" #include diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 78ae93d9420d..a57735a7d237 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -12,7 +12,7 @@ #include "utilstrencodings.h" #include "random.h" -#include "sapling/incrementalmerkletree.hpp" +#include "sapling/incrementalmerkletree.h" #include #include diff --git a/src/test/librust/merkletree_tests.cpp b/src/test/librust/merkletree_tests.cpp index 8ae48f64dd66..460133251c03 100644 --- a/src/test/librust/merkletree_tests.cpp +++ b/src/test/librust/merkletree_tests.cpp @@ -19,7 +19,7 @@ #include "serialize.h" #include "streams.h" -#include "sapling/incrementalmerkletree.hpp" +#include "sapling/incrementalmerkletree.h" #include "sapling/sapling_util.h" #include "json_test_vectors.h" diff --git a/src/test/librust/noteencryption_tests.cpp b/src/test/librust/noteencryption_tests.cpp index 3073b2612b82..b12d6b529562 100644 --- a/src/test/librust/noteencryption_tests.cpp +++ b/src/test/librust/noteencryption_tests.cpp @@ -8,12 +8,12 @@ #include #include -#include "sapling/address.hpp" -#include "sapling/note.hpp" -#include "sapling/noteencryption.hpp" +#include "crypto/sha256.h" +#include "sapling/address.h" +#include "sapling/note.h" +#include "sapling/noteencryption.h" #include "sapling/prf.h" #include "sapling/sapling_util.h" -#include "crypto/sha256.h" #include #include diff --git a/src/test/librust/sapling_key_tests.cpp b/src/test/librust/sapling_key_tests.cpp index 9b857a12cbad..5221dd8a485b 100644 --- a/src/test/librust/sapling_key_tests.cpp +++ b/src/test/librust/sapling_key_tests.cpp @@ -5,10 +5,12 @@ #include "test/test_pivx.h" -#include "sapling/address.hpp" +#include "sapling/address.h" #include "sapling/key_io_sapling.h" + #include #include + #include diff --git a/src/test/librust/sapling_keystore_tests.cpp b/src/test/librust/sapling_keystore_tests.cpp index cbbc38d135b6..215c77987d05 100644 --- a/src/test/librust/sapling_keystore_tests.cpp +++ b/src/test/librust/sapling_keystore_tests.cpp @@ -6,8 +6,9 @@ #include "test/test_pivx.h" #include "test/librust/utiltest.h" -#include "sapling/address.hpp" +#include "sapling/address.h" #include "sapling/sapling_util.h" + #include #include diff --git a/src/test/librust/sapling_note_tests.cpp b/src/test/librust/sapling_note_tests.cpp index 4a6f1bea5cef..46226b3f9e91 100644 --- a/src/test/librust/sapling_note_tests.cpp +++ b/src/test/librust/sapling_note_tests.cpp @@ -5,8 +5,8 @@ #include "test/test_pivx.h" -#include "sapling/address.hpp" -#include "sapling/note.hpp" +#include "sapling/address.h" +#include "sapling/note.h" #include "sapling/sapling_util.h" #include "amount.h" @@ -14,6 +14,7 @@ #include #include + #include BOOST_FIXTURE_TEST_SUITE(sapling_note_tests, BasicTestingSetup) diff --git a/src/test/librust/sapling_rpc_wallet_tests.cpp b/src/test/librust/sapling_rpc_wallet_tests.cpp index 630ace9499c5..d87203dd35de 100644 --- a/src/test/librust/sapling_rpc_wallet_tests.cpp +++ b/src/test/librust/sapling_rpc_wallet_tests.cpp @@ -16,7 +16,7 @@ #include "wallet/wallet.h" #include "sapling/key_io_sapling.h" -#include "sapling/address.hpp" +#include "sapling/address.h" #include "sapling/sapling_operation.h" #include diff --git a/src/test/librust/sapling_wallet_tests.cpp b/src/test/librust/sapling_wallet_tests.cpp index e8ff87637cf1..e25392bcad2a 100644 --- a/src/test/librust/sapling_wallet_tests.cpp +++ b/src/test/librust/sapling_wallet_tests.cpp @@ -18,8 +18,8 @@ #include "test/librust/utiltest.h" #include "wallet/wallet.h" #include "consensus/merkle.h" -#include "sapling/note.hpp" -#include "sapling/noteencryption.hpp" +#include "sapling/note.h" +#include "sapling/noteencryption.h" #include diff --git a/src/test/librust/utiltest.h b/src/test/librust/utiltest.h index 74c60229395e..df2e69d17e5d 100644 --- a/src/test/librust/utiltest.h +++ b/src/test/librust/utiltest.h @@ -6,10 +6,10 @@ #ifndef PIVX_UTIL_TEST_H #define PIVX_UTIL_TEST_H -#include "sapling/address.hpp" -#include "sapling/incrementalmerkletree.hpp" -#include "sapling/note.hpp" -#include "sapling/noteencryption.hpp" +#include "sapling/address.h" +#include "sapling/incrementalmerkletree.h" +#include "sapling/note.h" +#include "sapling/noteencryption.h" #include "wallet/wallet.h" struct TestSaplingNote { diff --git a/src/test/librust/wallet_zkeys_tests.cpp b/src/test/librust/wallet_zkeys_tests.cpp index 0256f0300e01..2382d431ef28 100644 --- a/src/test/librust/wallet_zkeys_tests.cpp +++ b/src/test/librust/wallet_zkeys_tests.cpp @@ -6,7 +6,7 @@ #include "wallet/test/wallet_test_fixture.h" #include "sapling/sapling_util.h" -#include "sapling/address.hpp" +#include "sapling/address.h" #include "wallet/wallet.h" #include "wallet/walletdb.h" #include "util.h" diff --git a/src/validationinterface.h b/src/validationinterface.h index f50349eb645b..ad353dfe2996 100644 --- a/src/validationinterface.h +++ b/src/validationinterface.h @@ -8,7 +8,7 @@ #define BITCOIN_VALIDATIONINTERFACE_H #include "optional.h" -#include "sapling/incrementalmerkletree.hpp" +#include "sapling/incrementalmerkletree.h" #include diff --git a/src/wallet/test/wallet_shielded_balances_tests.cpp b/src/wallet/test/wallet_shielded_balances_tests.cpp index 490e492e5da3..a6dff16969f9 100644 --- a/src/wallet/test/wallet_shielded_balances_tests.cpp +++ b/src/wallet/test/wallet_shielded_balances_tests.cpp @@ -7,8 +7,8 @@ #include "consensus/merkle.h" #include "primitives/block.h" #include "random.h" -#include "sapling/note.hpp" -#include "sapling/noteencryption.hpp" +#include "sapling/note.h" +#include "sapling/noteencryption.h" #include "sapling/transaction_builder.h" #include "test/librust/utiltest.h" #include "wallet/wallet.h" diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 8d63b4485663..f285482245b3 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -22,7 +22,7 @@ #include "policy/feerate.h" #include "primitives/block.h" #include "primitives/transaction.h" -#include "sapling/address.hpp" +#include "sapling/address.h" #include "guiinterface.h" #include "util.h" #include "util/memory.h"