-
Notifications
You must be signed in to change notification settings - Fork 65
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: create lbp #605
base: main
Are you sure you want to change the base?
feat: create lbp #605
Conversation
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.
Overall approach to input validator seems to make sense - I don't think we can do much better than this with how it's currently structured - let's consider a greater refactor in another PR 👍
I left a few comments that should help polish the current implementation a bit.
src/entities/createPool/types.ts
Outdated
export type CreatePoolInput = | ||
| CreatePoolV2WeightedInput | ||
| CreatePoolV2ComposableStableInput | ||
| CreatePoolV3WeightedInput | ||
| CreatePoolV3StableInput | ||
| CreatePoolStableSurgeInput; | ||
| CreatePoolStableSurgeInput | ||
| CreateLiquidityBoostrappingPoolInput; |
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.
I'd keep the standard:
| CreateLiquidityBoostrappingPoolInput; | |
| CreatePoolLiquidityBootstrappingInput; |
@@ -34,7 +37,9 @@ export class InputValidatorComposableStable extends InputValidatorBase { | |||
} | |||
|
|||
validateCreatePool(input: CreatePoolV2ComposableStableInput): void { | |||
super.validateCreatePool(input); | |||
validateCreatePoolTokens(input.tokens); | |||
validateCreatePoolTokenConfig(input); |
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.
validateCreatePoolTokenConfig
seems to be relevant to v3 only and ComposableStable exists only on V2 so you should be able to remove this from here
| CreatePoolV2WeightedInput | ||
| CreatePoolV2ComposableStableInput |
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.
We don't have Boosted pools on V2, so you should be able to remove these 2 options
throw new Error('Start time must be in the future'); | ||
} | ||
// tokens cannot be the same | ||
if (input.lbpParams.projectToken === input.lbpParams.reserveToken) { |
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.
Please use isSameAddress
helper to avoid issues with case sensitive comparisons
| CreatePoolV2WeightedInput | ||
| CreatePoolV2ComposableStableInput |
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.
Same here about removing first 2 options (which are related to V2)
I'm having the same maybe something to do with that last PR bruno merged? 🤔 |
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.
Should be no change to the pnpm-lock file.
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.
@mkflow27 I ran into the same lockfileVerison: '9.0'
change causing problem with Lint
check
The cause was that my machine had pnpm v9.x
globally installed
The fix was...
- global install of verison that matches our
package.json
npm install -g pnpm@8.6.0
- revert the lock file back to state of latest commit on main branch
git checkout de8956de -- pnpm-lock.yaml
- run install again
pnpm install
I believe its because the pnpm-lockfile is updated with a different version. Reverting that change should fix things. |
This feature add lbp creation support to the sdk.
Outstanding: