WIP donation test

This commit is contained in:
Duke
2025-10-14 11:52:05 -04:00
parent 606b28d6ca
commit ebde772ada
4 changed files with 23 additions and 14 deletions

View File

@@ -5563,10 +5563,12 @@ UniValue z_shieldcoinbase(const UniValue& params, bool fHelp, const CPubKey& myp
if (params.size() > 4) {
donation = params[4].get_int();
if (donation < 0 || donation > 10 ) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid donation percentage, must be an integer between 1 and 10");
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid donation percentage, must be an integer between 0 and 10");
}
}
LogPrintf("%s: donation=%d\n", __func__, donation);
int nextBlockHeight = chainActive.Height() + 1;
bool overwinterActive = nextBlockHeight>=1 ? true : false; // NetworkUpgradeActive(nextBlockHeight, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER);
unsigned int max_tx_size = MAX_TX_SIZE_AFTER_SAPLING;
@@ -5694,6 +5696,7 @@ UniValue z_shieldcoinbase(const UniValue& params, bool fHelp, const CPubKey& myp
o.push_back(Pair("remainingValue", ValueFromAmount(remainingValue)));
o.push_back(Pair("shieldingUTXOs", static_cast<uint64_t>(numUtxos)));
o.push_back(Pair("shieldingValue", ValueFromAmount(shieldedValue)));
o.push_back(Pair("donation", donation));
o.push_back(Pair("opid", operationId));
return o;
}