Skip to content

Commit

Permalink
Add input node index range check
Browse files Browse the repository at this point in the history
  • Loading branch information
platfowner committed Sep 10, 2024
1 parent 9d67535 commit ca1918b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deploy_blockchain_genesis_onprem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ if [[ ! $2 =~ $number_re ]] ; then
printf "Invalid <# of Shards> argument: $2\n"
exit
fi
if [[ $3 -lt 0 ]] || [[ $3 -gt 4 ]]; then
printf "Invalid <Parent Node Index Begin> argument: $3\n"
exit
fi
PARENT_NODE_INDEX_BEGIN=$3
printf "PARENT_NODE_INDEX_BEGIN=$PARENT_NODE_INDEX_BEGIN\n"
if [[ $4 -lt 0 ]] || [[ $4 -gt 4 ]]; then
printf "Invalid <Parent Node Index End> argument: $4\n"
exit
fi
PARENT_NODE_INDEX_END=$4
printf "PARENT_NODE_INDEX_END=$PARENT_NODE_INDEX_END\n"
printf "\n"
Expand Down
8 changes: 8 additions & 0 deletions deploy_blockchain_incremental_onprem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ if [[ ! $2 =~ $number_re ]] ; then
printf "Invalid <# of Shards> argument: $2\n"
exit
fi
if [[ $3 -lt 0 ]] || [[ $3 -gt 4 ]]; then
printf "Invalid <Parent Node Index Begin> argument: $3\n"
exit
fi
PARENT_NODE_INDEX_BEGIN=$3
printf "PARENT_NODE_INDEX_BEGIN=$PARENT_NODE_INDEX_BEGIN\n"
if [[ $4 -lt 0 ]] || [[ $4 -gt 4 ]]; then
printf "Invalid <Parent Node Index End> argument: $4\n"
exit
fi
PARENT_NODE_INDEX_END=$4
printf "PARENT_NODE_INDEX_END=$PARENT_NODE_INDEX_END\n"
printf "\n"
Expand Down

0 comments on commit ca1918b

Please sign in to comment.