-
Notifications
You must be signed in to change notification settings - Fork 607
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
Refactor createGauge to accomodate for CL gauges #5383
Changes from 4 commits
dcc3fe4
9190730
c544e5c
3e02f5f
2d3e6e0
aacbbd4
6862cd9
0458c57
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 |
---|---|---|
|
@@ -55,10 +55,6 @@ func (m MsgCreateGauge) ValidateBasic() error { | |
return errors.New("distribution period should be 1 epoch for perpetual gauge") | ||
} | ||
|
||
if lockuptypes.LockQueryType_name[int32(m.DistributeTo.LockQueryType)] != "ByDuration" { | ||
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 was this removed as well? 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. In CreateGauge for CL pool we don't want to limit just using 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. can we add this back and add a clause that if lockTypes are used it has to be "byDuration"? |
||
return errors.New("only duration query condition is allowed. Start time distr conditions is an obsolete codepath slated for deletion") | ||
} | ||
|
||
return nil | ||
} | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,7 +8,6 @@ import ( | |||||
"github.com/stretchr/testify/suite" | ||||||
|
||||||
"github.com/osmosis-labs/osmosis/v15/app/apptesting" | ||||||
appParams "github.com/osmosis-labs/osmosis/v15/app/params" | ||||||
gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" | ||||||
incentivestypes "github.com/osmosis-labs/osmosis/v15/x/incentives/types" | ||||||
"github.com/osmosis-labs/osmosis/v15/x/pool-incentives/types" | ||||||
|
@@ -220,7 +219,7 @@ func (s *KeeperTestSuite) TestCreateConcentratedLiquidityPoolGauge() { | |||||
s.Require().True(gaugeInfo.IsPerpetual) | ||||||
s.Require().Empty(gaugeInfo.Coins) | ||||||
s.Require().Equal(s.Ctx.BlockTime(), gaugeInfo.StartTime) | ||||||
s.Require().Equal(appParams.BaseCoinUnit, gaugeInfo.DistributeTo.Denom) | ||||||
// s.Require().Equal(appParams.BaseCoinUnit, gaugeInfo.DistributeTo.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.
Suggested change
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. In |
||||||
s.Require().Equal(uint64(1), gaugeInfo.NumEpochsPaidOver) | ||||||
} | ||||||
}) | ||||||
|
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.
why was this changed again?
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.
Even if we pass
lockuptypes.QueryCondition{}
to the function, it will still get the default value ofdistrTo.LockQueryType
which is the first value ofLockQueryType
(In this caseByDuration
=> thus causing an error in the loop. )So I just change the index to bypass.
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.
for CL the we are not distributing via locktypes so, what i originally thought was that we could skip distrTo check below;
by passing empty queryCondition. lmk if that makes sense
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.
Yeah I understand ur idea. But the problem I face is even calling
CreateGauge
with empty queryCondition. It is still assigned a value in the function.Thinking about adding new value to
LockQueryType
enum to bypass both ByDuration & ByTime. Lmk what u think about thatThere 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.
i see what about changing the enumType to something like pretty much what you suggested;
if this works, hopefully we donot have to make lots of core logic changes and it works with existing queryCondition
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.
Yeah we r same page 🙌