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

Test improvisation for Superfluid #1070

Merged
merged 11 commits into from
Mar 14, 2022
Merged

Conversation

mattverse
Copy link
Member

@mattverse mattverse commented Mar 10, 2022

Description

This PR improvises superfluid testing environment in the following ways:

  • Add tests for IntermediaryAccount, IntermediaryAccountConnection
  • Add test packages for balancer and lockup so that they have publicly exposed methods for suite (cref: Make test scaffolding for superfluid #1033)
  • Improvise hooks test so that it covers superfluid flow test
  • add minor comment on gauge.proto

For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2022

Codecov Report

Merging #1070 (2390648) into main (9f64276) will increase coverage by 0.31%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1070      +/-   ##
==========================================
+ Coverage   20.64%   20.96%   +0.31%     
==========================================
  Files         193      194       +1     
  Lines       25270    25391     +121     
==========================================
+ Hits         5218     5322     +104     
- Misses      19096    19106      +10     
- Partials      956      963       +7     
Impacted Files Coverage Δ
x/incentives/types/gauge.pb.go 0.62% <ø> (ø)
x/superfluid/keeper/hooks.go 66.66% <0.00%> (-5.56%) ⬇️
x/claim/keeper/hooks.go 25.92% <0.00%> (-2.08%) ⬇️
x/superfluid/keeper/invariants.go 54.05% <0.00%> (ø)
x/superfluid/keeper/intermediary_account.go 88.46% <0.00%> (+1.69%) ⬆️
x/superfluid/keeper/stake.go 58.13% <0.00%> (+4.65%) ⬆️
x/superfluid/keeper/keeper.go 100.00% <0.00%> (+6.25%) ⬆️
x/superfluid/keeper/grpc_query.go 59.67% <0.00%> (+13.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f64276...2390648. Read the comment docs.

@@ -86,7 +86,7 @@ func (suite *KeeperTestSuite) SetupSuperfluidDelegate(delAddr sdk.AccAddress, va
coins := sdk.Coins{sdk.NewInt64Coin(denom, amount)}
lastLockID := suite.App.LockupKeeper.GetLastLockID(suite.Ctx)

lockID := suite.LockTokens(delAddr, coins, unbondingDuration)
lockID := suite.lockupTestHelper.LockTokens(delAddr, coins, unbondingDuration)
Copy link
Contributor

Choose a reason for hiding this comment

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

LockTokens should be used on all LockTokens related tests, not only superfluid?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean I should change other tests in other packages to use this as well?

@mattverse mattverse added the A:backport/v7.x Do not use. backport patches to v7.x branch label Mar 10, 2022
@ValarDragon ValarDragon self-requested a review March 10, 2022 16:40
Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM once comments are resolved!

@mattverse
Copy link
Member Author

Changes made, planning to merge this as soon as lint and tests passes

@mattverse mattverse merged commit 00b4b2c into main Mar 14, 2022
@mattverse mattverse deleted the mattverse/superfluid-test-flow branch March 14, 2022 04:15
mergify bot pushed a commit that referenced this pull request Mar 14, 2022
* add utility for SetupGammPoolsAndSuperfluidAssets

* remove hardcoded gamm pool denoms

* fix for main branch ctx => Ctx, app => App in tests

* Test Changes

* Add testing packages

* Delete fmt

* Fix lint

* Remove multiple pacakges for apptesting

* Add parameter for reward allocation

* Improvements on test

Co-authored-by: antstalepresh <stalepresh121@outlook.com>
(cherry picked from commit 00b4b2c)

# Conflicts:
#	x/superfluid/keeper/hooks_test.go
#	x/superfluid/keeper/keeper_test.go
mattverse added a commit that referenced this pull request Mar 14, 2022
* Test improvisation for Superfluid (#1070)

* add utility for SetupGammPoolsAndSuperfluidAssets

* remove hardcoded gamm pool denoms

* fix for main branch ctx => Ctx, app => App in tests

* Test Changes

* Add testing packages

* Delete fmt

* Fix lint

* Remove multiple pacakges for apptesting

* Add parameter for reward allocation

* Improvements on test

Co-authored-by: antstalepresh <stalepresh121@outlook.com>
(cherry picked from commit 00b4b2c)

# Conflicts:
#	x/superfluid/keeper/hooks_test.go
#	x/superfluid/keeper/keeper_test.go

* Fix merge conflictS

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>
Co-authored-by: mattverse <mattpark1028@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v7.x Do not use. backport patches to v7.x branch
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants