Skip to content
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

add max claimable tokens query #375

Merged
merged 8 commits into from
Nov 21, 2022
Merged

add max claimable tokens query #375

merged 8 commits into from
Nov 21, 2022

Conversation

asalzmann
Copy link
Contributor

@asalzmann asalzmann commented Nov 20, 2022

Context and purpose of the change

  • Add a query to get the total number of tokens a user can claim in an airdrop period
  • Add a setup script to run the airdrop locally (reproducibly)

Changelog

  • Add includeClaimed arg to TotalClaimable query (and dependent functions)

Testing

  • Add unittest

I also tested this manually, by running

make start-docker
bash scripts/airdrop.sh
$STRIDE_MAIN_CMD query claim total-claimable stride stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr "true"

and verifying the output

coins:
- amount: "600000"
  denom: ustrd

using "false" returns

coins: []

@github-actions github-actions bot added C:CLI C:docs C:proto dependencies Pull requests that update a dependency file labels Nov 20, 2022
@asalzmann asalzmann changed the title add script to run airdrop add max claimable tokens query Nov 20, 2022
@github-actions github-actions bot removed the dependencies Pull requests that update a dependency file label Nov 20, 2022
@asalzmann asalzmann marked this pull request as ready for review November 20, 2022 19:04
@asalzmann asalzmann requested review from a team and antstalepresh November 21, 2022 04:06
Copy link
Collaborator

@sampocs sampocs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Airdrop script worked as expected. You mentioned adding a new unit test but I'm not seeing it - was that meant as a TODO?

scripts/airdrop.sh Outdated Show resolved Hide resolved
scripts/airdrop.sh Outdated Show resolved Hide resolved
x/claim/client/cli/query.go Show resolved Hide resolved
scripts/airdrop.sh Outdated Show resolved Hide resolved
scripts/airdrop.sh Outdated Show resolved Hide resolved
scripts/airdrop.sh Outdated Show resolved Hide resolved
scripts/airdrop.sh Outdated Show resolved Hide resolved
scripts/airdrop.sh Outdated Show resolved Hide resolved
@asalzmann
Copy link
Contributor Author

@sampocs had forgotten to hit push on the unittest, just pushed it

asalzmann and others added 3 commits November 21, 2022 18:15
Co-authored-by: sampocs <sam@stridelabs.co>
Co-authored-by: sampocs <sam@stridelabs.co>
@asalzmann asalzmann added the A:automerge Automatically merge PR once checks pass label Nov 21, 2022
@mergify mergify bot merged commit 613e857 into main Nov 21, 2022
@Stride-Labs Stride-Labs deleted a comment from sampocs Nov 27, 2022
sontrinh16 pushed a commit to notional-labs/stride that referenced this pull request Mar 27, 2023
## Context and purpose of the change
- Add a query to get the total number of tokens a user can claim in an airdrop period
- Add a setup script to run the airdrop locally (reproducibly) 

## Changelog
- Add `includeClaimed` arg to `TotalClaimable` query (and dependent functions)

## Testing
- Add unittest

I also tested this manually, by running
```
make start-docker
bash scripts/airdrop.sh
$STRIDE_MAIN_CMD query claim total-claimable stride stride1nf6v2paty9m22l3ecm7dpakq2c92ueyununayr "true"
```
and verifying the output
```
coins:
- amount: "600000"
  denom: ustrd
```
using `"false"` returns
```
coins: []
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once checks pass C:CLI C:docs C:proto T:build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants