@@ -338,6 +338,9 @@ case ${workMode} in
338338 # Get currentEpoch for Active-dRep-Power-Filtering
339339 currentEpoch=$( get_currentEpoch)
340340
341+ # Get the current protocolParameters for the dRep and pool voting thresholds
342+ protocolParametersJSON=$( ${cardanocli} ${cliEra} query protocol-parameters)
343+
341344 # ### Voting Power Stuff
342345 # Get DRep Stake Distribution for quorum calculation later on
343346 # Only calculate the
@@ -382,6 +385,11 @@ case ${workMode} in
382385 committeePowerThreshold=$( bc <<< " scale=2; 100.00 * ${committeePowerThreshold}" ) # scale it to 0.00-100.00%
383386 ;;
384387
388+
389+ " null" ) # a null threshold symbolizes the state committeeNoConfidence
390+ committeePowerThreshold=-1
391+ ;;
392+
385393 * ) # if any other type, throw an error
386394 echo -e " \e[35mERROR - Could not handle committeeThresholdType = ${committeeThresholdType} \e[0m\n" ; exit 1
387395 ;;
@@ -390,8 +398,6 @@ case ${workMode} in
390398 # Generate the JSON of all committeeHotHashes and there names, depending on the committeeColdHashes
391399 ccMemberHotHashNamesJSON=$( jq -r " [ .[] | { \" \(.value.hotCredsAuthStatus.contents | keys[0])-\(.value.hotCredsAuthStatus.contents | flatten[0])\" : (${ccMemberColdHashNames} [.key]) } ] | reduce .[] as \$ o ({}; . * \$ o)" <<< ${committeeStateJSON} 2> /dev/null)
392400
393- # Get the current protocolParameters for the dRep and pool voting thresholds
394- protocolParametersJSON=$( ${cardanocli} ${cliEra} query protocol-parameters)
395401 ;;
396402
397403
@@ -439,6 +445,10 @@ case ${workMode} in
439445 committeePowerThreshold=$( bc <<< " scale=2; 100 * ${committeeThreshold}" )
440446 ;;
441447
448+ " null" ) # a null threshold symbolizes the state committeeNoConfidence
449+ committeePowerThreshold=-1
450+ ;;
451+
442452 * ) # if any other type, throw an error
443453 echo -e " \e[35mERROR - Could not handle committeeThresholdType = ${committeeThresholdType} \e[0m\n" ; exit 1
444454 ;;
645655 totalAccept=" " ; totalAcceptIcon=" " ;
646656 dRepAcceptIcon=" " ; poolAcceptIcon=" " ; committeeAcceptIcon=" " ;
647657 dRepPowerThreshold=" N/A" ; poolPowerThreshold=" N/A" ; # N/A -> not available
658+ govActionTitle=" " ;
648659
649660 echo
650661 echo -e " \e[36m--- Entry $(( ${tmpCnt} + 1 )) of ${actionStateEntryCnt} --- Action-ID ${actionUTXO} #${actionIdx} \e[0m"
715726 else
716727 errorMsg=$( jq -r .errorMsg <<< ${signerJSON} 2> /dev/null)
717728 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)
718730 if [[ " ${errorMsg} " != " " ]]; then echo -e " \e[0m Notice: ${iconNo} ${errorMsg} \e[0m" ; fi
719731 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)
720732 if [[ " ${authors} " != " " ]]; then echo -e " ${authors} \e[0m" ; fi
766778 ;;
767779 esac
768780
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+
769786 # DO A NICE OUTPUT OF THE DIFFERENT CONTENTS & DO THE RIGHT CALCULATIONS FOR THE ACCEPTANCE
770787 case " ${actionTag} " in
771788
778795
779796 dRepAcceptIcon=" N/A" ; poolAcceptIcon=" N/A" ;
780797 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
782804 ;;
783805
784806
805827 fi
806828 poolPowerThreshold=$( bc <<< " scale=2; 100.00 * ${poolPowerThreshold}" )
807829 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
809836 ;;
810837
811838
882909 if [[ ${protocolVersionMajor} -ge 10 ]]; then # only do dRep check if we are at least in conway chang-2 phase
883910 if [[ $( bc <<< " ${dRepPct} >= ${dRepPowerThreshold}" ) -eq 1 ]]; then dRepAcceptIcon=" \e[92m✅" ; else dRepAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
884911 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
887912
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
888918 ;;
889919
890920
908938 echo -e " \e[0mSet new\e[32m Constitution-Hash \e[0m► \e[94m${anchorHash} \e[0m"
909939 echo -e " \e[0mSet new\e[32m Guardrails-Script-Hash \e[0m► \e[94m${scriptHash} \e[0m"
910940 echo -e " \e[0m"
911-
912941 # Calculate acceptance: Get the right threshold, make it a nice percentage number, check if threshold is reached
913942 { read dRepPowerThreshold; } <<< $( jq -r ' .dRepVotingThresholds.updateToConstitution // 0' <<< " ${protocolParametersJSON}" 2> /dev/null)
914943 dRepPowerThreshold=$( bc <<< " scale=2; 100.00 * ${dRepPowerThreshold}" )
915944 if [[ $( bc <<< " ${dRepPct} >= ${dRepPowerThreshold}" ) -eq 1 ]]; then dRepAcceptIcon=" \e[92m✅" ; else dRepAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
916945 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
918951 ;;
919952
920953
960993 echo -e " \e[0m"
961994
962995 # 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
9641003 dRepPowerThreshold=$( bc <<< " scale=2; 100.00 * ${dRepPowerThreshold}" )
9651004 if [[ $( bc <<< " ${dRepPct} >= ${dRepPowerThreshold}" ) -eq 1 ]]; then dRepAcceptIcon=" \e[92m✅" ; else dRepAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
9661005 poolPowerThreshold=$( bc <<< " scale=2; 100.00 * ${poolPowerThreshold}" )
@@ -1031,11 +1070,14 @@ do
10311070 dRepPowerThreshold=$( bc <<< " scale=2; 100.00 * ${dRepPowerThreshold}" )
10321071 if [[ $( bc <<< " ${dRepPct} >= ${dRepPowerThreshold}" ) -eq 1 ]]; then dRepAcceptIcon=" \e[92m✅" ; else dRepAcceptIcon=" \e[91m❌" ; totalAccept+=" NO" ; fi
10331072 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
10351078 ;;
10361079
10371080
1038-
10391081 esac
10401082
10411083 # If there is a voterHash, get the voting answer for it
@@ -1089,8 +1131,11 @@ do
10891131 * ) totalAcceptIcon=" \e[92m✅" ;;
10901132 esac
10911133 printf " \e[97m%88s\e[90m │ %b \e[0m\n" " Full approval of the proposal" " ${totalAcceptIcon} "
1092- echo
10931134
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
10941139
10951140
10961141done
0 commit comments