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 validateBasic() checks to most of x/stakeibc #71

Merged
merged 1 commit into from
Jul 10, 2022

Conversation

riley-stride
Copy link
Contributor

@riley-stride riley-stride commented Jul 8, 2022

Summary
Add some basic input checking to most the stakeibc functions, with particular emphasis on those exposed to the public

Test plan
Run through the expected testing flow:

Observe balances and records being updated live in scripts-local/logs/accounts.log. Build with
make init-build build=sghi
Once built, ibc some tokens from gaia to stride and register gaia's validator set with
sh ./scripts-local/tests/1.sh
Then liquid stake some tokens on gaia. We will 60s to allow them to be delegated on the host zone...
sh ./scripts-local/tests/2.sh
Liquid stake some more tokens. Anytime a new delegation is made after the first, accrued rewards are automatically claimed and compounding begins!
sh ./scripts-local/tests/2.sh
Now you might want to redeem some of your staked atom from the cosmos hub. To being unbonding to address cosmos1g6qdx6kdhpf000afvvpte7hp0vnpzapuyxp8uf (you can choose where to unbond to with Stride), run
sh ./scripts-local/tests/3.sh
You'll see unbonding-delegations in accounts.log and their completion_time. Once the completion time elapses, the tokens will be available to transfer to the address specified when redemption was invoked. Run
sh ./scripts-local/tests/4.sh
You should see the balance of cosmos1g6qdx6kdhpf000afvvpte7hp0vnpzapuyxp8uf increased! Everything is working as expected.

A few more things to look for in accounts.log:

The exchange rate should begin increasing (fairly rapidly) once rewards begin to compound
At the bottom of the logfile, you'll see records being created. This is a window into Stride's internal accounting system.

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.

Looks good!

x/stakeibc/types/message_add_validator.go Show resolved Hide resolved
Copy link
Contributor

@shellvish shellvish left a comment

Choose a reason for hiding this comment

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

lgtm!

@riley-stride riley-stride merged commit e4de3a6 into main Jul 10, 2022
riley-stride pushed a commit that referenced this pull request Sep 5, 2022
* Add Cheqd chain.json

* Updated correct parameters for endpoints

Co-authored-by: toktar <renata.toktar@dsr-corporation.com>
sontrinh16 pushed a commit to notional-labs/stride that referenced this pull request Mar 27, 2023
…-validation

add validateBasic() checks to most of x/stakeibc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants