@@ -338,6 +338,9 @@ case ${workMode} in
338
338
# Get currentEpoch for Active-dRep-Power-Filtering
339
339
currentEpoch=$( get_currentEpoch)
340
340
341
+ # Get the current protocolParameters for the dRep and pool voting thresholds
342
+ protocolParametersJSON=$( ${cardanocli} ${cliEra} query protocol-parameters)
343
+
341
344
# ### Voting Power Stuff
342
345
# Get DRep Stake Distribution for quorum calculation later on
343
346
# Only calculate the
@@ -382,6 +385,11 @@ case ${workMode} in
382
385
committeePowerThreshold=$( bc <<< " scale=2; 100.00 * ${committeePowerThreshold}" ) # scale it to 0.00-100.00%
383
386
;;
384
387
388
+
389
+ " null" ) # a null threshold symbolizes the state committeeNoConfidence
390
+ committeePowerThreshold=-1
391
+ ;;
392
+
385
393
* ) # if any other type, throw an error
386
394
echo -e " \e[35mERROR - Could not handle committeeThresholdType = ${committeeThresholdType} \e[0m\n" ; exit 1
387
395
;;
@@ -390,8 +398,6 @@ case ${workMode} in
390
398
# Generate the JSON of all committeeHotHashes and there names, depending on the committeeColdHashes
391
399
ccMemberHotHashNamesJSON=$( jq -r " [ .[] | { \" \(.value.hotCredsAuthStatus.contents | keys[0])-\(.value.hotCredsAuthStatus.contents | flatten[0])\" : (${ccMemberColdHashNames} [.key]) } ] | reduce .[] as \$ o ({}; . * \$ o)" <<< ${committeeStateJSON} 2> /dev/null)
392
400
393
- # Get the current protocolParameters for the dRep and pool voting thresholds
394
- protocolParametersJSON=$( ${cardanocli} ${cliEra} query protocol-parameters)
395
401
;;
396
402
397
403
@@ -439,6 +445,10 @@ case ${workMode} in
439
445
committeePowerThreshold=$( bc <<< " scale=2; 100 * ${committeeThreshold}" )
440
446
;;
441
447
448
+ " null" ) # a null threshold symbolizes the state committeeNoConfidence
449
+ committeePowerThreshold=-1
450
+ ;;
451
+
442
452
* ) # if any other type, throw an error
443
453
echo -e " \e[35mERROR - Could not handle committeeThresholdType = ${committeeThresholdType} \e[0m\n" ; exit 1
444
454
;;
645
655
totalAccept=" " ; totalAcceptIcon=" " ;
646
656
dRepAcceptIcon=" " ; poolAcceptIcon=" " ; committeeAcceptIcon=" " ;
647
657
dRepPowerThreshold=" N/A" ; poolPowerThreshold=" N/A" ; # N/A -> not available
658
+ govActionTitle=" " ;
648
659
649
660
echo
650
661
echo -e " \e[36m--- Entry $(( ${tmpCnt} + 1 )) of ${actionStateEntryCnt} --- Action-ID ${actionUTXO} #${actionIdx} \e[0m"
715
726
else
716
727
errorMsg=$( jq -r .errorMsg <<< ${signerJSON} 2> /dev/null)
717
728
echo -e " \e[0m Anchor-Data: ${iconYes} \e[32m JSONLD structure is ok\e[0m" ;
729
+ govActionTitle=$( jq -r " .body.title // \"\" " ${tmpAnchorContent} 2> /dev/null)
718
730
if [[ " ${errorMsg} " != " " ]]; then echo -e " \e[0m Notice: ${iconNo} ${errorMsg} \e[0m" ; fi
719
731
authors=$( jq -r --arg iconYes " ${iconYes} " --arg iconNo " ${iconNo} " ' .authors[] | "\\e[0m Signature: \(if .valid then $iconYes else $iconNo end) \(.name)\\e[0m"' <<< ${signerJSON} 2> /dev/null)
720
732
if [[ " ${authors} " != " " ]]; then echo -e " ${authors} \e[0m" ; fi
766
778
;;
767
779
esac
768
780
781
+ # Show governance action title if available
782
+ if [[ " ${govActionTitle} " != " " ]]; then
783
+ echo -e " \e[0mAction-Title: \e[36m${govActionTitle} \e[0m\n"
784
+ fi
785
+
769
786
# DO A NICE OUTPUT OF THE DIFFERENT CONTENTS & DO THE RIGHT CALCULATIONS FOR THE ACCEPTANCE
770
787
case " ${actionTag} " in
771
788
778
795
779
796
dRepAcceptIcon=" N/A" ; poolAcceptIcon=" N/A" ;
780
797
totalAccept=" N/A" ;
781
- if [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ; else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
798
+
799
+ # If we are in committeeNoConfidence mode(thresholdpower=-1), remove the committeeAcceptIcon
800
+ if [[ ${committeePowerThreshold} == " -1" ]]; then committeeAcceptIcon=" " ;
801
+ elif [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ;
802
+ else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ;
803
+ fi
782
804
;;
783
805
784
806
805
827
fi
806
828
poolPowerThreshold=$( bc <<< " scale=2; 100.00 * ${poolPowerThreshold}" )
807
829
if [[ $( bc <<< " ${poolPct} >= ${poolPowerThreshold}" ) -eq 1 ]]; then poolAcceptIcon=" \e[92m✅" ; else poolAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
808
- if [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ; else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
830
+
831
+ # If we are in committeeNoConfidence mode(thresholdpower=-1), remove the committeeAcceptIcon
832
+ if [[ ${committeePowerThreshold} == " -1" ]]; then committeeAcceptIcon=" " ; totalAccept+=" NO" ;
833
+ elif [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ;
834
+ else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ;
835
+ fi
809
836
;;
810
837
811
838
882
909
if [[ ${protocolVersionMajor} -ge 10 ]]; then # only do dRep check if we are at least in conway chang-2 phase
883
910
if [[ $( bc <<< " ${dRepPct} >= ${dRepPowerThreshold}" ) -eq 1 ]]; then dRepAcceptIcon=" \e[92m✅" ; else dRepAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
884
911
fi
885
- # committee can vote on all parameters
886
- if [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ; else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
887
912
913
+ # If we are in committeeNoConfidence mode(thresholdpower=-1), remove the committeeAcceptIcon
914
+ if [[ ${committeePowerThreshold} == " -1" ]]; then committeeAcceptIcon=" " ; totalAccept+=" NO" ;
915
+ elif [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ;
916
+ else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ;
917
+ fi
888
918
;;
889
919
890
920
908
938
echo -e " \e[0mSet new\e[32m Constitution-Hash \e[0m► \e[94m${anchorHash} \e[0m"
909
939
echo -e " \e[0mSet new\e[32m Guardrails-Script-Hash \e[0m► \e[94m${scriptHash} \e[0m"
910
940
echo -e " \e[0m"
911
-
912
941
# Calculate acceptance: Get the right threshold, make it a nice percentage number, check if threshold is reached
913
942
{ read dRepPowerThreshold; } <<< $( jq -r ' .dRepVotingThresholds.updateToConstitution // 0' <<< " ${protocolParametersJSON}" 2> /dev/null)
914
943
dRepPowerThreshold=$( bc <<< " scale=2; 100.00 * ${dRepPowerThreshold}" )
915
944
if [[ $( bc <<< " ${dRepPct} >= ${dRepPowerThreshold}" ) -eq 1 ]]; then dRepAcceptIcon=" \e[92m✅" ; else dRepAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
916
945
poolAcceptIcon=" " ; # pools not allowed to vote on this
917
- if [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ; else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
946
+ # If we are in committeeNoConfidence mode(thresholdpower=-1), remove the committeeAcceptIcon
947
+ if [[ ${committeePowerThreshold} == " -1" ]]; then committeeAcceptIcon=" " ; totalAccept+=" NO" ;
948
+ elif [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ;
949
+ else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ;
950
+ fi
918
951
;;
919
952
920
953
960
993
echo -e " \e[0m"
961
994
962
995
# Calculate acceptance: Get the right threshold, make it a nice percentage number, check if threshold is reached
963
- { read dRepPowerThreshold; read poolPowerThreshold; } <<< $( jq -r ' .dRepVotingThresholds.committeeNormal // 0, .poolVotingThresholds.committeeNormal // 0' <<< " ${protocolParametersJSON}" 2> /dev/null)
996
+
997
+ # If we are in committeeNoConfidence mode(thresholdpower=-1), use the committeeNoConfidence parameter set
998
+ if [[ ${committeePowerThreshold} != " -1" ]]; then
999
+ { read dRepPowerThreshold; read poolPowerThreshold; } <<< $( jq -r ' .dRepVotingThresholds.committeeNormal // 0, .poolVotingThresholds.committeeNormal // 0' <<< " ${protocolParametersJSON}" 2> /dev/null)
1000
+ else
1001
+ { read dRepPowerThreshold; read poolPowerThreshold; } <<< $( jq -r ' .dRepVotingThresholds.committeeNoConfidence // 0, .poolVotingThresholds.committeeNoConfidence // 0' <<< " ${protocolParametersJSON}" 2> /dev/null)
1002
+ fi
964
1003
dRepPowerThreshold=$( bc <<< " scale=2; 100.00 * ${dRepPowerThreshold}" )
965
1004
if [[ $( bc <<< " ${dRepPct} >= ${dRepPowerThreshold}" ) -eq 1 ]]; then dRepAcceptIcon=" \e[92m✅" ; else dRepAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
966
1005
poolPowerThreshold=$( bc <<< " scale=2; 100.00 * ${poolPowerThreshold}" )
@@ -1031,11 +1070,14 @@ do
1031
1070
dRepPowerThreshold=$( bc <<< " scale=2; 100.00 * ${dRepPowerThreshold}" )
1032
1071
if [[ $( bc <<< " ${dRepPct} >= ${dRepPowerThreshold}" ) -eq 1 ]]; then dRepAcceptIcon=" \e[92m✅" ; else dRepAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
1033
1072
poolAcceptIcon=" " ; # pools not allowed to vote on this
1034
- if [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ; else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
1073
+ # If we are in committeeNoConfidence mode(thresholdpower=-1), remove the committeeAcceptIcon
1074
+ if [[ ${committeePowerThreshold} == " -1" ]]; then committeeAcceptIcon=" " ; totalAccept+=" NO" ;
1075
+ elif [[ $( bc <<< " ${committeePct} >= ${committeePowerThreshold}" ) -eq 1 ]]; then committeeAcceptIcon=" \e[92m✅" ;
1076
+ else committeeAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ;
1077
+ fi
1035
1078
;;
1036
1079
1037
1080
1038
-
1039
1081
esac
1040
1082
1041
1083
# If there is a voterHash, get the voting answer for it
@@ -1089,8 +1131,11 @@ do
1089
1131
* ) totalAcceptIcon=" \e[92m✅" ;;
1090
1132
esac
1091
1133
printf " \e[97m%88s\e[90m │ %b \e[0m\n" " Full approval of the proposal" " ${totalAcceptIcon} "
1092
- echo
1093
1134
1135
+ # show an alert if we are in the no confidence mode
1136
+ if [[ ${committeePowerThreshold} == " -1" ]]; then echo -e " \e[35mWe are currently in the 'No Confidence' state !\e[0m\n" ; fi
1137
+
1138
+ echo
1094
1139
1095
1140
1096
1141
done
0 commit comments