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

feat: Sprint of improvements for stkxprt / liquidstake #700

Merged
merged 8 commits into from
Dec 18, 2023
Merged

Conversation

xlab
Copy link
Contributor

@xlab xlab commented Dec 15, 2023

  1. added unit tests with sufficient coverage, setup the testing app to have liquidstake module
  2. fixed related issues, linting issues
  3. added autocompounding fee params, logic and tests
  4. changed Superfluid LP's implementation API to lock stkxprt

How to test

Primary E2E2E test is still available as an interchain test case in persistenceCore, but now this has unit tests:

$ cd pstake-native/x/liquidstake
$ go test -v -cover ./...

PASS
coverage: 67.7% of statements
ok  	github.com/persistenceOne/pstake-native/v2/x/liquidstake/keeper
PASS
coverage: 17.3% of statements
ok  	github.com/persistenceOne/pstake-native/v2/x/liquidstake/types

@xlab xlab requested a review from a team as a code owner December 15, 2023 21:06
@xlab xlab requested review from kruspy and puneet2019 December 15, 2023 21:07
Copy link

@xlab your pull request is missing a changelog!

Copy link

Coverage after merging f/stkxprt-improved into main

70.12%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
x/liquidstake/keeper
   genesis.go100%100%86.96%14, 23, 32
   rebalancing.go100%100%93.33%..., 45, 46, 81, 82
   hooks.go100%100%0%..., 19, 20, 21, 22
   grpc_query.go100%100%100%
   liquidstake.go100%100%61.69%..., 91, 92, 98, 99
   keeper.go100%100%77.50%..., 92, 95, 96, 97
x/liquidstake/types
   keys.go100%100%100%
   genesis.go100%100%100%
   codec.go100%100%100%
   rebalancing.go100%100%84%22, 23, 40, 41
   msgs.go100%100%40.58%..., 96, 97, 98, 99
   params.go100%100%83.19%..., 195, 196, 87, 88
   liquidstake.go100%100%93.57%..., 63, 64, 73, 81
x/liquidstakeibc
   genesis.go100%100%100%
   module.go100%100%54.76%..., 72, 73, 74, 99
   module_ibc.go100%100%8.93%..., 88, 89, 90, 91
x/liquidstakeibc/keeper
   hooks.go100%100%43.77%..., 881, 882, 916, 917
   redelegation.go100%100%100%
   delegation_strategy.go100%100%100%
   lsm_deposit.go100%100%100%
   migrations.go100%100%33.33%..., 23, 26, 27, 28
   unbonding.go100%100%100%
   ica_handlers.go100%100%29.18%..., 96, 97, 98, 99
   invariants.go100%100%100%
   abci.go100%100%80.94%..., 85, 86, 87, 88
   rebalance.go100%100%91.21%..., 115, 116, 77, 80
   deposit.go100%100%100%
   host_chain.go100%100%99.64%129
   ibc.go100%100%23.74%..., 91, 92, 93, 94
   validator_unbonding.go100%100%100%
   redelegation_txs.go100%100%100%
   keeper.go100%100%95.60%..., 378, 379, 93, 94
   grpc_querier.go100%100%96.57%..., 265, 266, 274, 275
   ica.go100%100%65.57%..., 71, 72, 73, 74
   icq.go100%100%75.90%..., 232, 42, 43, 44
   user_unbonding.go100%100%100%
   msg_server.go100%100%59.61%..., 954, 955, 96, 97
   icq_queries.go100%100%80.20%..., 145, 146, 147, 148
x/liquidstakeibc/types
   liquidstakeibc.go100%100%100%
   codec.go100%100%100%
   genesis.go100%100%100%
   msgs.go100%100%89.53%..., 362, 363, 466, 467
   keys.go100%100%0%..., 95, 96, 98, 99
   host_chain.go100%100%100%
   hooks.go100%100%0%..., 30, 31, 32, 35
   params.go100%100%100%

@puneet2019 puneet2019 changed the title Sprint of improvements for stkxprt / liquidstake feat: Sprint of improvements for stkxprt / liquidstake Dec 16, 2023
Copy link

Coverage after merging f/stkxprt-improved into main

70.12%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
x/liquidstake/keeper
   rebalancing.go100%100%93.33%..., 45, 46, 81, 82
   liquidstake.go100%100%61.69%..., 91, 92, 98, 99
   genesis.go100%100%86.96%14, 23, 32
   keeper.go100%100%77.50%..., 92, 95, 96, 97
   grpc_query.go100%100%100%
   hooks.go100%100%0%..., 19, 20, 21, 22
x/liquidstake/types
   genesis.go100%100%100%
   params.go100%100%83.19%..., 195, 196, 87, 88
   codec.go100%100%100%
   liquidstake.go100%100%93.57%..., 63, 64, 73, 81
   keys.go100%100%100%
   rebalancing.go100%100%84%22, 23, 40, 41
   msgs.go100%100%40.58%..., 96, 97, 98, 99
x/liquidstakeibc
   genesis.go100%100%100%
   module.go100%100%54.76%..., 72, 73, 74, 99
   module_ibc.go100%100%8.93%..., 88, 89, 90, 91
x/liquidstakeibc/keeper
   ibc.go100%100%23.74%..., 91, 92, 93, 94
   icq.go100%100%75.90%..., 232, 42, 43, 44
   keeper.go100%100%95.60%..., 378, 379, 93, 94
   redelegation.go100%100%100%
   delegation_strategy.go100%100%100%
   host_chain.go100%100%99.64%129
   rebalance.go100%100%91.21%..., 115, 116, 77, 80
   ica_handlers.go100%100%29.18%..., 96, 97, 98, 99
   migrations.go100%100%33.33%..., 23, 26, 27, 28
   msg_server.go100%100%59.61%..., 954, 955, 96, 97
   deposit.go100%100%100%
   hooks.go100%100%43.77%..., 881, 882, 916, 917
   invariants.go100%100%100%
   lsm_deposit.go100%100%100%
   unbonding.go100%100%100%
   abci.go100%100%80.94%..., 85, 86, 87, 88
   redelegation_txs.go100%100%100%
   grpc_querier.go100%100%96.57%..., 265, 266, 274, 275
   ica.go100%100%65.57%..., 71, 72, 73, 74
   icq_queries.go100%100%80.20%..., 145, 146, 147, 148
   validator_unbonding.go100%100%100%
   user_unbonding.go100%100%100%
x/liquidstakeibc/types
   codec.go100%100%100%
   genesis.go100%100%100%
   liquidstakeibc.go100%100%100%
   params.go100%100%100%
   keys.go100%100%0%..., 95, 96, 98, 99
   host_chain.go100%100%100%
   hooks.go100%100%0%..., 30, 31, 32, 35
   msgs.go100%100%89.53%..., 362, 363, 466, 467

Copy link

Coverage after merging f/stkxprt-improved into main

70.11%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
x/liquidstake/keeper
   liquidstake.go100%100%61.69%..., 91, 92, 98, 99
   keeper.go100%100%77.50%..., 92, 95, 96, 97
   genesis.go100%100%86.96%14, 23, 32
   grpc_query.go100%100%100%
   hooks.go100%100%0%..., 19, 20, 21, 22
   rebalancing.go100%100%93.33%..., 45, 46, 81, 82
x/liquidstake/types
   liquidstake.go100%100%93.57%..., 63, 64, 73, 81
   params.go100%100%83.19%..., 195, 196, 87, 88
   keys.go100%100%100%
   msgs.go100%100%40.58%..., 96, 97, 98, 99
   codec.go100%100%100%
   genesis.go100%100%100%
   rebalancing.go100%100%84%22, 23, 40, 41
x/liquidstakeibc
   module_ibc.go100%100%8.93%..., 88, 89, 90, 91
   genesis.go100%100%100%
   module.go100%100%54.76%..., 72, 73, 74, 99
x/liquidstakeibc/keeper
   lsm_deposit.go100%100%100%
   validator_unbonding.go100%100%100%
   deposit.go100%100%100%
   keeper.go100%100%95.60%..., 378, 379, 93, 94
   abci.go100%100%80.94%..., 85, 86, 87, 88
   host_chain.go100%100%99.64%129
   msg_server.go100%100%59.61%..., 954, 955, 96, 97
   ica_handlers.go100%100%29.18%..., 96, 97, 98, 99
   icq.go100%100%75.90%..., 232, 42, 43, 44
   invariants.go100%100%100%
   unbonding.go100%100%100%
   grpc_querier.go100%100%96.57%..., 265, 266, 274, 275
   ibc.go100%100%23.74%..., 91, 92, 93, 94
   ica.go100%100%65.57%..., 71, 72, 73, 74
   migrations.go100%100%33.33%..., 23, 26, 27, 28
   redelegation_txs.go100%100%100%
   delegation_strategy.go100%100%100%
   hooks.go100%100%43.77%..., 881, 882, 916, 917
   icq_queries.go100%100%80.20%..., 145, 146, 147, 148
   rebalance.go100%100%91.21%..., 115, 116, 77, 80
   redelegation.go100%100%100%
   user_unbonding.go100%100%100%
x/liquidstakeibc/types
   msgs.go100%100%89.53%..., 362, 363, 466, 467
   genesis.go100%100%100%
   keys.go100%100%0%..., 95, 96, 98, 99
   liquidstakeibc.go100%100%97.81%17, 18, 19
   codec.go100%100%100%
   host_chain.go100%100%100%
   hooks.go100%100%0%..., 30, 31, 32, 35
   params.go100%100%100%

@xlab xlab merged commit ceddb78 into main Dec 18, 2023
10 of 12 checks passed
@xlab xlab deleted the f/stkxprt-improved branch December 18, 2023 18:53
@xlab xlab restored the f/stkxprt-improved branch December 18, 2023 18:53
@puneet2019 puneet2019 deleted the f/stkxprt-improved branch March 24, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants