From e0661813dcda2ef67341646ed6d2f8a2efb9310d Mon Sep 17 00:00:00 2001 From: Jon Layton Date: Thu, 2 Aug 2018 01:06:03 -0500 Subject: [PATCH] [wallet] Initial (partial, test) changes to fix include guards from Zcash for Bitcoin's lint script --- .vscode/settings.json | 57 +++++++++++++++++++++++++++++ src/asyncrpcoperation.h | 5 ++- src/asyncrpcqueue.h | 5 ++- src/consensus/joinsplit.h | 6 +-- src/fork.h | 6 +-- src/primitives/joinsplit.h | 4 +- src/zcash/Address.cpp | 4 ++ src/zcash/Address.hpp | 11 ++++-- src/zcash/GenerateParams.cpp | 4 ++ src/zcash/IncrementalMerkleTree.cpp | 5 +++ src/zcash/IncrementalMerkleTree.hpp | 11 ++++-- src/zcash/JoinSplit.cpp | 5 +++ src/zcash/JoinSplit.hpp | 11 ++++-- src/zcash/Note.cpp | 4 ++ src/zcash/Note.hpp | 11 ++++-- src/zcash/NoteEncryption.cpp | 4 ++ src/zcash/NoteEncryption.hpp | 14 +++---- src/zcash/Proof.cpp | 4 ++ src/zcash/Proof.hpp | 11 ++++-- src/zcash/Zcash.h | 11 ++++-- src/zcash/prf.cpp | 4 ++ src/zcash/prf.h | 11 ++++-- src/zcash/util.cpp | 4 ++ src/zcash/util.h | 11 ++++-- 24 files changed, 180 insertions(+), 43 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..fb3b917c6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,57 @@ +{ + "files.associations": { + "cctype": "cpp", + "cmath": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "array": "cpp", + "atomic": "cpp", + "strstream": "cpp", + "*.tcc": "cpp", + "bitset": "cpp", + "chrono": "cpp", + "clocale": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "cstdint": "cpp", + "deque": "cpp", + "list": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "fstream": "cpp", + "functional": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "memory": "cpp", + "mutex": "cpp", + "new": "cpp", + "ostream": "cpp", + "numeric": "cpp", + "ratio": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "system_error": "cpp", + "thread": "cpp", + "cinttypes": "cpp", + "type_traits": "cpp", + "tuple": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "utility": "cpp" + } +} \ No newline at end of file diff --git a/src/asyncrpcoperation.h b/src/asyncrpcoperation.h index 2b821e256..3247453e6 100644 --- a/src/asyncrpcoperation.h +++ b/src/asyncrpcoperation.h @@ -1,10 +1,11 @@ +// Copyright (c) 2016 The Bitcoin Private developers // Copyright (c) 2016 The Zcash developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef ASYNCRPCOPERATION_H -#define ASYNCRPCOPERATION_H +#ifndef BITCOIN_ASYNCRPCOPERATION_H +#define BITCOIN_ASYNCRPCOPERATION_H #include #include diff --git a/src/asyncrpcqueue.h b/src/asyncrpcqueue.h index 5c4b11647..a333b65ab 100644 --- a/src/asyncrpcqueue.h +++ b/src/asyncrpcqueue.h @@ -1,9 +1,10 @@ +// Copyright (c) 2018 The Bitcoin Private developers // Copyright (c) 2016 The Zcash developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef ASYNCRPCQUEUE_H -#define ASYNCRPCQUEUE_H +#ifndef BITCOIN_ASYNCRPCQUEUE_H +#define BITCOIN_ASYNCRPCQUEUE_H #include diff --git a/src/consensus/joinsplit.h b/src/consensus/joinsplit.h index badb9af31..b5187e627 100644 --- a/src/consensus/joinsplit.h +++ b/src/consensus/joinsplit.h @@ -1,9 +1,9 @@ -// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2018 The Bitcoin Private developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BTCP_CONSENSUS_JOINSPLIT_H -#define BTCP_CONSENSUS_JOINSPLIT_H +#ifndef BITCOIN_CONSENSUS_JOINSPLIT_H +#define BITCOIN_CONSENSUS_JOINSPLIT_H bool CheckTransactionJoinsplits(const CTransaction& tx, CValidationState &state); diff --git a/src/fork.h b/src/fork.h index 063fc1b9e..2683e9f14 100644 --- a/src/fork.h +++ b/src/fork.h @@ -1,9 +1,9 @@ -// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2018 The Bitcoin Private developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BTCP_FORK_H -#define BTCP_FORK_H +#ifndef BITCOIN_FORK_H +#define BITCOIN_FORK_H #include #include diff --git a/src/primitives/joinsplit.h b/src/primitives/joinsplit.h index adf3475de..104b04ea4 100644 --- a/src/primitives/joinsplit.h +++ b/src/primitives/joinsplit.h @@ -4,8 +4,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BTCP_PRIMITIVES_JOINSPLIT_H -#define BTCP_PRIMITIVES_JOINSPLIT_H +#ifndef BITCOIN_PRIMITIVES_JOINSPLIT_H +#define BITCOIN_PRIMITIVES_JOINSPLIT_H #include #include diff --git a/src/zcash/Address.cpp b/src/zcash/Address.cpp index baefeae4e..4089c087a 100644 --- a/src/zcash/Address.cpp +++ b/src/zcash/Address.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "Address.hpp" #include "NoteEncryption.hpp" #include "hash.h" diff --git a/src/zcash/Address.hpp b/src/zcash/Address.hpp index c165c20dd..3df401f5f 100644 --- a/src/zcash/Address.hpp +++ b/src/zcash/Address.hpp @@ -1,5 +1,10 @@ -#ifndef ZC_ADDRESS_H_ -#define ZC_ADDRESS_H_ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_ZCASH_ADDRESS_H +#define BITCOIN_ZCASH_ADDRESS_H #include "uint256.h" #include "uint252.h" @@ -88,4 +93,4 @@ public: } -#endif // ZC_ADDRESS_H_ +#endif // BITCOIN_ZCASH_ADDRESS_H diff --git a/src/zcash/GenerateParams.cpp b/src/zcash/GenerateParams.cpp index 8ca2d7814..ffc4d2dd9 100644 --- a/src/zcash/GenerateParams.cpp +++ b/src/zcash/GenerateParams.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "zcash/JoinSplit.hpp" #include diff --git a/src/zcash/IncrementalMerkleTree.cpp b/src/zcash/IncrementalMerkleTree.cpp index d59e707fa..6518bfc73 100644 --- a/src/zcash/IncrementalMerkleTree.cpp +++ b/src/zcash/IncrementalMerkleTree.cpp @@ -1,3 +1,8 @@ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include #include diff --git a/src/zcash/IncrementalMerkleTree.hpp b/src/zcash/IncrementalMerkleTree.hpp index 57f9a0c4b..6f6df3401 100644 --- a/src/zcash/IncrementalMerkleTree.hpp +++ b/src/zcash/IncrementalMerkleTree.hpp @@ -1,5 +1,10 @@ -#ifndef ZC_INCREMENTALMERKLETREE_H_ -#define ZC_INCREMENTALMERKLETREE_H_ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_ZCASH_INCREMENTALMERKLETREE_H +#define BITCOIN_ZCASH_INCREMENTALMERKLETREE_H #include #include @@ -203,4 +208,4 @@ typedef libzcash::IncrementalMerkleTree ZCIncrementalWitness; typedef libzcash::IncrementalWitness ZCTestingIncrementalWitness; -#endif /* ZC_INCREMENTALMERKLETREE_H_ */ +#endif // BITCOIN_ZCASH_INCREMENTALMERKLETREE_H diff --git a/src/zcash/JoinSplit.cpp b/src/zcash/JoinSplit.cpp index b0e8819b8..98fa381db 100644 --- a/src/zcash/JoinSplit.cpp +++ b/src/zcash/JoinSplit.cpp @@ -1,3 +1,8 @@ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "JoinSplit.hpp" #include "prf.h" #include "sodium.h" diff --git a/src/zcash/JoinSplit.hpp b/src/zcash/JoinSplit.hpp index fa9dfcc7a..8a1ff6c02 100644 --- a/src/zcash/JoinSplit.hpp +++ b/src/zcash/JoinSplit.hpp @@ -1,5 +1,10 @@ -#ifndef ZC_JOINSPLIT_H_ -#define ZC_JOINSPLIT_H_ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_ZCASH_JOINSPLIT_H +#define BITCOIN_ZCASH_JOINSPLIT_H #include "Zcash.h" #include "Proof.hpp" @@ -102,4 +107,4 @@ protected: typedef libzcash::JoinSplit ZCJoinSplit; -#endif // ZC_JOINSPLIT_H_ +#endif // BITCOIN_ZCASH_JOINSPLIT_H diff --git a/src/zcash/Note.cpp b/src/zcash/Note.cpp index 72c80c8ca..9c7b587ad 100644 --- a/src/zcash/Note.cpp +++ b/src/zcash/Note.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "Note.hpp" #include "prf.h" #include "crypto/sha256.h" diff --git a/src/zcash/Note.hpp b/src/zcash/Note.hpp index 66144fa4c..94be6dc7b 100644 --- a/src/zcash/Note.hpp +++ b/src/zcash/Note.hpp @@ -1,5 +1,10 @@ -#ifndef ZC_NOTE_H_ -#define ZC_NOTE_H_ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_ZCASH_NOTE_H +#define BITCOIN_ZCASH_NOTE_H #include "uint256.h" #include "Zcash.h" @@ -69,4 +74,4 @@ public: } -#endif // ZC_NOTE_H_ +#endif // BITCOIN_ZCASH_NOTE_H diff --git a/src/zcash/NoteEncryption.cpp b/src/zcash/NoteEncryption.cpp index 9ae0ba5c3..8cf7f5ddc 100644 --- a/src/zcash/NoteEncryption.cpp +++ b/src/zcash/NoteEncryption.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "NoteEncryption.hpp" #include #include "sodium.h" diff --git a/src/zcash/NoteEncryption.hpp b/src/zcash/NoteEncryption.hpp index 51147b57e..2527f5995 100644 --- a/src/zcash/NoteEncryption.hpp +++ b/src/zcash/NoteEncryption.hpp @@ -1,10 +1,10 @@ -/* -See the Zcash protocol specification for more information. -https://github.com/zcash/zips/blob/master/protocol/protocol.pdf -*/ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef ZC_NOTE_ENCRYPTION_H_ -#define ZC_NOTE_ENCRYPTION_H_ +#ifndef BITCOIN_ZCASH_NOTEENCRYPTION_H +#define BITCOIN_ZCASH_NOTEENCRYPTION_H #include #include "uint256.h" @@ -122,4 +122,4 @@ typedef libzcash::NoteDecryption ZCNoteDecryption; typedef libzcash::PaymentDisclosureNoteDecryption ZCPaymentDisclosureNoteDecryption; -#endif /* ZC_NOTE_ENCRYPTION_H_ */ +#endif // BITCOIN_ZCASH_NOTEENCRYPTION_H diff --git a/src/zcash/Proof.cpp b/src/zcash/Proof.cpp index e7264e684..b6270f3db 100644 --- a/src/zcash/Proof.cpp +++ b/src/zcash/Proof.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "Proof.hpp" #include "crypto/common.h" diff --git a/src/zcash/Proof.hpp b/src/zcash/Proof.hpp index 573a65cd3..163a832bc 100644 --- a/src/zcash/Proof.hpp +++ b/src/zcash/Proof.hpp @@ -1,5 +1,10 @@ -#ifndef ZC_PROOF_H_ -#define ZC_PROOF_H_ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_ZCASH_PROOF_H +#define BITCOIN_ZCASH_PROOF_H #include "serialize.h" #include "uint256.h" @@ -274,4 +279,4 @@ public: } -#endif // ZC_PROOF_H_ +#endif // BITCOIN_ZCASH_PROOF_H diff --git a/src/zcash/Zcash.h b/src/zcash/Zcash.h index 9e6684475..5e00e19b5 100644 --- a/src/zcash/Zcash.h +++ b/src/zcash/Zcash.h @@ -1,5 +1,10 @@ -#ifndef ZC_ZCASH_H_ -#define ZC_ZCASH_H_ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_ZCASH_ZCASH_H +#define BITCOIN_ZCASH_ZCASH_H #define ZC_NUM_JS_INPUTS 2 #define ZC_NUM_JS_OUTPUTS 2 @@ -14,4 +19,4 @@ #define ZC_NOTEPLAINTEXT_SIZE (ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE) -#endif // ZC_ZCASH_H_ +#endif // BITCOIN_ZCASH_ZCASH_H diff --git a/src/zcash/prf.cpp b/src/zcash/prf.cpp index d0f1dc4ec..b154525a5 100644 --- a/src/zcash/prf.cpp +++ b/src/zcash/prf.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "prf.h" #include "crypto/sha256.h" diff --git a/src/zcash/prf.h b/src/zcash/prf.h index dec934f4a..a1d4c6c06 100644 --- a/src/zcash/prf.h +++ b/src/zcash/prf.h @@ -1,10 +1,15 @@ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + /* Zcash uses SHA256Compress as a PRF for various components within the zkSNARK circuit. */ -#ifndef ZC_PRF_H_ -#define ZC_PRF_H_ +#ifndef BITCOIN_ZCASH_PRF_H +#define BITCOIN_ZCASH_PRF_H #include "uint256.h" #include "uint252.h" @@ -15,4 +20,4 @@ uint256 PRF_nf(const uint252& a_sk, const uint256& rho); uint256 PRF_pk(const uint252& a_sk, size_t i0, const uint256& h_sig); uint256 PRF_rho(const uint252& phi, size_t i0, const uint256& h_sig); -#endif // ZC_PRF_H_ +#endif // BITCOIN_ZCASH_PRF_H diff --git a/src/zcash/util.cpp b/src/zcash/util.cpp index 6f32bf79a..34e8f9542 100644 --- a/src/zcash/util.cpp +++ b/src/zcash/util.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "zcash/util.h" #include #include diff --git a/src/zcash/util.h b/src/zcash/util.h index 10886e3ca..eb9f8edf5 100644 --- a/src/zcash/util.h +++ b/src/zcash/util.h @@ -1,5 +1,10 @@ -#ifndef ZC_UTIL_H_ -#define ZC_UTIL_H_ +// Copyright (c) 2018 The Bitcoin Private developers +// Copyright (c) 2016 The Zcash developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_ZCASH_UTIL_H +#define BITCOIN_ZCASH_UTIL_H #include #include @@ -8,4 +13,4 @@ std::vector convertIntToVectorLE(const uint64_t val_int); std::vector convertBytesVectorToVector(const std::vector& bytes); uint64_t convertVectorToInt(const std::vector& v); -#endif // ZC_UTIL_H_ +#endif // BITCOIN_ZCASH_UTIL_H