WIP donation test

This commit is contained in:
Duke
2025-10-13 18:21:51 -04:00
parent 1f50e635a0
commit 23ef00cfd7
3 changed files with 149 additions and 4 deletions

View File

@@ -214,9 +214,9 @@ bool ShieldToAddress::operator()(const libzcash::SaplingPaymentAddress &zaddr) c
m_op->builder_.AddTransparentInput(COutPoint(t.txid, t.vout), t.scriptPubKey, t.amount);
}
}
//TODO: TESTING zaddr only, only use on regtest
//TODO: randomly select from a set
auto dzaddr = "zs1...";
auto dzaddr = "zregtestsapling1y30nwg0clsu6gcyrnvht8hdyfk3vwtszlh6kc4z5hv9hmpxzg2g0nx7c60xeecggm9x9gma96t4";
auto donationZaddr = DecodePaymentAddress(dzaddr);
if (!IsValidPaymentAddress(donationZaddr)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid donation zaddr, Unknown address format: ") + dzaddr);
@@ -233,7 +233,7 @@ bool ShieldToAddress::operator()(const libzcash::SaplingPaymentAddress &zaddr) c
auto donationZout = boost::get<libzcash::SaplingPaymentAddress>(donationZaddr);
m_op->builder_.AddSaplingOutput(ovk, donationZout, donationAmount);
fprintf(stderr,"%s: donation=%ld, sendAmount=%ld, donationAmount=%ld\n", __func__, donation, sendAmount, donationAmount);
LogPrintf("%s: donation=%ld, sendAmount=%ld, donationAmount=%ld\n", __func__, donation, sendAmount, donationAmount);
// zdust as third output, so donation txs are indistinguishable from
// non-donation z_shieldcoinbase txs