Skip to content

Commit

Permalink
improve wallet list for pool delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
Scitz0 committed Jul 27, 2024
1 parent 42d357d commit bb57dab
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions scripts/cnode-helper-scripts/cntools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -873,19 +873,17 @@ function main {
else
getWalletRewards ${wallet_name}
fi
if [[ ${reward_lovelace} -gt 0 ]]; then
if [[ -n ${pool_delegation} ]]; then
getPriceString ${reward_lovelace}
println "$(printf "%-15s : ${FG_LBLUE}%s${NC} ADA${price_str}" "Rewards" "$(formatLovelace ${reward_lovelace})")"
if [[ -n ${pool_delegation} ]]; then
unset poolName
while IFS= read -r -d '' pool; do
getPoolID "$(basename ${pool})"
if [[ "${pool_id_bech32}" = "${pool_delegation}" ]]; then
poolName=$(basename ${pool}) && break
fi
done < <(find "${POOL_FOLDER}" -mindepth 1 -maxdepth 1 -type d -print0 | sort -z)
println "${FG_RED}Delegated${NC} to ${FG_GREEN}${poolName}${NC} ${FG_LGRAY}(${pool_delegation})${NC}"
fi
unset poolName
while IFS= read -r -d '' pool; do
getPoolID "$(basename ${pool})"
if [[ "${pool_id_bech32}" = "${pool_delegation}" ]]; then
poolName=$(basename ${pool}) && break
fi
done < <(find "${POOL_FOLDER}" -mindepth 1 -maxdepth 1 -type d -print0 | sort -z)
println "${FG_RED}Delegated${NC} to ${FG_GREEN}${poolName}${NC} ${FG_LGRAY}(${pool_delegation})${NC}"
fi
fi
done < <(find "${WALLET_FOLDER}" -mindepth 1 -maxdepth 1 -type d -print0 | sort -z)
Expand Down

0 comments on commit bb57dab

Please sign in to comment.