PSE Query CLI and Integration tests#35
Conversation
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @masihyeganeh and @miladz68)
integration-tests/modules/pse_test.go line 91 at r1 (raw file):
// Score should be non-negative requireT.False(finalResp.Score.IsNegative(), "score should not be negative")
what about 0 ?
zero is not negative so it might be successful here
integration-tests/modules/pse_test.go line 291 at r1 (raw file):
// Score should still be non-negative and should have increased requireT.False(scoreAfterUndelegate.Score.IsNegative(), "score should not be negative") requireT.True(scoreAfterUndelegate.Score.GT(scoreAfterDelegate.Score), "score should increase after more blocks")
I think we should also verify that after undelegation it stops increasing
integration-tests/modules/pse_test.go line 342 at r1 (raw file):
// Score should be non-negative requireT.False(scoreResp.Score.IsNegative(), "validator score should not be negative")
do we really have score for validators ? is it correct ?
integration-tests/modules/pse_test.go line 375 at r1 (raw file):
// Verify account name is valid requireT.Contains(allAccounts, balance.ClearingAccount, "clearing account should be valid")
nit: maybe we should also verify that clearingAcc balance is > 0
Or it is not true on znet ?
integration-tests/modules/pse_test.go line 390 at r1 (raw file):
// TestPSEQueryScheduledDistributions tests the ScheduledDistributions query endpoint. func TestPSEQueryScheduledDistributions(t *testing.T) {
do we have ScheduledDistributions on znet ?
if no distributions exist should we even test this ?
@miladz68 WDYT ?
8107d44 to
509215a
Compare
TxCorpi0x
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @masihyeganeh, @miladz68, and @ysv)
integration-tests/modules/pse_test.go line 91 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
what about 0 ?
zero is not negative so it might be successful here
Done
integration-tests/modules/pse_test.go line 291 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
I think we should also verify that after undelegation it stops increasing
Done
integration-tests/modules/pse_test.go line 342 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
do we really have score for validators ? is it correct ?
The names were inconsistent, i replaced it with alternative test that covers no delegations, the intent in this test was to track self delegation which is not needed anymore
integration-tests/modules/pse_test.go line 375 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
nit: maybe we should also verify that clearingAcc balance is > 0
Or it is not true on znet ?
Clearing accounts have balances (with the other merged PR for znet mint). Modified for clarity
integration-tests/modules/pse_test.go line 390 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
do we have ScheduledDistributions on znet ?
if no distributions exist should we even test this ?
@miladz68 WDYT ?
The test removed
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh and @miladz68)
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 2 of 3 files at r1, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @masihyeganeh)
integration-tests/modules/pse_test.go line 390 at r1 (raw file):
Previously, TxCorpi0x wrote…
The test removed
@TxCorpi0x is the test removed now ?
x/pse/client/cli/query_test.go line 42 at r3 (raw file):
} func TestQueryScore_WithValidatorAddress(t *testing.T) {
how is this test different than TestQueryScore_NoScore
TxCorpi0x
left a comment
There was a problem hiding this comment.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @masihyeganeh, @miladz68, and @ysv)
integration-tests/modules/pse_test.go line 390 at r1 (raw file):
Previously, miladz68 (milad) wrote…
@TxCorpi0x is the test removed now ?
There was conflicts in local branch after multiple merges to master, fixed and removed the test
x/pse/client/cli/query_test.go line 42 at r3 (raw file):
Previously, miladz68 (milad) wrote…
how is this test different than
TestQueryScore_NoScore
There was conflicts in local branch after multiple merges to master, fixed and removed the test
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 2 of 2 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 2 of 2 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)
* ClI Query for clearing accounts and schedule * PSE queries integration tests * Merge branch 'master' into mehdi/pse-query-cli * Merge branch 'master' into mehdi/pse-query-cli * Resolve comments * Lint fix * Merge branch 'master' into mehdi/pse-query-cli * Fix conflicts * Merge branch 'master' into mehdi/pse-query-cli
* PSE upgrade integration test * Change start time to 12:00 GMT on 28th of month * Rename period to month in PSE init * Fix first day in upgrade test * fix a comment * changed the wait logic * fix linter * Merge branch 'master' into milad/add-wait-pse-upgrade-test * Fix lint issues * PSE Query CLI and Integration tests (#35) * ClI Query for clearing accounts and schedule * PSE queries integration tests * Merge branch 'master' into mehdi/pse-query-cli * Merge branch 'master' into mehdi/pse-query-cli * Resolve comments * Lint fix * Merge branch 'master' into mehdi/pse-query-cli * Fix conflicts * Merge branch 'master' into mehdi/pse-query-cli * Fix tests * Lint Fix --------- Co-authored-by: milad <mza1989@gmail.com>
Description
This pull request adds new CLI query commands to the
x/psemodule and introduces tests to verify their functionality. The main improvements are the ability to query scheduled distributions and clearing account balances, along with comprehensive test coverage for all query commands.New CLI query commands:
CmdQueryScheduledDistributionsto allow users to query all future scheduled distributions from the CLI.CmdQueryClearingAccountBalancesto enable querying the current balances of all PSE clearing accounts from the CLI.Test coverage:
x/pse/client/cli/query_test.gowith unit tests for all query commands, including the new scheduled distributions and clearing account balances queries. These tests verify correct responses and ensure all expected clearing accounts are returned.Reviewers checklist:
Authors checklist
This change is