From 18b3e3e8f7535029266d354f514eb7d2cae659e5 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Tue, 28 Mar 2023 11:28:41 -0400 Subject: [PATCH 1/3] airdrop testing --- dockernet/scripts/airdrop/airdrop3.sh | 63 ++++++++++----------------- dockernet/scripts/airdrop/airdrop4.sh | 1 + 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/dockernet/scripts/airdrop/airdrop3.sh b/dockernet/scripts/airdrop/airdrop3.sh index 15d12bf953..3e3e2336b5 100644 --- a/dockernet/scripts/airdrop/airdrop3.sh +++ b/dockernet/scripts/airdrop/airdrop3.sh @@ -27,8 +27,11 @@ echo "Funding accounts..." # Transfer uatom from gaia to stride, so that we can liquid stake later $GAIA_MAIN_CMD tx ibc-transfer transfer transfer channel-0 stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1000000uatom --from ${GAIA_VAL_PREFIX}1 -y | TRIM_TX sleep 5 -# Fund the distributor account -$STRIDE_MAIN_CMD tx bank send val1 stride12lw3587g97lgrwr2fjtr8gg5q6sku33e5yq9wl 600000ustrd --from val1 -y | TRIM_TX +# query the distribution-test3 account +echo "query the distribution-test3 account" +$STRIDE_MAIN_CMD q bank balances stride12lw3587g97lgrwr2fjtr8gg5q6sku33e5yq9wl +# Fund the distributor-test3 account +$STRIDE_MAIN_CMD tx bank send val1 stride12lw3587g97lgrwr2fjtr8gg5q6sku33e5yq9wl 100ustrd --from val1 -y | TRIM_TX sleep 5 # Fund the airdrop account $STRIDE_MAIN_CMD tx bank send val1 stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1000000000ustrd --from val1 -y | TRIM_TX @@ -44,7 +47,7 @@ sleep 5 # Create the airdrop, so that the airdrop account can claim tokens echo ">>> Testing multiple airdrop reset and claims flow..." -$STRIDE_MAIN_CMD tx claim create-airdrop stride2 $(date +%s) 30 ustrd --from distributor-test3 -y | TRIM_TX +$STRIDE_MAIN_CMD tx claim create-airdrop stride2 $(date +%s) 180 ustrd --from distributor-test3 -y | TRIM_TX sleep 5 # # Set airdrop allocations $STRIDE_MAIN_CMD tx claim set-airdrop-allocations stride2 stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z 1 --from distributor-test3 -y | TRIM_TX @@ -54,60 +57,42 @@ sleep 5 # # 3. Check eligibility and claim the airdrop echo "> Checking claim record elibility" $STRIDE_MAIN_CMD q claim claim-record stride stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z +$STRIDE_MAIN_CMD q bank balances stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z echo "> Claiming airdrop" $STRIDE_MAIN_CMD tx claim claim-free-amount --from stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z -y | TRIM_TX sleep 5 # # 5. Query to check airdrop vesting account was created (w/ correct amount) echo "Verifying funds are vesting, should be 1." -$STRIDE_MAIN_CMD q claim user-vestings stride1jrmtt5c6z8h5yrrwml488qnm7p3vxrrml2kgvl +$STRIDE_MAIN_CMD q claim user-vestings stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z +$STRIDE_MAIN_CMD q bank balances stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z # BATCH 2 - # 6. Wait 30 seconds -echo "> Waiting 30 seconds for next batch..." -sleep 30 + # 6. Wait 60 seconds +echo "> Waiting 60 seconds for next batch..." +sleep 60 +$STRIDE_MAIN_CMD q claim user-vestings stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z +$STRIDE_MAIN_CMD q bank balances stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z # 7. Claim the airdrop $STRIDE_MAIN_CMD tx claim claim-free-amount --from stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z -y | TRIM_TX # # 8. Query to check airdrop vesting account was created (w/ correct amount) echo "> Verifying more funds are vesting, should be 2." -$STRIDE_MAIN_CMD q claim user-vestings stride1jrmtt5c6z8h5yrrwml488qnm7p3vxrrml2kgvl +$STRIDE_MAIN_CMD q claim user-vestings stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z +$STRIDE_MAIN_CMD q bank balances stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z # # BATCH 3 -# # 10. Wait 30 seconds -echo "> Waiting 30 seconds for next batch..." -sleep 30 +# # 10. Wait 60 seconds +echo "> Waiting 60 seconds for next batch..." +sleep 60 +$STRIDE_MAIN_CMD q claim user-vestings stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z +$STRIDE_MAIN_CMD q bank balances stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z # # 11. Claim the airdrop $STRIDE_MAIN_CMD tx claim claim-free-amount --from stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z -y | TRIM_TX # # 12. Query to check airdrop vesting account was created (w/ correct amount) echo "> Verifying more funds are vesting, should be 3." -$STRIDE_MAIN_CMD q claim user-vestings stride1jrmtt5c6z8h5yrrwml488qnm7p3vxrrml2kgvl - - - - -# ### Test staggered airdrops - -# # create airdrop 1 with a 60 day start window, 60 sec reset, claim, sleep 35 -# # $STRIDE_MAIN_CMD tx claim create-airdrop airdrop1 $(date +%s) 60 ustrd --from distributor-test3 -y -# # sleep 5 -# # $STRIDE_MAIN_CMD tx claim set-airdrop-allocations airdrop1 stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z 1 --from distributor-test3 -y -# # sleep 5 -# # $STRIDE_MAIN_CMD tx claim claim-free-amount --from stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z -# # sleep 35 - -# # # create airdrop 2 with a 60 day start window, 60 sec reset, claim, sleep 35 -# # $STRIDE_MAIN_CMD tx claim create-airdrop airdrop1 $(date +%s) 60 stuatom --from distributor-test3 -y -# # sleep 5 -# # $STRIDE_MAIN_CMD tx claim set-airdrop-allocations airdrop1 stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z 1 --from distributor-test3 -y -# # sleep 5 -# # $STRIDE_MAIN_CMD tx claim claim-free-amount --from stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z -# # sleep 35 - -# # # airdrop 1 resets -# # $STRIDE_MAIN_CMD q bank balances stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z -# # $STRIDE_MAIN_CMD tx claim claim-free-amount --from stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z -# # $STRIDE_MAIN_CMD q bank balances stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z - +# $STRIDE_MAIN_CMD q claim user-vestings stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z +$STRIDE_MAIN_CMD q claim user-vestings stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z +$STRIDE_MAIN_CMD q bank balances stride1kwll0uet4mkj867s4q8dgskp03txgjnswc2u4z diff --git a/dockernet/scripts/airdrop/airdrop4.sh b/dockernet/scripts/airdrop/airdrop4.sh index e15484cbca..672b56cd1a 100644 --- a/dockernet/scripts/airdrop/airdrop4.sh +++ b/dockernet/scripts/airdrop/airdrop4.sh @@ -2,6 +2,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source ${SCRIPT_DIR}/../../config.sh +echo $STRIDE_MAIN_CMD # CLEANUP if running tests twice, clear out and re-fund accounts $STRIDE_MAIN_CMD keys delete distributor-test3 -y &> /dev/null || true $STRIDE_MAIN_CMD keys delete distributor-test4 -y &> /dev/null || true From 5a42f8882cf9edd29be511e0b9f7eb136e0888f4 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Thu, 11 Jan 2024 16:28:05 -0600 Subject: [PATCH 2/3] ignore hosts check_go_version --- dockernet/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockernet/build.sh b/dockernet/build.sh index 6b898142db..e3cc239275 100755 --- a/dockernet/build.sh +++ b/dockernet/build.sh @@ -31,7 +31,7 @@ build_local_and_docker() { # the binary if the machine's go version does not match exactly, # however, we can relax this constraint # The following command overrides the check_version using a temporary Makefile override - BUILDDIR=$BUILDDIR make -f Makefile -f <(echo -e 'check_version: ;') build --silent +BUILDDIR=$BUILDDIR make -f Makefile -f <(echo -e 'check_version: ;\ncheck_go_version: ;') build --silent local_build_succeeded=${PIPESTATUS[0]} cd $stride_home From f9c599d103c9b9160d2808b8b28537e198790e03 Mon Sep 17 00:00:00 2001 From: sampocs Date: Fri, 12 Jan 2024 00:12:18 -0600 Subject: [PATCH 3/3] nit --- dockernet/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockernet/build.sh b/dockernet/build.sh index e3cc239275..758d1c7d80 100755 --- a/dockernet/build.sh +++ b/dockernet/build.sh @@ -31,7 +31,7 @@ build_local_and_docker() { # the binary if the machine's go version does not match exactly, # however, we can relax this constraint # The following command overrides the check_version using a temporary Makefile override -BUILDDIR=$BUILDDIR make -f Makefile -f <(echo -e 'check_version: ;\ncheck_go_version: ;') build --silent + BUILDDIR=$BUILDDIR make -f Makefile -f <(echo -e 'check_version: ;\ncheck_go_version: ;') build --silent local_build_succeeded=${PIPESTATUS[0]} cd $stride_home