-
Notifications
You must be signed in to change notification settings - Fork 606
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
Ensure gauges can only be created for assets that exist on-chain #855
Changes from all commits
82b284a
e69034c
0e88b74
f292078
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,12 @@ func TestPerpetualGaugeNotExpireAfterDistribution(t *testing.T) { | |
Denom: "lptoken", | ||
Duration: time.Second, | ||
} | ||
|
||
// mints coins so supply exists on chain | ||
mintLPtokens := sdk.Coins{sdk.NewInt64Coin(distrTo.Denom, 200)} | ||
err = simapp.FundAccount(app.BankKeeper, ctx, addr, mintLPtokens) | ||
require.NoError(t, err) | ||
|
||
Comment on lines
+35
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we minting / funding account here? I understand why it should be happening in setupGaugeForLPIncentives but I dont understand why we're minting LP Tokens here(Don't have opinions btw, really just curious) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think maybe the denom There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see, makes sense! |
||
_, err = app.IncentivesKeeper.CreateGauge(ctx, true, addr, coins, distrTo, time.Now(), 1) | ||
require.NoError(t, err) | ||
|
||
|
@@ -62,6 +68,12 @@ func TestNonPerpetualGaugeExpireAfterDistribution(t *testing.T) { | |
Denom: "lptoken", | ||
Duration: time.Second, | ||
} | ||
|
||
// mints coins so supply exists on chain | ||
mintLPtokens := sdk.Coins{sdk.NewInt64Coin(distrTo.Denom, 200)} | ||
err = simapp.FundAccount(app.BankKeeper, ctx, addr, mintLPtokens) | ||
require.NoError(t, err) | ||
|
||
_, err = app.IncentivesKeeper.CreateGauge(ctx, false, addr, coins, distrTo, time.Now(), 1) | ||
require.NoError(t, err) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,12 @@ func (suite *KeeperTestSuite) TestDistrAssetToDeveloperRewardsAddrWhenNotEmpty() | |
Denom: "lptoken", | ||
Duration: time.Second, | ||
} | ||
|
||
// mints coins so supply exists on chain | ||
mintLPtokens := sdk.Coins{sdk.NewInt64Coin(distrTo.Denom, 200)} | ||
err = simapp.FundAccount(suite.app.BankKeeper, suite.ctx, gaugeCreator, mintLPtokens) | ||
suite.Require().NoError(err) | ||
|
||
gaugeId, err := suite.app.IncentivesKeeper.CreateGauge(suite.ctx, true, gaugeCreator, coins, distrTo, time.Now(), 1) | ||
Comment on lines
+87
to
91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we minting / funding account here? I understand why it should be happening in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
suite.NoError(err) | ||
err = suite.app.PoolIncentivesKeeper.UpdateDistrRecords(suite.ctx, poolincentivestypes.DistrRecord{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change, as we found out these don't get into the go docs. Can you also make an issue in this repo to update all of our proto files for this? (Moving comments above the line they affect, rather than in the same line, to the side?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created one here: #863