Rename CPourTx to JSDescription.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include "tinyformat.h"
|
||||
#include "utilstrencodings.h"
|
||||
|
||||
CPourTx::CPourTx(ZCJoinSplit& params,
|
||||
JSDescription::JSDescription(ZCJoinSplit& params,
|
||||
const uint256& pubKeyHash,
|
||||
const uint256& anchor,
|
||||
const boost::array<libzcash::JSInput, ZC_NUM_JS_INPUTS>& inputs,
|
||||
@@ -37,7 +37,7 @@ CPourTx::CPourTx(ZCJoinSplit& params,
|
||||
);
|
||||
}
|
||||
|
||||
bool CPourTx::Verify(
|
||||
bool JSDescription::Verify(
|
||||
ZCJoinSplit& params,
|
||||
const uint256& pubKeyHash
|
||||
) const {
|
||||
@@ -54,7 +54,7 @@ bool CPourTx::Verify(
|
||||
);
|
||||
}
|
||||
|
||||
uint256 CPourTx::h_sig(ZCJoinSplit& params, const uint256& pubKeyHash) const
|
||||
uint256 JSDescription::h_sig(ZCJoinSplit& params, const uint256& pubKeyHash) const
|
||||
{
|
||||
return params.h_sig(randomSeed, serials, pubKeyHash);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) {
|
||||
*const_cast<std::vector<CTxIn>*>(&vin) = tx.vin;
|
||||
*const_cast<std::vector<CTxOut>*>(&vout) = tx.vout;
|
||||
*const_cast<unsigned int*>(&nLockTime) = tx.nLockTime;
|
||||
*const_cast<std::vector<CPourTx>*>(&vpour) = tx.vpour;
|
||||
*const_cast<std::vector<JSDescription>*>(&vpour) = tx.vpour;
|
||||
*const_cast<uint256*>(&joinSplitPubKey) = tx.joinSplitPubKey;
|
||||
*const_cast<joinsplit_sig_t*>(&joinSplitSig) = tx.joinSplitSig;
|
||||
*const_cast<uint256*>(&hash) = tx.hash;
|
||||
@@ -156,7 +156,7 @@ CAmount CTransaction::GetValueOut() const
|
||||
throw std::runtime_error("CTransaction::GetValueOut(): value out of range");
|
||||
}
|
||||
|
||||
for (std::vector<CPourTx>::const_iterator it(vpour.begin()); it != vpour.end(); ++it)
|
||||
for (std::vector<JSDescription>::const_iterator it(vpour.begin()); it != vpour.end(); ++it)
|
||||
{
|
||||
// NB: vpub_old "takes" money from the value pool just as outputs do
|
||||
nValueOut += it->vpub_old;
|
||||
@@ -170,7 +170,7 @@ CAmount CTransaction::GetValueOut() const
|
||||
CAmount CTransaction::GetPourValueIn() const
|
||||
{
|
||||
CAmount nValue = 0;
|
||||
for (std::vector<CPourTx>::const_iterator it(vpour.begin()); it != vpour.end(); ++it)
|
||||
for (std::vector<JSDescription>::const_iterator it(vpour.begin()); it != vpour.end(); ++it)
|
||||
{
|
||||
// NB: vpub_new "gives" money to the value pool just as inputs do
|
||||
nValue += it->vpub_new;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "zcash/Zcash.h"
|
||||
#include "zcash/JoinSplit.hpp"
|
||||
|
||||
class CPourTx
|
||||
class JSDescription
|
||||
{
|
||||
public:
|
||||
// These values 'enter from' and 'exit to' the value
|
||||
@@ -65,9 +65,9 @@ public:
|
||||
// This is a zk-SNARK which ensures that this pour is valid.
|
||||
boost::array<unsigned char, ZKSNARK_PROOF_SIZE> proof;
|
||||
|
||||
CPourTx(): vpub_old(0), vpub_new(0) { }
|
||||
JSDescription(): vpub_old(0), vpub_new(0) { }
|
||||
|
||||
CPourTx(ZCJoinSplit& params,
|
||||
JSDescription(ZCJoinSplit& params,
|
||||
const uint256& pubKeyHash,
|
||||
const uint256& rt,
|
||||
const boost::array<libzcash::JSInput, ZC_NUM_JS_INPUTS>& inputs,
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
READWRITE(proof);
|
||||
}
|
||||
|
||||
friend bool operator==(const CPourTx& a, const CPourTx& b)
|
||||
friend bool operator==(const JSDescription& a, const JSDescription& b)
|
||||
{
|
||||
return (
|
||||
a.vpub_old == b.vpub_old &&
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
friend bool operator!=(const CPourTx& a, const CPourTx& b)
|
||||
friend bool operator!=(const JSDescription& a, const JSDescription& b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
@@ -303,7 +303,7 @@ public:
|
||||
const std::vector<CTxIn> vin;
|
||||
const std::vector<CTxOut> vout;
|
||||
const uint32_t nLockTime;
|
||||
const std::vector<CPourTx> vpour;
|
||||
const std::vector<JSDescription> vpour;
|
||||
const uint256 joinSplitPubKey;
|
||||
const joinsplit_sig_t joinSplitSig;
|
||||
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
READWRITE(*const_cast<std::vector<CTxOut>*>(&vout));
|
||||
READWRITE(*const_cast<uint32_t*>(&nLockTime));
|
||||
if (nVersion >= 2) {
|
||||
READWRITE(*const_cast<std::vector<CPourTx>*>(&vpour));
|
||||
READWRITE(*const_cast<std::vector<JSDescription>*>(&vpour));
|
||||
if (vpour.size() > 0) {
|
||||
READWRITE(*const_cast<uint256*>(&joinSplitPubKey));
|
||||
READWRITE(*const_cast<joinsplit_sig_t*>(&joinSplitSig));
|
||||
@@ -382,7 +382,7 @@ struct CMutableTransaction
|
||||
std::vector<CTxIn> vin;
|
||||
std::vector<CTxOut> vout;
|
||||
uint32_t nLockTime;
|
||||
std::vector<CPourTx> vpour;
|
||||
std::vector<JSDescription> vpour;
|
||||
uint256 joinSplitPubKey;
|
||||
CTransaction::joinsplit_sig_t joinSplitSig;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user