From ef1816d06a1269ba0814f77ec8841d42fe648689 Mon Sep 17 00:00:00 2001 From: random-zebra Date: Tue, 23 Nov 2021 13:31:58 +0100 Subject: [PATCH] cleanup: fix header includes sorting and copy --- src/sapling/address.cpp | 9 +++++++-- src/sapling/address.h | 11 ++++++++--- src/sapling/incrementalmerkletree.cpp | 5 +++-- src/sapling/note.cpp | 12 ++++++++---- src/sapling/note.h | 7 ++++++- src/sapling/noteencryption.cpp | 4 ++-- src/sapling/noteencryption.h | 7 +++---- src/sapling/sapling_operation.cpp | 2 +- src/sapling/saplingscriptpubkeyman.cpp | 5 +++-- src/sapling/zip32.cpp | 7 ++++--- src/sapling/zip32.h | 9 ++++----- src/util/system.h | 5 +++-- src/wallet/test/wallet_shielded_balances_tests.cpp | 3 +-- 13 files changed, 53 insertions(+), 33 deletions(-) diff --git a/src/sapling/address.cpp b/src/sapling/address.cpp index f8a001188e6599..737bae6710101b 100644 --- a/src/sapling/address.cpp +++ b/src/sapling/address.cpp @@ -1,9 +1,14 @@ +// Copyright (c) 2016-2020 The ZCash developers +// Copyright (c) 2021 The PIVX developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://www.opensource.org/licenses/mit-license.php. + #include "sapling/address.h" + +#include "hash.h" #include "sapling/noteencryption.h" #include "sapling/prf.h" #include "sapling/sapling_util.h" - -#include "hash.h" #include "streams.h" #include diff --git a/src/sapling/address.h b/src/sapling/address.h index bdb02f9d3df197..c1876973fa94bc 100644 --- a/src/sapling/address.h +++ b/src/sapling/address.h @@ -1,12 +1,17 @@ +// Copyright (c) 2016-2020 The ZCash developers +// Copyright (c) 2021 The PIVX developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://www.opensource.org/licenses/mit-license.php. + #ifndef ZC_ADDRESS_H_ #define ZC_ADDRESS_H_ -#include "uint256.h" -#include "serialize.h" +#include "optional.h" #include "sapling/sapling.h" +#include "serialize.h" +#include "uint256.h" #include -#include "optional.h" #include namespace libzcash { diff --git a/src/sapling/incrementalmerkletree.cpp b/src/sapling/incrementalmerkletree.cpp index d34a60f3d84031..5d775e2186ddcc 100644 --- a/src/sapling/incrementalmerkletree.cpp +++ b/src/sapling/incrementalmerkletree.cpp @@ -1,5 +1,5 @@ -// Copyright (c) 2016-2018 The Zcash developers -// Copyright (c) 2020 The PIVX developers +// Copyright (c) 2016-2020 The ZCash developers +// Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying // file COPYING or https://www.opensource.org/licenses/mit-license.php. @@ -7,6 +7,7 @@ #include "crypto/sha256.h" #include "sapling/incrementalmerkletree.h" + #include namespace libzcash { diff --git a/src/sapling/note.cpp b/src/sapling/note.cpp index 8ccdb355e0a6b1..e7bad301a19ae8 100644 --- a/src/sapling/note.cpp +++ b/src/sapling/note.cpp @@ -1,12 +1,16 @@ +// Copyright (c) 2016-2020 The ZCash developers +// Copyright (c) 2021 The PIVX developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://www.opensource.org/licenses/mit-license.php. + #include "sapling/note.h" -#include "sapling/prf.h" -#include "sapling/sapling_util.h" #include "crypto/sha256.h" - #include "random.h" -#include "version.h" +#include "sapling/prf.h" +#include "sapling/sapling_util.h" #include "streams.h" +#include "version.h" #include diff --git a/src/sapling/note.h b/src/sapling/note.h index a1bbb9dc8a11fd..3a5214bd8f205c 100644 --- a/src/sapling/note.h +++ b/src/sapling/note.h @@ -1,13 +1,18 @@ +// Copyright (c) 2016-2020 The ZCash developers +// Copyright (c) 2021 The PIVX developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://www.opensource.org/licenses/mit-license.php. + #ifndef ZC_NOTE_H_ #define ZC_NOTE_H_ +#include "optional.h" #include "sapling/address.h" #include "sapling/noteencryption.h" #include "sapling/sapling.h" #include "uint256.h" #include -#include "optional.h" namespace libzcash { diff --git a/src/sapling/noteencryption.cpp b/src/sapling/noteencryption.cpp index 3ec6805cd59f66..87a157d9a9462e 100644 --- a/src/sapling/noteencryption.cpp +++ b/src/sapling/noteencryption.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2016-2020 The ZCash developers -// Copyright (c) 2020 The PIVX developers +// Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or https://www.opensource.org/licenses/mit-license.php. #include "sapling/noteencryption.h" diff --git a/src/sapling/noteencryption.h b/src/sapling/noteencryption.h index c95865f5d12e1d..cf87dcc945c7be 100644 --- a/src/sapling/noteencryption.h +++ b/src/sapling/noteencryption.h @@ -1,7 +1,7 @@ // Copyright (c) 2016-2020 The ZCash developers -// Copyright (c) 2020 The PIVX developers +// Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or https://www.opensource.org/licenses/mit-license.php. /* See the Zcash protocol specification for more information. @@ -11,10 +11,9 @@ See the Zcash protocol specification for more information. #ifndef ZC_NOTE_ENCRYPTION_H_ #define ZC_NOTE_ENCRYPTION_H_ -#include "uint256.h" - #include "sapling/address.h" #include "sapling/sapling.h" +#include "uint256.h" #include diff --git a/src/sapling/sapling_operation.cpp b/src/sapling/sapling_operation.cpp index a770ef8eecde87..92507d05b6f123 100644 --- a/src/sapling/sapling_operation.cpp +++ b/src/sapling/sapling_operation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The PIVX developers +// Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying // file COPYING or https://www.opensource.org/licenses/mit-license.php. diff --git a/src/sapling/saplingscriptpubkeyman.cpp b/src/sapling/saplingscriptpubkeyman.cpp index c374174e447b5f..75f371951d7d24 100644 --- a/src/sapling/saplingscriptpubkeyman.cpp +++ b/src/sapling/saplingscriptpubkeyman.cpp @@ -1,9 +1,10 @@ // Copyright (c) 2016-2020 The ZCash developers -// Copyright (c) 2020 The PIVX developers +// Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or https://www.opensource.org/licenses/mit-license.php. #include "sapling/saplingscriptpubkeyman.h" + #include "chain.h" // for CBlockIndex #include "validation.h" // for ReadBlockFromDisk() diff --git a/src/sapling/zip32.cpp b/src/sapling/zip32.cpp index 1b94f0c7544be9..d0a752b7e21071 100644 --- a/src/sapling/zip32.cpp +++ b/src/sapling/zip32.cpp @@ -1,14 +1,15 @@ -// Copyright (c) 2018 The Zcash developers +// Copyright (c) 2018-2020 The ZCash developers +// Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or https://www.opensource.org/licenses/mit-license.php. #include "sapling/zip32.h" #include "hash.h" #include "random.h" +#include "sapling/prf.h" #include "streams.h" #include "version.h" -#include "sapling/prf.h" #include #include diff --git a/src/sapling/zip32.h b/src/sapling/zip32.h index 5a245e84e153de..c7af3a69093f0a 100644 --- a/src/sapling/zip32.h +++ b/src/sapling/zip32.h @@ -1,19 +1,18 @@ -// Copyright (c) 2018 The Zcash developers +// Copyright (c) 2018-2020 The ZCash developers +// Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or https://www.opensource.org/licenses/mit-license.php. #ifndef PIVX_ZIP32_H #define PIVX_ZIP32_H -#include "uint256.h" #include "key.h" +#include "optional.h" #include "sapling/address.h" #include "serialize.h" #include "support/allocators/zeroafterfree.h" #include "uint256.h" -#include "optional.h" - const uint32_t ZIP32_HARDENED_KEY_LIMIT = 0x80000000; const size_t ZIP32_XFVK_SIZE = 169; const size_t ZIP32_XSK_SIZE = 169; diff --git a/src/util/system.h b/src/util/system.h index b786688fb79ebd..198e7fb6b08850 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -1,9 +1,9 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers -// Copyright (c) 2015-2020 The PIVX developers +// Copyright (c) 2015-2021 The PIVX developers // Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or https://www.opensource.org/licenses/mit-license.php. /** * Server/client environment: argument handling, config file parsing, @@ -19,6 +19,7 @@ #include "fs.h" #include "logging.h" #include "compat.h" +#include "optional.h" #include "sync.h" #include "tinyformat.h" #include "utiltime.h" diff --git a/src/wallet/test/wallet_shielded_balances_tests.cpp b/src/wallet/test/wallet_shielded_balances_tests.cpp index df8de86f5a8a85..6b1840cd8f21f0 100644 --- a/src/wallet/test/wallet_shielded_balances_tests.cpp +++ b/src/wallet/test/wallet_shielded_balances_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020 The PIVX developers +// Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying // file COPYING or https://www.opensource.org/licenses/mit-license.php. @@ -14,7 +14,6 @@ #include "wallet/wallet.h" #include - #include CAmount fee = COIN; // Hardcoded fee