Skip to content

Commit

Permalink
Address shlint (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlrt committed Sep 9, 2024
1 parent 4026b3b commit f2b73a4
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 62 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ jobs:
- uses: actions/checkout@v4
- name: SH Lint Check
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -e SC2089 -e SC2090 -e SC2034
with:
scandir: "./scripts"
severity: "error"
severity: "warning"
additional_files: "./scripts/cnode-helper-scripts/env, ./scripts/cnode-helper-scripts/cntools.library, ./scripts/cnode-helper-scripts/mithril.library"
jsonlint:
name: JSON and YAML Check
Expand Down
48 changes: 23 additions & 25 deletions scripts/cnode-helper-scripts/blockPerf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ fi

unset logfile
if [[ "${CONFIG##*.}" = "json" ]] && [[ -f ${CONFIG} ]]; then
errors=0
logfile=$(jq -r '.setupScribes[] | select (.scFormat == "ScJson") | .scName' "${CONFIG}")
[[ -z "${logfile}" ]] && echo -e "${RED}Error:${NC} Failed to locate json logfile in node configuration file\na setupScribe of format ScJson with extension .json expected" && errors=1
[[ -z "${logfile}" ]] && echo -e "${RED}Error:${NC} Failed to locate json logfile in node configuration file\na setupScribe of format ScJson with extension .json expected" && exit 1
[[ -z ${EKG_HOST} ]] && EKG_HOST=127.0.0.1
[[ -z ${EKG_PORT} ]] && EKG_PORT=$(jq .hasEKG $CONFIG)
[[ -z "${EKG_PORT}" ]] && echo -e "ERROR: Failed to locate the EKG Port in node configuration file" && errors=1
[[ -z "${EKG_PORT}" ]] && echo -e "ERROR: Failed to locate the EKG Port in node configuration file" && exit 1
[[ -z "${AddrBlacklist}" ]] &&
NWMAGIC=$(jq -r .networkMagic < ${GENESIS_JSON})
checkFixConfig '["TraceChainSyncClient"]' true "alert";
checkFixConfig '["TraceBlockFetchClient"]' true "alert";
Expand Down Expand Up @@ -190,22 +190,22 @@ pidfile=${CNODE_HOME}/blockPerf-running.pid
if [[ -f ${pidfile} && "${PARSE_MANUAL}" != "Y" ]]; then
echo "WARN: This script is already running on this node for ${NETWORK_NAME} network (probably as a service)" && exit 1
else
trap "rm -f -- '$pidfile'" EXIT
trap "rm -f -- "'$pidfile'"" EXIT
echo $! > $pidfile
fi

missingTbh=true; missingCbf=true;

getDeltaMS() {
echo $(echo "$2 $4" | awk -F '[:, ]' '{print ($1*3600000+$2*60000+$3*1000+$4)-($5*3600000+$6*60000+$7*1000+$8) }' || 0)
echo "$(echo "$2 $4" | awk -F '[:, ]' '{print ($1*3600000+$2*60000+$3*1000+$4)-($5*3600000+$6*60000+$7*1000+$8) }' || 0)"
}

getSlotDate() {
echo $(date -d @$(( $1 + $NETWORK_UTIME_OFFSET )) +'%F %T')
echo "$(date -d @$(( $1 + $NETWORK_UTIME_OFFSET )) +'%F %T')"
}

reportBlock() {
if [[ ! -z "${blockLog}" ]]; then
if [[ -n "${blockLog}" ]]; then
blockLogLineCycles=0
while IFS= read -r blockLogLine;do
# parse block and propagation metrics from different log kinds
Expand Down Expand Up @@ -251,11 +251,11 @@ reportBlock() {
read -ra line_data_arr <<< ${sbx}
blockTimeSfrX=$(date -d ${line_data_arr[0]} +"%F %T,%3N" || 0)
blockTimeG=${line_data_arr[1]}
[ ! -z "$blockTimeAb" ] && break
[[ -n "$blockTimeAb" ]] && break
fi
;;
TraceAddBlockEvent.AddedToCurrentChain|TraceAddBlockEvent.SwitchedToAFork)
[ -z "$blockTimeAb" ] && blockTimeAb=$(date -d $(jq -r .at <<< $blockLogLine) +"%F %T,%3N" || 0)
[ -z "$blockTimeAb" ] && blockTimeAb=$(date -d "$(jq -r .at <<< $blockLogLine)" +"%F %T,%3N" || 0)
[ ! $missingCbf ] && break
;;
esac;
Expand All @@ -271,22 +271,22 @@ reportBlock() {
echo "WARN: blockheight:${iblockHeight} (block hash not found in logs)"
fi
[[ -z ${slotHeightPrev} ]] && slotHeightPrev=${blockSlot} # first monitored block only
if [[ ! -z ${blockTimeTbh} ]]; then
if [[ -n ${blockTimeTbh} ]]; then
# calculate delta-milliseconds from original slottime
deltaSlotTbh=$(getDeltaMS ${blockTimeTbh} ${blockSlotTime},000)
deltaTbhSfr=$(( $(getDeltaMS ${blockTimeSfrX} ${blockSlotTime},000) - deltaSlotTbh))
[ ! -z "$blockTimeCbf" ] && deltaSfrCbf=$(( $(getDeltaMS ${blockTimeCbf} ${blockSlotTime},000) - deltaTbhSfr - deltaSlotTbh)) || deltaSfrCbf="NULL"
[ ! -z "$blockTimeAb" ] && deltaCbfAb=$(( $(getDeltaMS ${blockTimeAb} ${blockSlotTime},000) - deltaSfrCbf - deltaTbhSfr - deltaSlotTbh)) || deltaCbfAb="NULL"
[[ -n "$blockTimeCbf" ]] && deltaSfrCbf=$(( $(getDeltaMS ${blockTimeCbf} ${blockSlotTime},000) - deltaTbhSfr - deltaSlotTbh)) || deltaSfrCbf="NULL"
[[ -n "$blockTimeAb" ]] && deltaCbfAb=$(( $(getDeltaMS ${blockTimeAb} ${blockSlotTime},000) - deltaSfrCbf - deltaTbhSfr - deltaSlotTbh)) || deltaCbfAb="NULL"
[[ "$deltaCbfAb" -lt 0 ]] && deltaCbfAb=0 # rare cases of ab logged before cbf (can be removed after fixed in node )
# may blacklist some internal IPs, to not expose them to common views (api.clio.one)
if [[ "$AddrBlacklist" == *"$blockTimeTbhAddr"* ]]; then
if [[ -z "${AddrBlacklist}" ]] || [[ "$AddrBlacklist" == *"$blockTimeTbhAddr"* ]]; then
blockTimeTbhAddrPublic="0.0.0.0"
blockTimeTbhPortPublic="0"
else
blockTimeTbhAddrPublic=$blockTimeTbhAddr
blockTimeTbhPortPublic=$blockTimeTbhPort
fi
if [[ "$AddrBlacklist" == *"$blockTimeCbfAddr"* ]]; then
if [[ -z "${AddrBlacklist}" ]] || [[ "$AddrBlacklist" == *"$blockTimeCbfAddr"* ]]; then
blockTimeCbfAddrPublic="0.0.0.0"
blockTimeCbfPortPublic="0"
else
Expand All @@ -302,7 +302,7 @@ reportBlock() {
#echo -e "blockheight:${iblockHeight} (negative delta) \n bhash:${blockHash}\n tbh:${blockTimeTbh} ${deltaSlotTbh}\n sfr:${blockTimeSfrX} ${deltaTbhSfr}\n cbf:${blockTimeCbf} ${deltaSfrCbf}\n ab:${blockTimeAb} ${deltaCbfAb} \n blockTimeCbfAddr: $blockTimeCbfAddr \n blockTimeCbfPort: $blockTimeCbfPort \n sbx: $sbx \n line_tsv: $line_tsv \n \n blockLogLine: \n${blockLogLine} \n\n ${blockLog}" > zzz_debug_WARN_block_${iblockHeight}.json
else
if [[ "${deltaSlotTbh}" -lt 60000 ]] && [[ "$((blockSlot-slotHeightPrev))" -lt 200 ]]; then
[[ ${SELFISH_MODE} != "Y" ]] && result=$(curl -4 -s "https://api.clio.one/blocklog/v1/?magic=${NWMAGIC}&bpv=${BP_VERSION}&nport=${CNODE_PORT}&bn=${iblockHeight}&slot=${blockSlot}&tbh=${deltaSlotTbh}&tbhAddr=${blockTimeTbhAddrPublic}&tbhPort=${blockTimeTbhPortPublic}&sfr=${deltaTbhSfr}&cbf=${deltaSfrCbf}&ab=${deltaCbfAb}&g=${blockTimeG}&size=${blockSize}&addr=${blockTimeCbfAddrPublic}&port=${blockTimeCbfPortPublic}&bh=${blockHash}&bpenv=${envBP}" &)
[[ ${SELFISH_MODE} != "Y" ]] && curl -4 -s "https://api.clio.one/blocklog/v1/?magic=${NWMAGIC}&bpv=${BP_VERSION}&nport=${CNODE_PORT}&bn=${iblockHeight}&slot=${blockSlot}&tbh=${deltaSlotTbh}&tbhAddr=${blockTimeTbhAddrPublic}&tbhPort=${blockTimeTbhPortPublic}&sfr=${deltaTbhSfr}&cbf=${deltaSfrCbf}&ab=${deltaCbfAb}&g=${blockTimeG}&size=${blockSize}&addr=${blockTimeCbfAddrPublic}&port=${blockTimeCbfPortPublic}&bh=${blockHash}&bpenv=${envBP}"
[[ ${SERVICE_MODE} != "Y" ]] && echo -e "${FG_YELLOW}Block:.... ${iblockHeight} ( ${blockHash:0:10} ...)\n${NC} Slot..... ${blockSlot} ($((blockSlot-slotHeightPrev))s)\n ......... ${blockSlotTime}\n Header... ${blockTimeTbh} (+${deltaSlotTbh} ms) from ${blockTimeTbhAddr}:${blockTimeTbhPort}\n RequestX. ${blockTimeSfrX} (+${deltaTbhSfr} ms)\n Block.... ${blockTimeCbf} (+${deltaSfrCbf} ms) from ${blockTimeCbfAddr}:${blockTimeCbfPort}\n Adopted.. ${blockTimeAb} (+${deltaCbfAb} ms)\n Size..... ${blockSize} bytes\n delay.... ${blockDelay} sec"
else
# skip block reporting while node is synching up
Expand All @@ -313,14 +313,14 @@ reportBlock() {
fi
# prepare for next round
slotHeightPrev=$blockSlot;
blockTimeTbh=""; missingTbh=true; blockTimeSfr1=""; blockTimeSfrX=""; blockTimeCbf=""; missingCbf=true; blockTimeCbfAddr=""; blockTimeCbfPort=""; blockTimeAb=""; blockSlot=""; blockSlotTime=""
blockDelay=""; blockSize=""; blockTimeDeltaSlots=0; deltaCbf=""; deltaSfr=""; deltaAb=""; blockTimeTbhAddr=""; blockTimeTbhPort="";
blockTimeTbh=""; missingTbh=true; blockTimeSfrX=""; blockTimeCbf=""; missingCbf=true; blockTimeCbfAddr=""; blockTimeCbfPort=""; blockTimeAb=""; blockSlot=""; blockSlotTime=""
blockDelay=""; blockSize=""; blockTimeTbhAddr=""; blockTimeTbhPort="";
}

if [[ "${PARSE_MANUAL}" == "Y" ]]; then
# manually parse for a certain block (no EKG tracing, no online reporting)
echo "INFO: manual parse mode"
if [[ $2 -gt 0 && ! -z $3 ]]; then
if [[ $2 -gt 0 && -n $3 ]]; then
SELFISH_MODE=Y # don't report this block online
SERVICE_MODE=N # only show console output
iblockHeight=$2
Expand All @@ -343,7 +343,7 @@ echo "blockPerf $BP_VERSION"
echo "parsing ${logfile} for ${NETWORK_NAME} blocks (networkmagic: ${NWMAGIC})"

# on (re)start wait until node metrics become available
while true [ -z $(curl -s -H 'Accept: application/json' http://${EKG_HOST}:${EKG_PORT}/ | jq -r '.cardano.node.metrics.blockNum.int.val //0') ]
while true [[ -z "$(curl -s -H 'Accept: application/json' http://${EKG_HOST}:${EKG_PORT}/ | jq -r '.cardano.node.metrics.blockNum.int.val //0')" ]]
do
blockHeightPrev=$(curl -s -H 'Accept: application/json' http://${EKG_HOST}:${EKG_PORT}/ | jq -r '.cardano.node.metrics.blockNum.int.val //0')
if [ -z $blockHeightPrev ] || [ $blockHeightPrev == 0 ] ; then
Expand Down Expand Up @@ -383,9 +383,9 @@ do
for (( iblockHeight=$blockHeightPrev+1; iblockHeight<=$blockHeight; iblockHeight++ ))
do #catch up from previous to current blockheight
blockHash=$(grep -m 1 ":$iblockHeight" ${logfile} | jq -r .data.block)
if [ ! -z $blockHash ]; then
if [[ -n $blockHash ]]; then
blockLog=$(grep "${blockHash:0:10}" ${logfile} | grep -E 'TraceDownloadedHeader|SendFetchRequest|CompletedBlockFetch|AddedToCurrentChain|SwitchedToAFork' )
if [ $(echo "$blockLog" | grep -h -E 'TraceDownloadedHeader|SendFetchRequest|CompletedBlockFetch|AddedToCurrentChain|SwitchedToAFork' | jq -r .data.kind | sort | uniq | wc -l) -lt 4 ]; then
if [[ "$(echo "${blockLog}" | grep -h -E 'TraceDownloadedHeader|SendFetchRequest|CompletedBlockFetch|AddedToCurrentChain|SwitchedToAFork' | jq -r .data.kind | sort | uniq | wc -l)" -lt 4 ]]; then
# grep'ed blockLog is incomplete (4 steps) probably because of log rotation. so let's grep from all logs
blockLog=$(grep -h -E ${blockHash:0:10} ${logfile/.json/-*} ${logfile} | grep -E 'TraceDownloadedHeader|SendFetchRequest|CompletedBlockFetch|AddedToCurrentChain|SwitchedToAFork' )
fi
Expand All @@ -400,15 +400,14 @@ do
blockHeightPrev=$blockHeight;
fi
elif [ "$forks" -gt "$forksPrev" ] ; then # another new Block (instead of previous one)
forkMode=1
blockHash=$(grep -E -m 1 "SwitchedToAFork+.*${slotNum}" ${logfile} | jq -r .data.newtip)
blockHash=${blockHash:0:64}
if [[ ${#blockHash} -lt 64 ]] ; then # Minimalverbosity only logs first 6chr of blockHash in SwitchedToAFork line
blockHash=$(grep -m 1 "${blockHash}+.*$slotNum" ${logfile} | jq -r .data.block)
fi
if [ ! -z $blockHash ]; then
if [[ -n $blockHash ]]; then
blockLog=$(grep "${blockHash}" ${logfile} | grep -E 'TraceDownloadedHeader|SendFetchRequest|CompletedBlockFetch|AddedToCurrentChain|SwitchedToAFork')
if [ $(echo "$blockLog" | grep -h -E 'TraceDownloadedHeader|SendFetchRequest|CompletedBlockFetch|AddedToCurrentChain|SwitchedToAFork' | jq -r .data.kind | sort | uniq | wc -l) -lt 4 ]; then
if [[ "$(echo "${blockLog}" | grep -h -E 'TraceDownloadedHeader|SendFetchRequest|CompletedBlockFetch|AddedToCurrentChain|SwitchedToAFork' | jq -r .data.kind | sort | uniq | wc -l)" -lt 4 ]]; then
# grep'ed blockLog is incomplete (4 steps) probably because of log rotation. so let's grep from all logs
blockLog=$(grep -h -E ${blockHash:0:10} ${logfile/.json/-*} ${logfile} | grep -E 'TraceDownloadedHeader|SendFetchRequest|CompletedBlockFetch|AddedToCurrentChain|SwitchedToAFork' )
fi
Expand All @@ -423,7 +422,6 @@ do
fi
[[ ${SERVICE_MODE} != "Y" ]] && echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
forksPrev=$forks;
forkMode=0
fi
sleep 1 # slot and second
if [ "$forks" -lt "$forksPrev" ] ; then # node restarted meanwhile
Expand Down
22 changes: 11 additions & 11 deletions scripts/cnode-helper-scripts/cntools.library
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ selectOption() {
clrbuf
local startrow=-1
for i in {1..10}; do
local cursor_row=$(get_cursor_row)
local cursor_row;cursor_row=$(get_cursor_row)
isNumber ${cursor_row} && startrow=$(( cursor_row - $# - 1 )) && break
done
[[ ${startrow} -eq -1 ]] && return 255
Expand Down Expand Up @@ -3986,7 +3986,7 @@ voteDelegation() {
VOTE_DELEG_CMD=(
${CCLI} ${NETWORK_ERA} stake-address vote-delegation-certificate
"${stake_param[@]}"
"${vote_param[@]}"
"${vote_param_arr[@]}"
--out-file "${vote_deleg_cert_file}"
)
println ACTION "${VOTE_DELEG_CMD[*]}"
Expand Down Expand Up @@ -4667,7 +4667,7 @@ submitTxKoiosOgmios() {
println ERROR "\n${FG_RED}ERROR${NC}: Transaction submit failed !!"
if [[ -n ${ogmios_error} ]]; then
jq -r . <<< "${ogmios_error}"
println LOG $(jq -rc . <<< "${ogmios_error}")
println LOG "$(jq -rc . <<< ${ogmios_error})"
else
println ERROR "Submit API error: ${stdout}"
fi
Expand Down Expand Up @@ -4771,9 +4771,9 @@ to_cbor() {
elif [[ $(bc <<< "${value} < 256") -eq 1 ]]; then printf -v cbor "%04x" $((0x1800 + 10#${value})) #2bytes total: first 0x1800 + 1 lower byte value
elif [[ $(bc <<< "${value} < 65536") -eq 1 ]]; then printf -v cbor "%06x" $((0x190000 + 10#${value})) #3bytes total: first 0x190000 + 2 lowerbytes value
elif [[ $(bc <<< "${value} < 4294967296") -eq 1 ]]; then printf -v cbor "%10x" $((0x1A00000000 + 10#${value})) #5bytes total: 0x1A00000000 + 4 lower bytes value
elif [[ $(bc <<< "${value} < 18446744073709551616") -eq 1 ]]; then local tmp="00$(bc <<< "obase=16;ibase=10;${value}+498062089990157893632")"; cbor="${tmp: -18}" #9bytes total: first 0x1B0000000000000000 + 8 lower bytes value
elif [[ $(bc <<< "${value} < 18446744073709551616") -eq 1 ]]; then local tmp;tmp="00$(bc <<< "obase=16;ibase=10;${value}+498062089990157893632")"; cbor="${tmp: -18}" #9bytes total: first 0x1B0000000000000000 + 8 lower bytes value
#if value does not fit into an 8byte unsigned integer, the cbor representation is tag2(pos.bignum)+bytearray of the value
else local cbor=$(to_cbor "tag" 2); local tmp="00$(bc <<< "obase=16;ibase=10;${value}")"; tmp=${tmp: -$(( (${#tmp}-1)/2*2 ))}; local cbor+=$(to_cbor "bytes" ${tmp}) #fancy calc to get a leading zero in the hex array if needed
else local cbor;cbor=$(to_cbor "tag" 2); local tmp;tmp="00$(bc <<< "obase=16;ibase=10;${value}")"; tmp=${tmp: -$(( (${#tmp}-1)/2*2 ))}; local cbor;cbor+=$(to_cbor "bytes" ${tmp}) #fancy calc to get a leading zero in the hex array if needed
fi
;;
#bytestring - input is a hexstring
Expand Down Expand Up @@ -4803,14 +4803,14 @@ to_cbor() {
###
#negative - input is a negative unsigned integer, range is selected via a bc query because bash can't handle big numbers
negative )
local value=$(bc <<< "${value//-/} -1") #negative representation in cbor is the neg. number as a pos. number minus 1, so a -500 will be represented as a 499
local value;value="$(bc <<< "${value//-/} -1")" #negative representation in cbor is the neg. number as a pos. number minus 1, so a -500 will be represented as a 499
if [[ $(bc <<< "${value} < 24") -eq 1 ]]; then printf -v cbor "%02x" $((0x20 + 10#${value})) #1byte total 0x20 value below 24
elif [[ $(bc <<< "${value} < 256") -eq 1 ]]; then printf -v cbor "%04x" $((0x3800 + 10#${value})) #2bytes total: first 0x2000 + 0x1800 + 1 lower byte value
elif [[ $(bc <<< "${value} < 65536") -eq 1 ]]; then printf -v cbor "%06x" $((0x390000 + 10#${value})) #3bytes total: first 0x200000 + 0x190000 + 2 lowerbytes value
elif [[ $(bc <<< "${value} < 4294967296") -eq 1 ]]; then printf -v cbor "%10x" $((0x3A00000000 + 10#${value})) #5bytes total: 0x2000000000 + 0x1A00000000 + 4 lower bytes value
elif [[ $(bc <<< "${value} < 18446744073709551616") -eq 1 ]]; then local tmp="00$(bc <<< "obase=16;ibase=10;${value}+1088357900348863545344")"; cbor="${tmp: -18}" #9bytes total: first 0x3B0000000000000000 + 8 lower bytes value
elif [[ $(bc <<< "${value} < 18446744073709551616") -eq 1 ]]; then local tmp;tmp="00$(bc <<< "obase=16;ibase=10;${value}+1088357900348863545344")"; cbor="${tmp: -18}" #9bytes total: first 0x3B0000000000000000 + 8 lower bytes value
#if value does not fit into an 8byte unsigned integer, the cbor representation is tag3(neg.bignum)+bytearray of the value
else local cbor=$(to_cbor "tag" 3); local tmp="00$(bc <<< "obase=16;ibase=10;${value}")"; tmp=${tmp: -$(( (${#tmp}-1)/2*2 ))}; local cbor+=$(to_cbor "bytes" ${tmp}) #fancy calc to get a leading zero in the hex array if needed
else local cbor;cbor=$(to_cbor "tag" 3); local tmp;tmp="00$(bc <<< "obase=16;ibase=10;${value}")"; tmp=${tmp: -$(( (${#tmp}-1)/2*2 ))}; local cbor;cbor+=$(to_cbor "bytes" ${tmp}) #fancy calc to get a leading zero in the hex array if needed
fi
;;
#tag - input is an unsigned integer
Expand All @@ -4822,8 +4822,8 @@ to_cbor() {
;;
#textstring - input is a utf8-string
string )
local value=$(echo -ne "${value}" | xxd -p -c 65536 | tr -d '\n') #convert the given string into a hexstring and process it further like a bytearray
local bytesLength=$(( ${#value} / 2 )) #bytesLength is length of value /2 because of hex encoding (2chars -> 1byte)
local value;value="$(echo -ne "${value}" | xxd -p -c 65536 | tr -d '\n')" #convert the given string into a hexstring and process it further like a bytearray
local bytesLength;bytesLength=$(( ${#value} / 2 )) #bytesLength is length of value /2 because of hex encoding (2chars -> 1byte)
if [[ ${bytesLength} -lt 24 ]]; then printf -v cbor "%02x${value}" $((0x60 + 10#${bytesLength})) #1byte total 0x60 + lower part value & bytearrayitself
elif [[ ${bytesLength} -lt 256 ]]; then printf -v cbor "%04x${value}" $((0x7800 + 10#${bytesLength})) #2bytes total: first 0x6000 + 0x1800 + 1 lower byte value & bytearrayitself
elif [[ ${bytesLength} -lt 65536 ]]; then printf -v cbor "%06x${value}" $((0x790000 + 10#${bytesLength})) #3bytes total: first 0x600000 + 0x190000 + 2 lower bytes value & bytearrayitself
Expand Down Expand Up @@ -4867,6 +4867,6 @@ getPriceString() {
ada_value=$(bc -l <<< "${price_now}*($1/1000000)")
getDecimalPlaces ${ada_value}
decimals=$?
price_str=$(LC_NUMERIC=C printf " (${FG_LBLUE}%s${NC} ${CURRENCY^^})" "$(formatAsset $(LC_NUMERIC=C printf "%.${decimals}f" "${ada_value}"))")
price_str=$(LC_NUMERIC=C printf " (${FG_LBLUE}%s${NC} ${CURRENCY^^})" "$(formatAsset "$(LC_NUMERIC=C printf "%.${decimals}f" "${ada_value}")")")
fi
}
Loading

0 comments on commit f2b73a4

Please sign in to comment.