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

fix: fix hooks and add tests #719

Merged
merged 9 commits into from
Jan 11, 2024
Merged

fix: fix hooks and add tests #719

merged 9 commits into from
Jan 11, 2024

Conversation

puneet2019
Copy link
Member

  • after epoch hooks was using liquidstakeibc feature instead of liquidstake feature.
  • should not cause problems in prod, because both configs are expected to ideally be same.
  • better to fix as functionality-wise it is buggy.

@puneet2019 puneet2019 requested a review from a team as a code owner January 11, 2024 07:54
xlab
xlab previously approved these changes Jan 11, 2024
@xlab xlab requested review from xlab, a team and kruspy January 11, 2024 10:46
@xlab xlab dismissed their stale review January 11, 2024 10:46

misclick

Copy link

Coverage after merging puneet/more-tests into main

69.85%

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
   grpc_query.go100%100%100%
   genesis.go100%100%86.96%14, 23, 32
   keeper.go100%100%77.50%..., 92, 95, 96, 97
x/liquidstake/types
   params.go100%100%83.19%..., 195, 196, 87, 88
   liquidstake.go100%100%93.57%..., 63, 64, 73, 81
   codec.go100%100%100%
   keys.go100%100%100%
   rebalancing.go100%100%84%22, 23, 40, 41
   msgs.go100%100%40.58%..., 96, 97, 98, 99
   genesis.go100%100%100%
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
   delegation_strategy.go100%100%100%
   abci.go100%100%80.94%..., 85, 86, 87, 88
   icq.go100%100%75.90%..., 232, 42, 43, 44
   keeper.go100%100%96.80%..., 366, 374, 93, 94
   validator_unbonding.go100%100%100%
   host_chain.go100%100%99.64%129
   migrations.go100%100%33.33%..., 23, 26, 27, 28
   rebalance.go100%100%91.21%..., 115, 116, 77, 80
   redelegation_txs.go100%100%100%
   ibc.go100%100%23.64%..., 93, 94, 95, 96
   ica.go100%100%65.57%..., 71, 72, 73, 74
   invariants.go100%100%100%
   unbonding.go100%100%100%
   ica_handlers.go100%100%29.18%..., 96, 97, 98, 99
   icq_queries.go100%100%80.20%..., 145, 146, 147, 148
   lsm_deposit.go100%100%100%
   grpc_querier.go100%100%96.57%..., 264, 265, 273, 274
   deposit.go100%100%100%
   redelegation.go100%100%100%
   hooks.go100%100%42.18%..., 909, 910, 944, 945
   msg_server.go100%100%59.89%..., 940, 941, 95, 96
   user_unbonding.go100%100%100%
x/liquidstakeibc/types
   hooks.go100%100%0%..., 29, 30, 31, 34
   codec.go100%100%100%
   keys.go100%100%0%..., 95, 96, 98, 99
   host_chain.go100%100%100%
   liquidstakeibc.go100%100%97.81%17, 18, 19
   msgs.go100%100%89.53%..., 362, 363, 466, 467
   genesis.go100%100%100%
   params.go100%100%100%
x/ratesync
   module_simulation.go100%100%0%..., 79, 80, 81, 82
   module_ibc.go100%100%9.09%..., 96, 97, 98, 99
   module.go100%100%64.06%..., 80, 83, 84, 85
   genesis.go100%100%100%
x/ratesync/keeper
   params.go100%100%84.62%14, 15
   chain.go100%100%100%
   keeper.go100%100%78.38%..., 80, 81, 88, 89
   abci.go100%100%95.83%38
   query.go100%100%85.71%..., 40, 41, 48, 49
   ibc.go100%100%67.30%..., 55, 67, 68, 69
   ica_tx.go100%100%72.03%..., 84, 85, 86, 87
   msg_server.go100%100%63.47%..., 63, 64, 65, 66
   hooks.go100%100%87.76%..., 27, 28, 67, 68
x/ratesync/types
   codec.go100%100%0%..., 27, 28, 29, 30
   keys.go100%100%100%
   msgs.go100%100%67.94%..., 67, 80, 97, 98
   genesis.go100%100%100%
   types.go100%100%96.36%..., 128, 129, 28, 29
   params.go100%100%75%31, 32, 33, 34

Copy link

Coverage after merging puneet/more-tests into main

69.85%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
x/liquidstake/keeper
   genesis.go100%100%86.96%14, 23, 32
   keeper.go100%100%77.50%..., 92, 95, 96, 97
   rebalancing.go100%100%93.33%..., 45, 46, 81, 82
   grpc_query.go100%100%100%
   liquidstake.go100%100%61.69%..., 91, 92, 98, 99
x/liquidstake/types
   msgs.go100%100%40.58%..., 96, 97, 98, 99
   genesis.go100%100%100%
   codec.go100%100%100%
   params.go100%100%83.19%..., 195, 196, 87, 88
   liquidstake.go100%100%93.57%..., 63, 64, 73, 81
   keys.go100%100%100%
   rebalancing.go100%100%84%22, 23, 40, 41
x/liquidstakeibc
   module_ibc.go100%100%8.93%..., 88, 89, 90, 91
   module.go100%100%54.76%..., 72, 73, 74, 99
   genesis.go100%100%100%
x/liquidstakeibc/keeper
   ica_handlers.go100%100%29.18%..., 96, 97, 98, 99
   keeper.go100%100%96.80%..., 366, 374, 93, 94
   validator_unbonding.go100%100%100%
   lsm_deposit.go100%100%100%
   msg_server.go100%100%59.89%..., 940, 941, 95, 96
   redelegation_txs.go100%100%100%
   redelegation.go100%100%100%
   ibc.go100%100%23.64%..., 93, 94, 95, 96
   icq_queries.go100%100%80.20%..., 145, 146, 147, 148
   delegation_strategy.go100%100%100%
   host_chain.go100%100%99.64%129
   invariants.go100%100%100%
   migrations.go100%100%33.33%..., 23, 26, 27, 28
   user_unbonding.go100%100%100%
   deposit.go100%100%100%
   hooks.go100%100%42.18%..., 909, 910, 944, 945
   icq.go100%100%75.90%..., 232, 42, 43, 44
   rebalance.go100%100%91.21%..., 115, 116, 77, 80
   grpc_querier.go100%100%96.57%..., 264, 265, 273, 274
   ica.go100%100%65.57%..., 71, 72, 73, 74
   unbonding.go100%100%100%
   abci.go100%100%80.94%..., 85, 86, 87, 88
x/liquidstakeibc/types
   hooks.go100%100%0%..., 29, 30, 31, 34
   params.go100%100%100%
   msgs.go100%100%89.53%..., 362, 363, 466, 467
   host_chain.go100%100%100%
   codec.go100%100%100%
   liquidstakeibc.go100%100%97.81%17, 18, 19
   genesis.go100%100%100%
   keys.go100%100%0%..., 95, 96, 98, 99
x/ratesync
   genesis.go100%100%100%
   module_ibc.go100%100%9.09%..., 96, 97, 98, 99
   module.go100%100%64.06%..., 80, 83, 84, 85
   module_simulation.go100%100%0%..., 79, 80, 81, 82
x/ratesync/keeper
   hooks.go100%100%87.76%..., 27, 28, 67, 68
   params.go100%100%84.62%14, 15
   ica_tx.go100%100%72.03%..., 84, 85, 86, 87
   chain.go100%100%100%
   msg_server.go100%100%63.47%..., 63, 64, 65, 66
   abci.go100%100%95.83%38
   keeper.go100%100%78.38%..., 80, 81, 88, 89
   ibc.go100%100%67.30%..., 55, 67, 68, 69
   query.go100%100%85.71%..., 40, 41, 48, 49
x/ratesync/types
   msgs.go100%100%67.94%..., 67, 80, 97, 98
   codec.go100%100%0%..., 27, 28, 29, 30
   params.go100%100%75%31, 32, 33, 34
   genesis.go100%100%100%
   types.go100%100%96.36%..., 128, 129, 28, 29
   keys.go100%100%100%

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@kruspy
Copy link
Collaborator

kruspy commented Jan 11, 2024

Just 2 nitpicks, rest LGTM

Copy link

Coverage after merging puneet/more-tests into main

69.85%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
x/liquidstake/keeper
   genesis.go100%100%86.96%14, 23, 32
   liquidstake.go100%100%61.69%..., 91, 92, 98, 99
   grpc_query.go100%100%100%
   keeper.go100%100%77.50%..., 92, 95, 96, 97
   rebalancing.go100%100%93.33%..., 45, 46, 81, 82
x/liquidstake/types
   codec.go100%100%100%
   msgs.go100%100%40.58%..., 96, 97, 98, 99
   keys.go100%100%100%
   params.go100%100%83.19%..., 195, 196, 87, 88
   liquidstake.go100%100%93.57%..., 63, 64, 73, 81
   genesis.go100%100%100%
   rebalancing.go100%100%84%22, 23, 40, 41
x/liquidstakeibc
   module.go100%100%54.76%..., 72, 73, 74, 99
   module_ibc.go100%100%8.93%..., 88, 89, 90, 91
   genesis.go100%100%100%
x/liquidstakeibc/keeper
   host_chain.go100%100%99.64%129
   icq_queries.go100%100%80.20%..., 145, 146, 147, 148
   delegation_strategy.go100%100%100%
   ica_handlers.go100%100%29.18%..., 96, 97, 98, 99
   redelegation_txs.go100%100%100%
   grpc_querier.go100%100%96.57%..., 264, 265, 273, 274
   keeper.go100%100%96.80%..., 366, 374, 93, 94
   abci.go100%100%80.94%..., 85, 86, 87, 88
   hooks.go100%100%42.18%..., 909, 910, 944, 945
   ibc.go100%100%23.64%..., 93, 94, 95, 96
   migrations.go100%100%33.33%..., 23, 26, 27, 28
   unbonding.go100%100%100%
   rebalance.go100%100%91.21%..., 115, 116, 77, 80
   icq.go100%100%75.90%..., 232, 42, 43, 44
   lsm_deposit.go100%100%100%
   msg_server.go100%100%59.89%..., 940, 941, 95, 96
   deposit.go100%100%100%
   redelegation.go100%100%100%
   validator_unbonding.go100%100%100%
   ica.go100%100%65.57%..., 71, 72, 73, 74
   invariants.go100%100%100%
   user_unbonding.go100%100%100%
x/liquidstakeibc/types
   liquidstakeibc.go100%100%97.81%17, 18, 19
   msgs.go100%100%89.53%..., 362, 363, 466, 467
   genesis.go100%100%100%
   params.go100%100%100%
   hooks.go100%100%0%..., 29, 30, 31, 34
   keys.go100%100%0%..., 95, 96, 98, 99
   codec.go100%100%100%
   host_chain.go100%100%100%
x/ratesync
   module_simulation.go100%100%0%..., 79, 80, 81, 82
   module.go100%100%64.06%..., 80, 83, 84, 85
   genesis.go100%100%100%
   module_ibc.go100%100%9.09%..., 96, 97, 98, 99
x/ratesync/keeper
   hooks.go100%100%87.76%..., 27, 28, 67, 68
   chain.go100%100%100%
   abci.go100%100%95.83%38
   params.go100%100%84.62%14, 15
   query.go100%100%85.71%..., 40, 41, 48, 49
   msg_server.go100%100%63.47%..., 63, 64, 65, 66
   ica_tx.go100%100%72.03%..., 84, 85, 86, 87
   ibc.go100%100%67.30%..., 55, 67, 68, 69
   keeper.go100%100%78.38%..., 80, 81, 88, 89
x/ratesync/types
   codec.go100%100%0%..., 27, 28, 29, 30
   keys.go100%100%100%
   types.go100%100%96.36%..., 128, 129, 28, 29
   genesis.go100%100%100%
   params.go100%100%75%31, 32, 33, 34
   msgs.go100%100%67.94%..., 67, 80, 97, 98

Copy link

Coverage after merging puneet/more-tests into main

69.85%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
x/liquidstake/keeper
   grpc_query.go100%100%100%
   keeper.go100%100%77.50%..., 92, 95, 96, 97
   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
x/liquidstake/types
   genesis.go100%100%100%
   liquidstake.go100%100%93.57%..., 63, 64, 73, 81
   codec.go100%100%100%
   keys.go100%100%100%
   msgs.go100%100%40.58%..., 96, 97, 98, 99
   rebalancing.go100%100%84%22, 23, 40, 41
   params.go100%100%83.19%..., 195, 196, 87, 88
x/liquidstakeibc
   module.go100%100%54.76%..., 72, 73, 74, 99
   module_ibc.go100%100%8.93%..., 88, 89, 90, 91
   genesis.go100%100%100%
x/liquidstakeibc/keeper
   abci.go100%100%80.94%..., 85, 86, 87, 88
   icq_queries.go100%100%80.20%..., 145, 146, 147, 148
   msg_server.go100%100%59.89%..., 940, 941, 95, 96
   invariants.go100%100%100%
   redelegation.go100%100%100%
   validator_unbonding.go100%100%100%
   deposit.go100%100%100%
   user_unbonding.go100%100%100%
   hooks.go100%100%42.18%..., 909, 910, 944, 945
   host_chain.go100%100%99.64%129
   migrations.go100%100%33.33%..., 23, 26, 27, 28
   rebalance.go100%100%91.21%..., 115, 116, 77, 80
   grpc_querier.go100%100%96.57%..., 264, 265, 273, 274
   delegation_strategy.go100%100%100%
   keeper.go100%100%96.80%..., 366, 374, 93, 94
   lsm_deposit.go100%100%100%
   ibc.go100%100%23.64%..., 93, 94, 95, 96
   ica.go100%100%65.57%..., 71, 72, 73, 74
   redelegation_txs.go100%100%100%
   icq.go100%100%75.90%..., 232, 42, 43, 44
   unbonding.go100%100%100%
   ica_handlers.go100%100%29.18%..., 96, 97, 98, 99
x/liquidstakeibc/types
   msgs.go100%100%89.53%..., 362, 363, 466, 467
   host_chain.go100%100%100%
   genesis.go100%100%100%
   codec.go100%100%100%
   keys.go100%100%0%..., 95, 96, 98, 99
   hooks.go100%100%0%..., 29, 30, 31, 34
   params.go100%100%100%
   liquidstakeibc.go100%100%97.81%17, 18, 19
x/ratesync
   genesis.go100%100%100%
   module.go100%100%64.06%..., 80, 83, 84, 85
   module_simulation.go100%100%0%..., 79, 80, 81, 82
   module_ibc.go100%100%9.09%..., 96, 97, 98, 99
x/ratesync/keeper
   chain.go100%100%100%
   query.go100%100%85.71%..., 40, 41, 48, 49
   msg_server.go100%100%63.47%..., 63, 64, 65, 66
   ica_tx.go100%100%72.03%..., 84, 85, 86, 87
   ibc.go100%100%67.30%..., 55, 67, 68, 69
   hooks.go100%100%87.76%..., 27, 28, 67, 68
   abci.go100%100%95.83%38
   params.go100%100%84.62%14, 15
   keeper.go100%100%78.38%..., 80, 81, 88, 89
x/ratesync/types
   types.go100%100%96.36%..., 128, 129, 28, 29
   msgs.go100%100%67.94%..., 67, 80, 97, 98
   keys.go100%100%100%
   params.go100%100%75%31, 32, 33, 34
   codec.go100%100%0%..., 27, 28, 29, 30
   genesis.go100%100%100%

Copy link

Coverage after merging puneet/more-tests into main

70.23%

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%
x/liquidstake/types
   msgs.go100%100%40.58%..., 96, 97, 98, 99
   genesis.go100%100%100%
   keys.go100%100%100%
   params.go100%100%83.19%..., 195, 196, 87, 88
   liquidstake.go100%100%93.57%..., 63, 64, 73, 81
   rebalancing.go100%100%84%22, 23, 40, 41
   codec.go100%100%100%
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
   lsm_deposit.go100%100%100%
   host_chain.go100%100%99.64%129
   ibc.go100%100%23.64%..., 93, 94, 95, 96
   ica_handlers.go100%100%29.18%..., 96, 97, 98, 99
   hooks.go100%100%42.18%..., 909, 910, 944, 945
   grpc_querier.go100%100%96.57%..., 264, 265, 273, 274
   keeper.go100%100%96.80%..., 366, 374, 93, 94
   delegation_strategy.go100%100%100%
   migrations.go100%100%33.33%..., 23, 26, 27, 28
   rebalance.go100%100%91.21%..., 115, 116, 77, 80
   redelegation.go100%100%100%
   unbonding.go100%100%100%
   abci.go100%100%80.94%..., 85, 86, 87, 88
   msg_server.go100%100%59.89%..., 940, 941, 95, 96
   user_unbonding.go100%100%100%
   validator_unbonding.go100%100%100%
   ica.go100%100%65.57%..., 71, 72, 73, 74
   invariants.go100%100%100%
   icq.go100%100%75.90%..., 232, 42, 43, 44
   icq_queries.go100%100%80.20%..., 145, 146, 147, 148
   deposit.go100%100%100%
   redelegation_txs.go100%100%100%
x/liquidstakeibc/types
   keys.go100%100%0%..., 95, 96, 98, 99
   liquidstakeibc.go100%100%97.81%17, 18, 19
   host_chain.go100%100%100%
   msgs.go100%100%89.53%..., 362, 363, 466, 467
   params.go100%100%100%
   hooks.go100%100%0%..., 29, 30, 31, 34
   genesis.go100%100%100%
   codec.go100%100%100%
x/ratesync
   module_simulation.go100%100%0%..., 79, 80, 81, 82
   module.go100%100%64.06%..., 80, 83, 84, 85
   genesis.go100%100%100%
   module_ibc.go100%100%9.09%..., 96, 97, 98, 99
x/ratesync/keeper
   chain.go100%100%100%
   ica_tx.go100%100%72.03%..., 84, 85, 86, 87
   hooks.go100%100%87.76%..., 27, 28, 67, 68
   msg_server.go100%100%74.91%..., 63, 64, 65, 66
   ibc.go100%100%67.30%..., 55, 67, 68, 69
   query.go100%100%85.71%..., 40, 41, 48, 49
   abci.go100%100%95.83%38
   params.go100%100%84.62%14, 15
   keeper.go100%100%78.38%..., 80, 81, 88, 89
x/ratesync/types
   genesis.go100%100%100%
   msgs.go100%100%67.94%..., 67, 80, 97, 98
   keys.go100%100%100%
   codec.go100%100%0%..., 27, 28, 29, 30
   params.go100%100%75%31, 32, 33, 34
   types.go100%100%96.36%..., 128, 129, 28, 29

@puneet2019 puneet2019 merged commit d7b62b9 into main Jan 11, 2024
9 of 10 checks passed
@puneet2019 puneet2019 deleted the puneet/more-tests branch January 11, 2024 20:03
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