summaryrefslogtreecommitdiff
path: root/test/scripts/e2e_subs/rest-participation-key.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/scripts/e2e_subs/rest-participation-key.sh')
-rwxr-xr-xtest/scripts/e2e_subs/rest-participation-key.sh32
1 files changed, 6 insertions, 26 deletions
diff --git a/test/scripts/e2e_subs/rest-participation-key.sh b/test/scripts/e2e_subs/rest-participation-key.sh
index 30557ff2a..e5f7a30b3 100755
--- a/test/scripts/e2e_subs/rest-participation-key.sh
+++ b/test/scripts/e2e_subs/rest-participation-key.sh
@@ -9,38 +9,28 @@ date "+$0 start %Y%m%d_%H%M%S"
# Use admin token for both get and post
export USE_ADMIN=true
-pushd "${TEMPDIR}" || exit
+pushd "${TEMPDIR}" || exit 1
FIRST_ROUND=0
# A really large (but arbitrary) last valid round
-LAST_ROUND=1200000
+LAST_ROUND=120
NAME_OF_TEMP_PARTKEY="tmp.${FIRST_ROUND}.${LAST_ROUND}.partkey"
algokey part generate --first ${FIRST_ROUND} --last ${LAST_ROUND} --keyfile ${NAME_OF_TEMP_PARTKEY} --parent ${ACCOUNT}
-popd || exit
+popd || exit 1
-call_and_verify "Get List of Keys" "/v2/participation" 200 'address'
-
-# Find out how many keys there are installed so far
-NUM_IDS_1=$(echo "$RES" | python3 -c 'import json,sys;o=json.load(sys.stdin);print(len(o))')
+call_and_verify "Get List of Keys" "/v2/participation" 200 'address' 'effective-first-valid'
+RES=""
call_post_and_verify "Install a basic participation key" "/v2/participation" 200 ${NAME_OF_TEMP_PARTKEY} 'partId'
# Get the returned participation id from the RESULT (aka $RES) variable
INSTALLED_ID=$(echo "$RES" | python3 -c 'import json,sys;o=json.load(sys.stdin);print(o["partId"])')
# Should contain the installed id
-call_and_verify "Get List of Keys" "/v2/participation" 200 'address' "${INSTALLED_ID}"
-
-# Get list of keys
-NUM_IDS_2=$(echo "$RES" | python3 -c 'import json,sys;o=json.load(sys.stdin);print(len(o))')
-
-if [[ $((NUM_IDS_1 + 1)) -ne $NUM_IDS_2 ]]; then
- printf "\n\nFailed test. New number of IDs (%s) is not one more than old ID count(%s)\n\n" "${NUM_IDS_2}" "${NUM_IDS_1}"
- exit 1
-fi
+call_and_verify "Get List of Keys" "/v2/participation" 200 'address' "${INSTALLED_ID}" 'address' 'effective-first-valid'
call_and_verify "Get a specific ID" "/v2/participation/${INSTALLED_ID}" 200 "${INSTALLED_ID}"
@@ -49,13 +39,3 @@ call_delete_and_verify "Delete the specific ID" "/v2/participation/${INSTALLED_I
# Verify that it got called previously and now returns an error message saying that no key was found
call_delete_and_verify "Delete the specific ID" "/v2/participation/${INSTALLED_ID}" 404 true 'participation id not found'
-
-# Get list of keys
-NUM_IDS_3=$(echo "$RES" | python3 -c 'import json,sys;o=json.load(sys.stdin);print(len(o))')
-
-if [[ "$NUM_IDS_3" -ne "$NUM_IDS_1" ]]; then
- printf "\n\nFailed test. New number of IDs (%s) is not equal to original ID count (%s)\n\n" "${NUM_IDS_3}" "${NUM_IDS_1}"
- exit 1
-fi
-
-