Add version to base pools and refactor pool constructors #2080
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR moves the version to the base pool layer (both
BasePool
andNewBasePool
), and refactors the constructors for every pool to reduce the stack pressure and arrange the arguments in a way that makes more sense and is more consistent.The idea behind the change is the following:
BasePoolParams
, and every pool has them. There are two benefits here: as a user you know that you'll need at least those in any pool, and also the parameters are routed all the way down to the base layer directly. The version is actually one of those.NewPoolParams
structs, which are basically the current ones in master when extracting the base ones.LinearPool
, since every linear pool type has its own nuances and generalizing the 'non-base' params doesn't add up that much.This PR is expected to compile, but tests have not been refactored yet.
Type of change
Checklist:
master
, or there's a description of how to mergeIssue Resolution
Closes #2026, supersedes #2075.
Alternative to #2078.