[wallet] Initial (partial, test) changes to fix include guards from Zcash for Bitcoin's lint script

This commit is contained in:
Jon Layton 2018-08-02 01:06:03 -05:00
parent 023bbe679e
commit e0661813dc
24 changed files with 180 additions and 43 deletions

57
.vscode/settings.json vendored Normal file
View File

@ -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"
}
}

View File

@ -1,10 +1,11 @@
// Copyright (c) 2016 The Bitcoin Private developers
// Copyright (c) 2016 The Zcash developers // Copyright (c) 2016 The Zcash developers
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef ASYNCRPCOPERATION_H #ifndef BITCOIN_ASYNCRPCOPERATION_H
#define ASYNCRPCOPERATION_H #define BITCOIN_ASYNCRPCOPERATION_H
#include <string> #include <string>
#include <atomic> #include <atomic>

View File

@ -1,9 +1,10 @@
// Copyright (c) 2018 The Bitcoin Private developers
// Copyright (c) 2016 The Zcash developers // Copyright (c) 2016 The Zcash developers
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef ASYNCRPCQUEUE_H #ifndef BITCOIN_ASYNCRPCQUEUE_H
#define ASYNCRPCQUEUE_H #define BITCOIN_ASYNCRPCQUEUE_H
#include <asyncrpcoperation.h> #include <asyncrpcoperation.h>

View File

@ -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 // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BTCP_CONSENSUS_JOINSPLIT_H #ifndef BITCOIN_CONSENSUS_JOINSPLIT_H
#define BTCP_CONSENSUS_JOINSPLIT_H #define BITCOIN_CONSENSUS_JOINSPLIT_H
bool CheckTransactionJoinsplits(const CTransaction& tx, CValidationState &state); bool CheckTransactionJoinsplits(const CTransaction& tx, CValidationState &state);

View File

@ -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 // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BTCP_FORK_H #ifndef BITCOIN_FORK_H
#define BTCP_FORK_H #define BITCOIN_FORK_H
#include <consensus/validation.h> #include <consensus/validation.h>
#include <primitives/block.h> #include <primitives/block.h>

View File

@ -4,8 +4,8 @@
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BTCP_PRIMITIVES_JOINSPLIT_H #ifndef BITCOIN_PRIMITIVES_JOINSPLIT_H
#define BTCP_PRIMITIVES_JOINSPLIT_H #define BITCOIN_PRIMITIVES_JOINSPLIT_H
#include <amount.h> #include <amount.h>
#include <random.h> #include <random.h>

View File

@ -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 "Address.hpp"
#include "NoteEncryption.hpp" #include "NoteEncryption.hpp"
#include "hash.h" #include "hash.h"

View File

@ -1,5 +1,10 @@
#ifndef ZC_ADDRESS_H_ // Copyright (c) 2018 The Bitcoin Private developers
#define ZC_ADDRESS_H_ // 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 "uint256.h"
#include "uint252.h" #include "uint252.h"
@ -88,4 +93,4 @@ public:
} }
#endif // ZC_ADDRESS_H_ #endif // BITCOIN_ZCASH_ADDRESS_H

View File

@ -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 "zcash/JoinSplit.hpp"
#include <iostream> #include <iostream>

View File

@ -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 <stdexcept> #include <stdexcept>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>

View File

@ -1,5 +1,10 @@
#ifndef ZC_INCREMENTALMERKLETREE_H_ // Copyright (c) 2018 The Bitcoin Private developers
#define ZC_INCREMENTALMERKLETREE_H_ // 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 <array> #include <array>
#include <deque> #include <deque>
@ -203,4 +208,4 @@ typedef libzcash::IncrementalMerkleTree<INCREMENTAL_MERKLE_TREE_DEPTH_TESTING, l
typedef libzcash::IncrementalWitness<INCREMENTAL_MERKLE_TREE_DEPTH, libzcash::SHA256Compress> ZCIncrementalWitness; typedef libzcash::IncrementalWitness<INCREMENTAL_MERKLE_TREE_DEPTH, libzcash::SHA256Compress> ZCIncrementalWitness;
typedef libzcash::IncrementalWitness<INCREMENTAL_MERKLE_TREE_DEPTH_TESTING, libzcash::SHA256Compress> ZCTestingIncrementalWitness; typedef libzcash::IncrementalWitness<INCREMENTAL_MERKLE_TREE_DEPTH_TESTING, libzcash::SHA256Compress> ZCTestingIncrementalWitness;
#endif /* ZC_INCREMENTALMERKLETREE_H_ */ #endif // BITCOIN_ZCASH_INCREMENTALMERKLETREE_H

View File

@ -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 "JoinSplit.hpp"
#include "prf.h" #include "prf.h"
#include "sodium.h" #include "sodium.h"

View File

@ -1,5 +1,10 @@
#ifndef ZC_JOINSPLIT_H_ // Copyright (c) 2018 The Bitcoin Private developers
#define ZC_JOINSPLIT_H_ // 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 "Zcash.h"
#include "Proof.hpp" #include "Proof.hpp"
@ -102,4 +107,4 @@ protected:
typedef libzcash::JoinSplit<ZC_NUM_JS_INPUTS, typedef libzcash::JoinSplit<ZC_NUM_JS_INPUTS,
ZC_NUM_JS_OUTPUTS> ZCJoinSplit; ZC_NUM_JS_OUTPUTS> ZCJoinSplit;
#endif // ZC_JOINSPLIT_H_ #endif // BITCOIN_ZCASH_JOINSPLIT_H

View File

@ -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 "Note.hpp"
#include "prf.h" #include "prf.h"
#include "crypto/sha256.h" #include "crypto/sha256.h"

View File

@ -1,5 +1,10 @@
#ifndef ZC_NOTE_H_ // Copyright (c) 2018 The Bitcoin Private developers
#define ZC_NOTE_H_ // 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 "uint256.h"
#include "Zcash.h" #include "Zcash.h"
@ -69,4 +74,4 @@ public:
} }
#endif // ZC_NOTE_H_ #endif // BITCOIN_ZCASH_NOTE_H

View File

@ -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 "NoteEncryption.hpp"
#include <stdexcept> #include <stdexcept>
#include "sodium.h" #include "sodium.h"

View File

@ -1,10 +1,10 @@
/* // Copyright (c) 2018 The Bitcoin Private developers
See the Zcash protocol specification for more information. // Copyright (c) 2016 The Zcash developers
https://github.com/zcash/zips/blob/master/protocol/protocol.pdf // 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_ #ifndef BITCOIN_ZCASH_NOTEENCRYPTION_H
#define ZC_NOTE_ENCRYPTION_H_ #define BITCOIN_ZCASH_NOTEENCRYPTION_H
#include <array> #include <array>
#include "uint256.h" #include "uint256.h"
@ -122,4 +122,4 @@ typedef libzcash::NoteDecryption<ZC_NOTEPLAINTEXT_SIZE> ZCNoteDecryption;
typedef libzcash::PaymentDisclosureNoteDecryption<ZC_NOTEPLAINTEXT_SIZE> ZCPaymentDisclosureNoteDecryption; typedef libzcash::PaymentDisclosureNoteDecryption<ZC_NOTEPLAINTEXT_SIZE> ZCPaymentDisclosureNoteDecryption;
#endif /* ZC_NOTE_ENCRYPTION_H_ */ #endif // BITCOIN_ZCASH_NOTEENCRYPTION_H

View File

@ -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 "Proof.hpp"
#include "crypto/common.h" #include "crypto/common.h"

View File

@ -1,5 +1,10 @@
#ifndef ZC_PROOF_H_ // Copyright (c) 2018 The Bitcoin Private developers
#define ZC_PROOF_H_ // 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 "serialize.h"
#include "uint256.h" #include "uint256.h"
@ -274,4 +279,4 @@ public:
} }
#endif // ZC_PROOF_H_ #endif // BITCOIN_ZCASH_PROOF_H

View File

@ -1,5 +1,10 @@
#ifndef ZC_ZCASH_H_ // Copyright (c) 2018 The Bitcoin Private developers
#define ZC_ZCASH_H_ // 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_INPUTS 2
#define ZC_NUM_JS_OUTPUTS 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) #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

View File

@ -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 "prf.h"
#include "crypto/sha256.h" #include "crypto/sha256.h"

View File

@ -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 Zcash uses SHA256Compress as a PRF for various components
within the zkSNARK circuit. within the zkSNARK circuit.
*/ */
#ifndef ZC_PRF_H_ #ifndef BITCOIN_ZCASH_PRF_H
#define ZC_PRF_H_ #define BITCOIN_ZCASH_PRF_H
#include "uint256.h" #include "uint256.h"
#include "uint252.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_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); uint256 PRF_rho(const uint252& phi, size_t i0, const uint256& h_sig);
#endif // ZC_PRF_H_ #endif // BITCOIN_ZCASH_PRF_H

View File

@ -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 "zcash/util.h"
#include <algorithm> #include <algorithm>
#include <stdexcept> #include <stdexcept>

View File

@ -1,5 +1,10 @@
#ifndef ZC_UTIL_H_ // Copyright (c) 2018 The Bitcoin Private developers
#define ZC_UTIL_H_ // 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 <vector> #include <vector>
#include <cstdint> #include <cstdint>
@ -8,4 +13,4 @@ std::vector<unsigned char> convertIntToVectorLE(const uint64_t val_int);
std::vector<bool> convertBytesVectorToVector(const std::vector<unsigned char>& bytes); std::vector<bool> convertBytesVectorToVector(const std::vector<unsigned char>& bytes);
uint64_t convertVectorToInt(const std::vector<bool>& v); uint64_t convertVectorToInt(const std::vector<bool>& v);
#endif // ZC_UTIL_H_ #endif // BITCOIN_ZCASH_UTIL_H