feat(gas-models): export v2, v4 and mixed-route gas model factories - #967
Open
gomesalexandre wants to merge 1 commit into
Open
feat(gas-models): export v2, v4 and mixed-route gas model factories#967gomesalexandre wants to merge 1 commit into
gomesalexandre wants to merge 1 commit into
Conversation
The gas-models barrel only re-exported the v3 factory, so V2HeuristicGasModelFactory, V4HeuristicGasModelFactory and MixedRouteHeuristicGasModelFactory were not reachable from the package root even though the classes exist and the barrel chain reaches src/index.ts. Add the three missing re-exports, matching the v3 line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
closes #949
what
import { V2HeuristicGasModelFactory } from '@uniswap/smart-order-router'failed with "no exported member". The gas-models barrel (src/routers/alpha-router/gas-models/index.ts) only re-exported./gas-modeland the v3 factory, so the v2, v4 and mixed-route factories were unreachable from the package root even though the classes exist and the barrel chain (gas-models -> alpha-router -> routers -> src) reachessrc/index.ts.The issue names
V2HeuristicGasModelFactory, butV4HeuristicGasModelFactoryandMixedRouteHeuristicGasModelFactoryhave the identical hole, so all three are fixed in the same one-line-per-file style as the existing v3 export.how
Three
export * fromlines added to the gas-models barrel, matching the existing v3 line.Note: the v2 file also exports
BASE_SWAP_COST/COST_PER_EXTRA_HOP, so those two constants now reach the package root too. There is no collision (their only other definition, ingas-costs.ts, is not re-exported by any barrel). One pre-existing naming quirk worth flagging: the root-levelBASE_SWAP_COSTis the v2 flatBigNumber, distinct from the chain-parameterized helper of the same name ingas-costs.ts.testing
Added
gas-model-exports.test.tsimporting the four factories from the package root and asserting each is a function. It fails on the pre-fix code (the named imports resolve toundefined).npx tsc --noEmit: 0 errors.jest test/unit/routers/alpha-router/gas-models: 4 suites / 17 tests pass.