add validateBasic() checks to most of x/stakeibc #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.