Refactoring: Rename class libzcash::Note to libzcash::SproutNote.

This commit is contained in:
Simon
2018-04-24 21:20:01 -07:00
parent bef33bbc73
commit b230fe6836
21 changed files with 61 additions and 61 deletions

View File

@@ -462,7 +462,7 @@ bool AsyncRPCOperation_mergetoaddress::main_impl()
hSig,
(unsigned char)changeOutputIndex);
Note note = plaintext.note(changeAddress);
SproutNote note = plaintext.note(changeAddress);
info.notes.push_back(note);
info.zkeys.push_back(changeKey);
@@ -481,7 +481,7 @@ bool AsyncRPCOperation_mergetoaddress::main_impl()
//
// Consume spendable non-change notes
//
std::vector<Note> vInputNotes;
std::vector<SproutNote> vInputNotes;
std::vector<SpendingKey> vInputZKeys;
std::vector<JSOutPoint> vOutPoints;
std::vector<boost::optional<ZCIncrementalWitness>> vInputWitnesses;
@@ -490,7 +490,7 @@ bool AsyncRPCOperation_mergetoaddress::main_impl()
while (numInputsNeeded++ < ZC_NUM_JS_INPUTS && zInputsDeque.size() > 0) {
MergeToAddressInputNote t = zInputsDeque.front();
JSOutPoint jso = std::get<0>(t);
Note note = std::get<1>(t);
SproutNote note = std::get<1>(t);
CAmount noteFunds = std::get<2>(t);
SpendingKey zkey = std::get<3>(t);
zInputsDeque.pop_front();

View File

@@ -28,7 +28,7 @@ using namespace libzcash;
typedef std::tuple<COutPoint, CAmount> MergeToAddressInputUTXO;
// Input JSOP is a tuple of JSOutpoint, note, amount, spending key
typedef std::tuple<JSOutPoint, Note, CAmount, SpendingKey> MergeToAddressInputNote;
typedef std::tuple<JSOutPoint, SproutNote, CAmount, SpendingKey> MergeToAddressInputNote;
// A recipient is a tuple of address, memo (optional if zaddr)
typedef std::tuple<std::string, std::string> MergeToAddressRecipient;
@@ -37,7 +37,7 @@ typedef std::tuple<std::string, std::string> MergeToAddressRecipient;
struct MergeToAddressJSInfo {
std::vector<JSInput> vjsin;
std::vector<JSOutput> vjsout;
std::vector<Note> notes;
std::vector<SproutNote> notes;
std::vector<SpendingKey> zkeys;
CAmount vpub_old = 0;
CAmount vpub_new = 0;

View File

@@ -578,7 +578,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
hSig,
(unsigned char) changeOutputIndex);
Note note = plaintext.note(frompaymentaddress_);
SproutNote note = plaintext.note(frompaymentaddress_);
info.notes.push_back(note);
jsInputValue += plaintext.value;
@@ -597,7 +597,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
//
// Consume spendable non-change notes
//
std::vector<Note> vInputNotes;
std::vector<SproutNote> vInputNotes;
std::vector<JSOutPoint> vOutPoints;
std::vector<boost::optional<ZCIncrementalWitness>> vInputWitnesses;
uint256 inputAnchor;
@@ -605,7 +605,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
while (numInputsNeeded++ < ZC_NUM_JS_INPUTS && zInputsDeque.size() > 0) {
SendManyInputJSOP t = zInputsDeque.front();
JSOutPoint jso = std::get<0>(t);
Note note = std::get<1>(t);
SproutNote note = std::get<1>(t);
CAmount noteFunds = std::get<2>(t);
zInputsDeque.pop_front();

View File

@@ -31,14 +31,14 @@ typedef std::tuple<std::string, CAmount, std::string> SendManyRecipient;
typedef std::tuple<uint256, int, CAmount, bool> SendManyInputUTXO;
// Input JSOP is a tuple of JSOutpoint, note and amount
typedef std::tuple<JSOutPoint, Note, CAmount> SendManyInputJSOP;
typedef std::tuple<JSOutPoint, SproutNote, CAmount> SendManyInputJSOP;
// Package of info which is passed to perform_joinsplit methods.
struct AsyncJoinSplitInfo
{
std::vector<JSInput> vjsin;
std::vector<JSOutput> vjsout;
std::vector<Note> notes;
std::vector<SproutNote> notes;
CAmount vpub_old = 0;
CAmount vpub_new = 0;
};

View File

@@ -72,13 +72,13 @@ CWalletTx GetValidReceive(const libzcash::SpendingKey& sk, CAmount value, bool r
return GetValidReceive(*params, sk, value, randomInputs);
}
libzcash::Note GetNote(const libzcash::SpendingKey& sk,
libzcash::SproutNote GetNote(const libzcash::SpendingKey& sk,
const CTransaction& tx, size_t js, size_t n) {
return GetNote(*params, sk, tx, js, n);
}
CWalletTx GetValidSpend(const libzcash::SpendingKey& sk,
const libzcash::Note& note, CAmount value) {
const libzcash::SproutNote& note, CAmount value) {
return GetValidSpend(*params, sk, note, value);
}

View File

@@ -283,7 +283,7 @@ UniValue z_validatepaymentdisclosure(const UniValue& params, bool fHelp)
// Check the blockchain commitment matches decrypted note commitment
uint256 cm_blockchain = jsdesc.commitments[pd.payload.n];
Note note = npt.note(zaddr);
SproutNote note = npt.note(zaddr);
uint256 cm_decrypted = note.cm();
bool cm_match = (cm_decrypted == cm_blockchain);
o.push_back(Pair("commitmentMatch", cm_match));

View File

@@ -2817,7 +2817,7 @@ UniValue zc_raw_receive(const UniValue& params, bool fHelp)
nonce
);
PaymentAddress payment_addr = k.address();
Note decrypted_note = npt.note(payment_addr);
SproutNote decrypted_note = npt.note(payment_addr);
assert(pwalletMain != NULL);
std::vector<boost::optional<ZCIncrementalWitness>> witnesses;
@@ -2891,7 +2891,7 @@ UniValue zc_raw_joinsplit(const UniValue& params, bool fHelp)
std::vector<JSInput> vjsin;
std::vector<JSOutput> vjsout;
std::vector<Note> notes;
std::vector<SproutNote> notes;
std::vector<SpendingKey> keys;
std::vector<uint256> commitments;
@@ -2909,7 +2909,7 @@ UniValue zc_raw_joinsplit(const UniValue& params, bool fHelp)
}
PaymentAddress addr = k.address();
Note note = npt.note(addr);
SproutNote note = npt.note(addr);
notes.push_back(note);
commitments.push_back(note.cm());
}