Skip to content

Commit

Permalink
shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
mraszyk committed Oct 7, 2024
1 parent 7576e32 commit 14acf0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions e2e/tests-dfx/create.bash
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ teardown() {
# The following function decodes a canister id in the textual form into its binary form
# and is taken from the [IC Interface Specification](https://internetcomputer.org/docs/current/references/ic-interface-spec#principal).
function textual_decode() {
echo -n "$1" | tr -d - | tr a-z A-Z |
echo -n "$1" | tr -d - | tr "[:lower:]" "[:upper:]" |
fold -w 8 | xargs -n1 printf '%-8s' | tr ' ' = |
base32 -d | xxd -p | tr -d '\n' | cut -b9- | tr a-z A-Z
base32 -d | xxd -p | tr -d '\n' | cut -b9- | tr "[:lower:]" "[:upper:]"
}

@test "create targets application subnet in PocketIC" {
Expand All @@ -420,11 +420,11 @@ function textual_decode() {
# find application subnet id in the topology
for subnet_id in $(echo "${TOPOLOGY}" | jq keys[])
do
SUBNET_KIND="$(echo $TOPOLOGY | jq -r ".${subnet_id}.\"subnet_kind\"")"
SUBNET_KIND="$(echo "$TOPOLOGY" | jq -r ".${subnet_id}.\"subnet_kind\"")"
if [ "${SUBNET_KIND}" == "Application" ]
then
# find the expected canister id as the beginning of the first canister range of the app subnet
EXPECTED_CANISTER_ID_BASE64="$(echo $TOPOLOGY | jq -r ".${subnet_id}.\"canister_ranges\"[0].\"start\".\"canister_id\"")"
EXPECTED_CANISTER_ID_BASE64="$(echo "$TOPOLOGY" | jq -r ".${subnet_id}.\"canister_ranges\"[0].\"start\".\"canister_id\"")"
fi
done
# check if the actual canister id matches the expected canister id
Expand Down

0 comments on commit 14acf0d

Please sign in to comment.