-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autopilot Channel Verification #728
Changes from 17 commits
e00a771
fe17412
2a6972a
73ebe37
5f30d0b
0d5afbb
2eca370
0a432d2
266b1a8
3e1b85b
b7e5f0c
fd0456f
3f0bd06
0e19367
0f49b0f
c4eb338
4d9b073
648744c
a63f4de
06b6bd8
d5c226d
1b31e87
0351d75
0c68fa1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Airdrop Integration Tests | ||
Each airdrop testing script (1 through 4) tests differnet aspects of the airdrop. | ||
|
||
### Overview | ||
**NOTE**: You must update the airdrop timing params before running parts 3 and 4 (see next section) | ||
* **Part 1**: Tests basic airdrop claims and actions | ||
* **Part 2**: Tests claiming through autopilot (ibc-go v3) | ||
* **Part 3**: Tests that the airdrop resets properly at the epoch | ||
* **Part 4**: Tests two airdrops running side by side and staggered | ||
|
||
### Instructions | ||
* If running Part 3 or 4: Before building stride, you must update the following airdrop timing parameters in `x/claim/types/params.go`: | ||
sampocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* `DefaultEpochDuration` to `time.Second * 60` | ||
* `DefaultVestingInitialPeriod` to `time.Second * 120` | ||
* Only the GAIA host zone is required. Start dockernet with: | ||
```bash | ||
make start-docker build=sgr | ||
``` | ||
* Run the corresponding script | ||
```bash | ||
bash dockernet/scripts/airdrop/airdrop{1/2/3/4}.sh | ||
sampocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
* **NOTE**: Each script must be run independently, meaning you must restart dockernet between runs (`make start-docker build=sgr`) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
### AIRDROP TESTING FLOW | ||
#!/bin/bash | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
source ${SCRIPT_DIR}/../../config.sh | ||
|
||
# CLEANUP if running tests twice, clear out and re-fund accounts | ||
$STRIDE_MAIN_CMD keys delete airdrop-test -y &> /dev/null || true | ||
$STRIDE_MAIN_CMD keys delete distributor-test -y &> /dev/null || true | ||
$OSMO_MAIN_CMD keys delete host-address-test -y &> /dev/null || true | ||
### AIRDROP TESTING FLOW Pt 1 | ||
|
||
# This script tests airdrop claiming directly on Stride | ||
# This covers the case where the host zone has a coin type of 118 | ||
# and autopilot is disabled for the claim | ||
|
||
# First, start the network with `make start-docker` | ||
# Then, run this script with `bash dockernet/scripts/airdrop.sh` | ||
# Then, run this script with `bash dockernet/scripts/airdrop/airdrop1.sh` | ||
sampocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# NOTE: First, store the keys using the following mnemonics | ||
echo "Registering accounts..." | ||
# distributor address: stride1z835j3j65nqr6ng257q0xkkc9gta72gf48txwl | ||
# distributor mnemonic: barrel salmon half click confirm crunch sense defy salute process cart fiscal sport clump weasel render private manage picture spell wreck hill frozen before | ||
echo "barrel salmon half click confirm crunch sense defy salute process cart fiscal sport clump weasel render private manage picture spell wreck hill frozen before" | \ | ||
|
@@ -33,32 +35,33 @@ sleep 5 | |
$STRIDE_MAIN_CMD tx bank send val1 stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1000000000ustrd --from val1 -y | TRIM_TX | ||
sleep 5 | ||
# Create the airdrop, so that the airdrop account can claim tokens | ||
$STRIDE_MAIN_CMD tx claim create-airdrop stride 1679715340 40000000 ustrd --from distributor-test -y | TRIM_TX | ||
$STRIDE_MAIN_CMD tx claim create-airdrop gaia GAIA ustrd 1679715340 40000000 false --from distributor-test -y | TRIM_TX | ||
sleep 5 | ||
# Set airdrop allocations | ||
$STRIDE_MAIN_CMD tx claim set-airdrop-allocations stride stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1 --from distributor-test -y | TRIM_TX | ||
$STRIDE_MAIN_CMD tx claim set-airdrop-allocations gaia stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr 1 --from distributor-test -y | TRIM_TX | ||
sleep 5 | ||
|
||
# AIRDROP CLAIMS | ||
# Check balances before claims | ||
echo "Initial balance before claim:" | ||
$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr | ||
# QUESTION: I assume these tests cannot be run back to back - but if they can then I can change the expectations below to be deltas | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think they actually can be re-run but it requires the airdrop duration (line 38) to be something smaller, like 240s. imo not worth prioritizing this now, given it'll also take time to modify all of the queries, and I don't think we'll be running these back-to-back very often There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup agreed! I think for now we should treat these tests as idempotent scripts that need a dockernet restart each time. And we can always come back and try to make them idempotent later, but low priority! |
||
echo -e "\nInitial balance before claim [1000000000ustrd expected]:" | ||
$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr --denom ustrd | ||
# NOTE: You can claim here using the CLI, or from the frontend! | ||
# Claim 20% of the free tokens | ||
echo "Claiming fee amount..." | ||
echo -e "\nClaiming free amount..." | ||
$STRIDE_MAIN_CMD tx claim claim-free-amount --from airdrop-test --gas 400000 -y | TRIM_TX | ||
sleep 5 | ||
echo "Balance after claim:" | ||
$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr | ||
echo -e "\nBalance after claim [1000120000ustrd expected]:" | ||
$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr --denom ustrd | ||
# Stake, to claim another 20% | ||
echo "Staking..." | ||
echo -e "\nStaking..." | ||
$STRIDE_MAIN_CMD tx staking delegate stridevaloper1nnurja9zt97huqvsfuartetyjx63tc5zrj5x9f 100ustrd --from airdrop-test --gas 400000 -y | TRIM_TX | ||
sleep 5 | ||
echo "Balance after stake:" | ||
$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr | ||
echo -e "\nBalance after stake [1000239900ustrd expected]:" | ||
$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr --denom ustrd | ||
# Liquid stake, to claim the final 60% of tokens | ||
echo "Liquid staking..." | ||
echo -e "\nLiquid staking..." | ||
$STRIDE_MAIN_CMD tx stakeibc liquid-stake 1000 uatom --from airdrop-test --gas 400000 -y | TRIM_TX | ||
sleep 5 | ||
echo "Balance after liquid stake:" | ||
$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr | ||
echo -e "\nBalance after liquid stake [1000599900ustrd expected]:" | ||
$STRIDE_MAIN_CMD query bank balances stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr --denom ustrd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extreme nit: differnet -> different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done