Browse Source

Create more data that is needed for making our fake Sapling SpendDescription

z_signmessage
Duke Leto 4 years ago
parent
commit
a45c81e134
  1. 1
      src/wallet/asyncrpcoperation_sendmany.cpp
  2. 8
      src/wallet/rpcwallet.cpp

1
src/wallet/asyncrpcoperation_sendmany.cpp

@ -1159,6 +1159,7 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() {
}
// sort in descending order, so big notes appear first
//TODO: what are the performance and metadata leakage implications of this?
std::sort(z_sprout_inputs_.begin(), z_sprout_inputs_.end(),
[](SendManyInputJSOP i, SendManyInputJSOP j) -> bool {
return std::get<2>(i) > std::get<2>(j);

8
src/wallet/rpcwallet.cpp

@ -913,10 +913,13 @@ UniValue z_signmessage(const UniValue& params, bool fHelp, const CPubKey& mypk)
// Create data needed to make a SpendDescription
SaplingExpandedSpendingKey expsk;
SpendingKey spendingkey_ = boost::apply_visitor(GetSpendingKeyForPaymentAddress(pwalletMain), res).get();
auto sk = boost::get<libzcash::SaplingExtendedSpendingKey>(spendingkey_);
expsk = sk.expsk;
uint256 ovk = expsk.full_viewing_key().ovk;
SaplingNoteEntry noteEntry;
// TODO: get sig data, serialized, encode, return
CHashWriter ss(SER_GETHASH, 0);
// TODO: different magic?
@ -939,7 +942,10 @@ UniValue z_signmessage(const UniValue& params, bool fHelp, const CPubKey& mypk)
vector<unsigned char> vchSig;
//TODO: Actually get sig data
SpendDescription shieldedSpend;
SpendDescriptionInfo spend;
SaplingNote fakenote;
uint256 anchor;
SaplingWitness witness;
SpendDescriptionInfo spend = SpendDescriptionInfo(expsk, fakenote, anchor, witness);
librustzcash_sapling_spend_sig(
spend.expsk.ask.begin(),
spend.alpha.begin(),

Loading…
Cancel
Save