@@ -315,8 +315,25 @@ BOOST_AUTO_TEST_CASE(rpc_wallet)
315
315
}
316
316
};
317
317
318
+ auto check_lockbox_streams = [](UniValue obj, std::vector<std::string> recipients, std::vector<double > amounts) {
319
+ size_t n = recipients.size ();
320
+ BOOST_REQUIRE_EQUAL (amounts.size (), n);
321
+ UniValue lockboxstreams = find_value (obj, " lockboxstreams" );
322
+ BOOST_CHECK_EQUAL (lockboxstreams.size (), n);
323
+ if (lockboxstreams.size () != n) return ;
324
+
325
+ for (int i = 0 ; i < n; i++) {
326
+ UniValue fsobj = lockboxstreams[i];
327
+ BOOST_CHECK_EQUAL (find_value (fsobj, " recipient" ).get_str (), recipients[i]);
328
+ BOOST_CHECK_EQUAL (find_value (fsobj, " specification" ).get_str (), " https://zips.z.cash/zip-0214" );
329
+ BOOST_CHECK_EQUAL (find_value (fsobj, " value" ).get_real (), amounts[i]);
330
+ }
331
+ };
332
+
318
333
bool canopyEnabled =
319
334
Params ().GetConsensus ().vUpgrades [Consensus::UPGRADE_CANOPY].nActivationHeight != Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
335
+ bool nu6Enabled =
336
+ Params ().GetConsensus ().vUpgrades [Consensus::UPGRADE_NU6].nActivationHeight != Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
320
337
321
338
// slow start + blossom activation + (pre blossom halving - blossom activation) * 2
322
339
BOOST_CHECK_NO_THROW (retValue = CallRPC (" getblocksubsidy 1046400" ));
@@ -332,6 +349,7 @@ BOOST_AUTO_TEST_CASE(rpc_wallet)
332
349
" t3XyYW8yBFRuMnfvm5KLGFbEVz25kckZXym"
333
350
});
334
351
}
352
+ BOOST_CHECK (find_value (obj, " lockboxstreams" ).empty ());
335
353
336
354
BOOST_CHECK_NO_THROW (retValue = CallRPC (" getblocksubsidy 2726399" ));
337
355
obj = retValue.get_obj ();
@@ -346,9 +364,27 @@ BOOST_AUTO_TEST_CASE(rpc_wallet)
346
364
" t3XyYW8yBFRuMnfvm5KLGFbEVz25kckZXym"
347
365
});
348
366
}
367
+ BOOST_CHECK (find_value (obj, " lockboxstreams" ).empty ());
349
368
350
369
BOOST_CHECK_NO_THROW (retValue = CallRPC (" getblocksubsidy 2726400" ));
351
370
obj = retValue.get_obj ();
371
+ BOOST_CHECK_EQUAL (find_value (obj, " miner" ).get_real (), nu6Enabled ? 1.25 : 1.5625 );
372
+ BOOST_CHECK_EQUAL (find_value (obj, " founders" ).get_real (), 0.0 );
373
+ if (nu6Enabled) {
374
+ check_funding_streams (obj, { " Zcash Community Grants NU6" },
375
+ { 0.125 , },
376
+ {
377
+ " t3cFfPt1Bcvgez9ZbMBFWeZsskxTkPzGCow"
378
+ });
379
+ check_lockbox_streams (obj, { " Lockbox NU6" },
380
+ { 0.1875 , });
381
+ } else {
382
+ BOOST_CHECK (find_value (obj, " fundingstreams" ).empty ());
383
+ BOOST_CHECK (find_value (obj, " lockboxstreams" ).empty ());
384
+ }
385
+
386
+ BOOST_CHECK_NO_THROW (retValue = CallRPC (" getblocksubsidy 3146400" ));
387
+ obj = retValue.get_obj ();
352
388
BOOST_CHECK_EQUAL (find_value (obj, " miner" ).get_real (), 1.5625 );
353
389
BOOST_CHECK_EQUAL (find_value (obj, " founders" ).get_real (), 0.0 );
354
390
BOOST_CHECK (find_value (obj, " fundingstreams" ).empty ());
0 commit comments