@@ -335,7 +335,7 @@ public Map getConfigMap() {
335
335
map .put ("minFeeRefScriptCostPerByte" , minFeeRefScriptCostPerByte );
336
336
map .put ("constitutionUrl" , constitutionUrl );
337
337
map .put ("constitutionDataHash" , constitutionDataHash );
338
- if (constitutionScript != null )
338
+ if (constitutionScript != null && ! constitutionScript . trim (). isEmpty () )
339
339
map .put ("constitutionScript" , constitutionScript );
340
340
341
341
if (ccMembers != null && ccMembers .size () > 0 )
@@ -448,6 +448,116 @@ public GenesisConfig copy() {
448
448
return genesisConfig ;
449
449
}
450
450
451
+ public void merge (Map <String , String > updatedValues ) {
452
+ if (updatedValues != null && !updatedValues .isEmpty ()) {
453
+ if (updatedValues .get ("protocolMagic" ) != null && !updatedValues .get ("protocolMagic" ).isEmpty ())
454
+ protocolMagic = Long .parseLong (updatedValues .get ("protocolMagic" ));
455
+ if (updatedValues .get ("maxKESEvolutions" ) != null && !updatedValues .get ("maxKESEvolutions" ).isEmpty ())
456
+ maxKESEvolutions = Integer .parseInt (updatedValues .get ("maxKESEvolutions" ));
457
+ if (updatedValues .get ("stabilityWindowFactor" ) != null && !updatedValues .get ("stabilityWindowFactor" ).isEmpty ())
458
+ stabilityWindowFactor = Integer .parseInt (updatedValues .get ("stabilityWindowFactor" ));
459
+ if (updatedValues .get ("securityParam" ) != null && !updatedValues .get ("securityParam" ).isEmpty ())
460
+ securityParam = Integer .parseInt (updatedValues .get ("securityParam" ));
461
+ if (updatedValues .get ("slotsPerKESPeriod" ) != null && !updatedValues .get ("slotsPerKESPeriod" ).isEmpty ())
462
+ slotsPerKESPeriod = Integer .parseInt (updatedValues .get ("slotsPerKESPeriod" ));
463
+ if (updatedValues .get ("updateQuorum" ) != null && !updatedValues .get ("updateQuorum" ).isEmpty ())
464
+ updateQuorum = Integer .parseInt (updatedValues .get ("updateQuorum" ));
465
+ if (updatedValues .get ("peerSharing" ) != null && !updatedValues .get ("peerSharing" ).isEmpty ())
466
+ peerSharing = Boolean .parseBoolean (updatedValues .get ("peerSharing" ));
467
+ if (updatedValues .get ("genesisUtxoSupply" ) != null && !updatedValues .get ("genesisUtxoSupply" ).isEmpty ())
468
+ genesisUtxoSupply = updatedValues .get ("genesisUtxoSupply" );
469
+ if (updatedValues .get ("nGenesisKeys" ) != null && !updatedValues .get ("nGenesisKeys" ).isEmpty ())
470
+ nGenesisKeys = Integer .parseInt (updatedValues .get ("nGenesisKeys" ));
471
+ if (updatedValues .get ("nGenesisUtxoKeys" ) != null && !updatedValues .get ("nGenesisUtxoKeys" ).isEmpty ())
472
+ nGenesisUtxoKeys = Integer .parseInt (updatedValues .get ("nGenesisUtxoKeys" ));
473
+ if (updatedValues .get ("maxLovelaceSupply" ) != null && !updatedValues .get ("maxLovelaceSupply" ).isEmpty ())
474
+ maxLovelaceSupply = updatedValues .get ("maxLovelaceSupply" );
475
+ if (updatedValues .get ("poolPledgeInfluence" ) != null && !updatedValues .get ("poolPledgeInfluence" ).isEmpty ())
476
+ poolPledgeInfluence = Float .parseFloat (updatedValues .get ("poolPledgeInfluence" ));
477
+ if (updatedValues .get ("decentralisationParam" ) != null && !updatedValues .get ("decentralisationParam" ).isEmpty ())
478
+ decentralisationParam = new BigDecimal (updatedValues .get ("decentralisationParam" ));
479
+ if (updatedValues .get ("eMax" ) != null && !updatedValues .get ("eMax" ).isEmpty ())
480
+ eMax = Integer .parseInt (updatedValues .get ("eMax" ));
481
+ if (updatedValues .get ("keyDeposit" ) != null && !updatedValues .get ("keyDeposit" ).isEmpty ())
482
+ keyDeposit = new BigInteger (updatedValues .get ("keyDeposit" ));
483
+ if (updatedValues .get ("maxBlockBodySize" ) != null && !updatedValues .get ("maxBlockBodySize" ).isEmpty ())
484
+ maxBlockBodySize = Long .parseLong (updatedValues .get ("maxBlockBodySize" ));
485
+ if (updatedValues .get ("maxBlockHeaderSize" ) != null && !updatedValues .get ("maxBlockHeaderSize" ).isEmpty ())
486
+ maxBlockHeaderSize = Long .parseLong (updatedValues .get ("maxBlockHeaderSize" ));
487
+ if (updatedValues .get ("maxTxSize" ) != null && !updatedValues .get ("maxTxSize" ).isEmpty ())
488
+ maxTxSize = Long .parseLong (updatedValues .get ("maxTxSize" ));
489
+ if (updatedValues .get ("minFeeA" ) != null && !updatedValues .get ("minFeeA" ).isEmpty ())
490
+ minFeeA = Long .parseLong (updatedValues .get ("minFeeA" ));
491
+ if (updatedValues .get ("minFeeB" ) != null && !updatedValues .get ("minFeeB" ).isEmpty ())
492
+ minFeeB = Long .parseLong (updatedValues .get ("minFeeB" ));
493
+ if (updatedValues .get ("minPoolCost" ) != null && !updatedValues .get ("minPoolCost" ).isEmpty ())
494
+ minPoolCost = new BigInteger (updatedValues .get ("minPoolCost" ));
495
+ if (updatedValues .get ("minUTxOValue" ) != null && !updatedValues .get ("minUTxOValue" ).isEmpty ())
496
+ minUTxOValue = new BigInteger (updatedValues .get ("minUTxOValue" ));
497
+ if (updatedValues .get ("nOpt" ) != null && !updatedValues .get ("nOpt" ).isEmpty ())
498
+ nOpt = Integer .parseInt (updatedValues .get ("nOpt" ));
499
+ if (updatedValues .get ("poolDeposit" ) != null && !updatedValues .get ("poolDeposit" ).isEmpty ())
500
+ poolDeposit = new BigInteger (updatedValues .get ("poolDeposit" ));
501
+ if (updatedValues .get ("protocolMajorVer" ) != null && !updatedValues .get ("protocolMajorVer" ).isEmpty ())
502
+ protocolMajorVer = Integer .parseInt (updatedValues .get ("protocolMajorVer" ));
503
+ if (updatedValues .get ("protocolMinorVer" ) != null && !updatedValues .get ("protocolMinorVer" ).isEmpty ())
504
+ protocolMinorVer = Integer .parseInt (updatedValues .get ("protocolMinorVer" ));
505
+ if (updatedValues .get ("monetaryExpansionRate" ) != null && !updatedValues .get ("monetaryExpansionRate" ).isEmpty ())
506
+ monetaryExpansionRate = Float .parseFloat (updatedValues .get ("monetaryExpansionRate" ));
507
+ if (updatedValues .get ("treasuryGrowthRate" ) != null && !updatedValues .get ("treasuryGrowthRate" ).isEmpty ())
508
+ treasuryGrowthRate = Float .parseFloat (updatedValues .get ("treasuryGrowthRate" ));
509
+ if (updatedValues .get ("collateralPercentage" ) != null && !updatedValues .get ("collateralPercentage" ).isEmpty ())
510
+ collateralPercentage = Integer .parseInt (updatedValues .get ("collateralPercentage" ));
511
+ if (updatedValues .get ("prMemNumerator" ) != null && !updatedValues .get ("prMemNumerator" ).isEmpty ())
512
+ prMemNumerator = updatedValues .get ("prMemNumerator" );
513
+ if (updatedValues .get ("prMemDenominator" ) != null && !updatedValues .get ("prMemDenominator" ).isEmpty ())
514
+ prMemDenominator = updatedValues .get ("prMemDenominator" );
515
+ if (updatedValues .get ("prStepsNumerator" ) != null && !updatedValues .get ("prStepsNumerator" ).isEmpty ())
516
+ prStepsNumerator = updatedValues .get ("prStepsNumerator" );
517
+ if (updatedValues .get ("prStepsDenominator" ) != null && !updatedValues .get ("prStepsDenominator" ).isEmpty ())
518
+ prStepsDenominator = updatedValues .get ("prStepsDenominator" );
519
+ if (updatedValues .get ("lovelacePerUTxOWord" ) != null && !updatedValues .get ("lovelacePerUTxOWord" ).isEmpty ())
520
+ lovelacePerUTxOWord = Long .parseLong (updatedValues .get ("lovelacePerUTxOWord" ));
521
+ if (updatedValues .get ("maxBlockExUnitsMem" ) != null && !updatedValues .get ("maxBlockExUnitsMem" ).isEmpty ())
522
+ maxBlockExUnitsMem = Long .parseLong (updatedValues .get ("maxBlockExUnitsMem" ));
523
+ if (updatedValues .get ("maxBlockExUnitsSteps" ) != null && !updatedValues .get ("maxBlockExUnitsSteps" ).isEmpty ())
524
+ maxBlockExUnitsSteps = Long .parseLong (updatedValues .get ("maxBlockExUnitsSteps" ));
525
+ if (updatedValues .get ("maxCollateralInputs" ) != null && !updatedValues .get ("maxCollateralInputs" ).isEmpty ())
526
+ maxCollateralInputs = Integer .parseInt (updatedValues .get ("maxCollateralInputs" ));
527
+ if (updatedValues .get ("maxTxExUnitsMem" ) != null && !updatedValues .get ("maxTxExUnitsMem" ).isEmpty ())
528
+ maxTxExUnitsMem = Long .parseLong (updatedValues .get ("maxTxExUnitsMem" ));
529
+ if (updatedValues .get ("maxTxExUnitsSteps" ) != null && !updatedValues .get ("maxTxExUnitsSteps" ).isEmpty ())
530
+ maxTxExUnitsSteps = Long .parseLong (updatedValues .get ("maxTxExUnitsSteps" ));
531
+ if (updatedValues .get ("maxValueSize" ) != null && !updatedValues .get ("maxValueSize" ).isEmpty ())
532
+ maxValueSize = Integer .parseInt (updatedValues .get ("maxValueSize" ));
533
+ if (updatedValues .get ("committeeMinSize" ) != null && !updatedValues .get ("committeeMinSize" ).isEmpty ())
534
+ committeeMinSize = Integer .parseInt (updatedValues .get ("committeeMinSize" ));
535
+ if (updatedValues .get ("committeeMaxTermLength" ) != null && !updatedValues .get ("committeeMaxTermLength" ).isEmpty ())
536
+ committeeMaxTermLength = Integer .parseInt (updatedValues .get ("committeeMaxTermLength" ));
537
+ if (updatedValues .get ("govActionLifetime" ) != null && !updatedValues .get ("govActionLifetime" ).isEmpty ())
538
+ govActionLifetime = Integer .parseInt (updatedValues .get ("govActionLifetime" ));
539
+ if (updatedValues .get ("govActionDeposit" ) != null && !updatedValues .get ("govActionDeposit" ).isEmpty ())
540
+ govActionDeposit = new BigInteger (updatedValues .get ("govActionDeposit" ));
541
+ if (updatedValues .get ("dRepDeposit" ) != null && !updatedValues .get ("dRepDeposit" ).isEmpty ())
542
+ dRepDeposit = new BigInteger (updatedValues .get ("dRepDeposit" ));
543
+ if (updatedValues .get ("dRepActivity" ) != null && !updatedValues .get ("dRepActivity" ).isEmpty ())
544
+ dRepActivity = Integer .parseInt (updatedValues .get ("dRepActivity" ));
545
+ if (updatedValues .get ("minFeeRefScriptCostPerByte" ) != null && !updatedValues .get ("minFeeRefScriptCostPerByte" ).isEmpty ())
546
+ minFeeRefScriptCostPerByte = new BigDecimal (updatedValues .get ("minFeeRefScriptCostPerByte" ));
547
+ if (updatedValues .get ("constitutionUrl" ) != null && !updatedValues .get ("constitutionUrl" ).isEmpty ())
548
+ constitutionUrl = updatedValues .get ("constitutionUrl" );
549
+ if (updatedValues .get ("constitutionDataHash" ) != null && !updatedValues .get ("constitutionDataHash" ).isEmpty ())
550
+ constitutionDataHash = updatedValues .get ("constitutionDataHash" );
551
+ if (updatedValues .get ("constitutionScript" ) != null && !updatedValues .get ("constitutionScript" ).trim ().isEmpty ())
552
+ constitutionScript = updatedValues .get ("constitutionScript" );
553
+
554
+ if (updatedValues .get ("shiftStartTimeBehind" ) != null && !updatedValues .get ("shiftStartTimeBehind" ).isEmpty ())
555
+ shiftStartTimeBehind = Boolean .parseBoolean (updatedValues .get ("shiftStartTimeBehind" ));
556
+ if (updatedValues .get ("conwayHardForkAtEpoch" ) != null && !updatedValues .get ("conwayHardForkAtEpoch" ).isEmpty ())
557
+ conwayHardForkAtEpoch = Integer .parseInt (updatedValues .get ("conwayHardForkAtEpoch" ));
558
+ }
559
+ }
560
+
451
561
private <K , V > List <MapItem <K , V >> createListWithLastFlag (Map <K , V > faucets ) {
452
562
List <MapItem <K , V >> faucetList = new ArrayList <>();
453
563
int i = 0 ;
0 commit comments