Remove nType and nVersion from Zcash-specific code
This commit is contained in:
@@ -49,7 +49,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(this->nVersion);
|
||||
nVersion = this->nVersion;
|
||||
READWRITE(nRelayUntil);
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(vchMsg);
|
||||
READWRITE(vchSig);
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ public:
|
||||
|
||||
// Only read/write nSproutValue if the client version used to create
|
||||
// this index was storing them.
|
||||
if ((nType & SER_DISK) && (nVersion >= SPROUT_VALUE_VERSION)) {
|
||||
if ((s.GetType() & SER_DISK) && (nVersion >= SPROUT_VALUE_VERSION)) {
|
||||
READWRITE(nSproutValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
template<typename T>
|
||||
CBLAKE2bWriter& operator<<(const T& obj) {
|
||||
// Serialize to this stream
|
||||
::Serialize(*this, obj, nType, nVersion);
|
||||
::Serialize(*this, obj);
|
||||
return (*this);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ struct PaymentDisclosureInfo {
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(version);
|
||||
READWRITE(esk);
|
||||
READWRITE(joinSplitPrivKey);
|
||||
@@ -81,7 +81,7 @@ struct PaymentDisclosurePayload {
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(marker);
|
||||
READWRITE(version);
|
||||
READWRITE(esk);
|
||||
@@ -123,7 +123,7 @@ struct PaymentDisclosure {
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(payload);
|
||||
READWRITE(payloadSig);
|
||||
}
|
||||
|
||||
@@ -155,9 +155,8 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(this->nVersion);
|
||||
nVersion = this->nVersion;
|
||||
READWRITE(hashPrevBlock);
|
||||
READWRITE(hashMerkleRoot);
|
||||
READWRITE(hashReserved);
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(vpub_old);
|
||||
READWRITE(vpub_new);
|
||||
READWRITE(anchor);
|
||||
@@ -383,7 +383,6 @@ public:
|
||||
uint32_t header = GetHeader();
|
||||
READWRITE(header);
|
||||
}
|
||||
nVersion = this->nVersion;
|
||||
if (fOverwintered) {
|
||||
READWRITE(*const_cast<uint32_t*>(&this->nVersionGroupId));
|
||||
}
|
||||
@@ -498,7 +497,6 @@ struct CMutableTransaction
|
||||
}
|
||||
READWRITE(header);
|
||||
}
|
||||
nVersion = this->nVersion;
|
||||
if (fOverwintered) {
|
||||
READWRITE(nVersionGroupId);
|
||||
}
|
||||
|
||||
@@ -1046,12 +1046,12 @@ public:
|
||||
// keeps the JoinSplit cryptographically bound
|
||||
// to the transaction.
|
||||
//
|
||||
::Serialize(s, txTo.vjoinsplit, nType, nVersion);
|
||||
::Serialize(s, txTo.vjoinsplit);
|
||||
if (txTo.vjoinsplit.size() > 0) {
|
||||
::Serialize(s, txTo.joinSplitPubKey, nType, nVersion);
|
||||
::Serialize(s, txTo.joinSplitPubKey);
|
||||
|
||||
CTransaction::joinsplit_sig_t nullSig = {};
|
||||
::Serialize(s, nullSig, nType, nVersion);
|
||||
::Serialize(s, nullSig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,14 +503,14 @@ template<typename Stream, typename T, typename A> inline void Unserialize(Stream
|
||||
/**
|
||||
* optional
|
||||
*/
|
||||
template<typename Stream, typename T> void Serialize(Stream& os, const boost::optional<T>& item, int nType, int nVersion);
|
||||
template<typename Stream, typename T> void Unserialize(Stream& is, boost::optional<T>& item, int nType, int nVersion);
|
||||
template<typename Stream, typename T> void Serialize(Stream& os, const boost::optional<T>& item);
|
||||
template<typename Stream, typename T> void Unserialize(Stream& is, boost::optional<T>& item);
|
||||
|
||||
/**
|
||||
* array
|
||||
*/
|
||||
template<typename Stream, typename T, std::size_t N> void Serialize(Stream& os, const boost::array<T, N>& item, int nType, int nVersion);
|
||||
template<typename Stream, typename T, std::size_t N> void Unserialize(Stream& is, boost::array<T, N>& item, int nType, int nVersion);
|
||||
template<typename Stream, typename T, std::size_t N> void Serialize(Stream& os, const boost::array<T, N>& item);
|
||||
template<typename Stream, typename T, std::size_t N> void Unserialize(Stream& is, boost::array<T, N>& item);
|
||||
|
||||
/**
|
||||
* pair
|
||||
@@ -533,8 +533,8 @@ template<typename Stream, typename K, typename Pred, typename A> void Unserializ
|
||||
/**
|
||||
* list
|
||||
*/
|
||||
template<typename Stream, typename T, typename A> void Serialize(Stream& os, const std::list<T, A>& m, int nType, int nVersion);
|
||||
template<typename Stream, typename T, typename A> void Unserialize(Stream& is, std::list<T, A>& m, int nType, int nVersion);
|
||||
template<typename Stream, typename T, typename A> void Serialize(Stream& os, const std::list<T, A>& m);
|
||||
template<typename Stream, typename T, typename A> void Unserialize(Stream& is, std::list<T, A>& m);
|
||||
|
||||
|
||||
|
||||
@@ -721,31 +721,31 @@ inline void Unserialize(Stream& is, std::vector<T, A>& v)
|
||||
* optional
|
||||
*/
|
||||
template<typename Stream, typename T>
|
||||
void Serialize(Stream& os, const boost::optional<T>& item, int nType, int nVersion)
|
||||
void Serialize(Stream& os, const boost::optional<T>& item)
|
||||
{
|
||||
// If the value is there, put 0x01 and then serialize the value.
|
||||
// If it's not, put 0x00.
|
||||
if (item) {
|
||||
unsigned char discriminant = 0x01;
|
||||
Serialize(os, discriminant, nType, nVersion);
|
||||
Serialize(os, *item, nType, nVersion);
|
||||
Serialize(os, discriminant);
|
||||
Serialize(os, *item);
|
||||
} else {
|
||||
unsigned char discriminant = 0x00;
|
||||
Serialize(os, discriminant, nType, nVersion);
|
||||
Serialize(os, discriminant);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Stream, typename T>
|
||||
void Unserialize(Stream& is, boost::optional<T>& item, int nType, int nVersion)
|
||||
void Unserialize(Stream& is, boost::optional<T>& item)
|
||||
{
|
||||
unsigned char discriminant = 0x00;
|
||||
Unserialize(is, discriminant, nType, nVersion);
|
||||
Unserialize(is, discriminant);
|
||||
|
||||
if (discriminant == 0x00) {
|
||||
item = boost::none;
|
||||
} else if (discriminant == 0x01) {
|
||||
T object;
|
||||
Unserialize(is, object, nType, nVersion);
|
||||
Unserialize(is, object);
|
||||
item = object;
|
||||
} else {
|
||||
throw std::ios_base::failure("non-canonical optional discriminant");
|
||||
@@ -758,18 +758,18 @@ void Unserialize(Stream& is, boost::optional<T>& item, int nType, int nVersion)
|
||||
* array
|
||||
*/
|
||||
template<typename Stream, typename T, std::size_t N>
|
||||
void Serialize(Stream& os, const boost::array<T, N>& item, int nType, int nVersion)
|
||||
void Serialize(Stream& os, const boost::array<T, N>& item)
|
||||
{
|
||||
for (size_t i = 0; i < N; i++) {
|
||||
Serialize(os, item[i], nType, nVersion);
|
||||
Serialize(os, item[i]);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Stream, typename T, std::size_t N>
|
||||
void Unserialize(Stream& is, boost::array<T, N>& item, int nType, int nVersion)
|
||||
void Unserialize(Stream& is, boost::array<T, N>& item)
|
||||
{
|
||||
for (size_t i = 0; i < N; i++) {
|
||||
Unserialize(is, item[i], nType, nVersion);
|
||||
Unserialize(is, item[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -851,15 +851,15 @@ void Unserialize(Stream& is, std::set<K, Pred, A>& m)
|
||||
* list
|
||||
*/
|
||||
template<typename Stream, typename T, typename A>
|
||||
void Serialize(Stream& os, const std::list<T, A>& l, int nType, int nVersion)
|
||||
void Serialize(Stream& os, const std::list<T, A>& l)
|
||||
{
|
||||
WriteCompactSize(os, l.size());
|
||||
for (typename std::list<T, A>::const_iterator it = l.begin(); it != l.end(); ++it)
|
||||
Serialize(os, (*it), nType, nVersion);
|
||||
Serialize(os, (*it));
|
||||
}
|
||||
|
||||
template<typename Stream, typename T, typename A>
|
||||
void Unserialize(Stream& is, std::list<T, A>& l, int nType, int nVersion)
|
||||
void Unserialize(Stream& is, std::list<T, A>& l)
|
||||
{
|
||||
l.clear();
|
||||
unsigned int nSize = ReadCompactSize(is);
|
||||
@@ -867,7 +867,7 @@ void Unserialize(Stream& is, std::list<T, A>& l, int nType, int nVersion)
|
||||
for (unsigned int i = 0; i < nSize; i++)
|
||||
{
|
||||
T item;
|
||||
Unserialize(is, item, nType, nVersion);
|
||||
Unserialize(is, item);
|
||||
l.push_back(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(contents);
|
||||
|
||||
if ((*contents.begin()) & 0xF0) {
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(hash);
|
||||
READWRITE(js);
|
||||
READWRITE(n);
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(address);
|
||||
READWRITE(nullifier);
|
||||
READWRITE(witnesses);
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(a_pk);
|
||||
READWRITE(pk_enc);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(a_pk);
|
||||
READWRITE(sk_enc);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
std::vector<std::vector<unsigned char>> pathBytes;
|
||||
uint64_t indexInt;
|
||||
if (ser_action.ForRead()) {
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(left);
|
||||
READWRITE(right);
|
||||
READWRITE(parents);
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(tree);
|
||||
READWRITE(filled);
|
||||
READWRITE(cursor);
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
unsigned char leadingByte = 0x00;
|
||||
READWRITE(leadingByte);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(data);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(data);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
unsigned char leadingByte = G1_PREFIX_MASK;
|
||||
|
||||
if (y_lsb) {
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
unsigned char leadingByte = G2_PREFIX_MASK;
|
||||
|
||||
if (y_gt) {
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(g_A);
|
||||
READWRITE(g_A_prime);
|
||||
READWRITE(g_B);
|
||||
|
||||
Reference in New Issue
Block a user