-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove remaining isV2 / isV3 helpers
- Loading branch information
Showing
7 changed files
with
24 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { AaveVersion } from '@dma-library/strategies' | ||
|
||
export function isV2< | ||
GeneralDeps extends { protocol: { version: AaveVersion } }, | ||
GeneralDeps extends { protocol: { version: AaveVersion } } | { protocolVersion: AaveVersion }, | ||
SpecificDeps extends GeneralDeps, | ||
>(dependencies: GeneralDeps): dependencies is SpecificDeps { | ||
if ('protocolVersion' in dependencies) { | ||
return dependencies.protocolVersion === AaveVersion.v2 | ||
} | ||
return dependencies.protocol.version === AaveVersion.v2 | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { AaveVersion } from '@dma-library/strategies' | ||
|
||
export function isV3< | ||
GeneralDeps extends { protocol: { version: AaveVersion } }, | ||
GeneralDeps extends { protocol: { version: AaveVersion } } | { protocolVersion: AaveVersion }, | ||
SpecificDeps extends GeneralDeps, | ||
>(dependencies: GeneralDeps): dependencies is SpecificDeps { | ||
if ('protocolVersion' in dependencies) { | ||
return dependencies.protocolVersion === AaveVersion.v3 | ||
} | ||
return dependencies.protocol.version === AaveVersion.v3 | ||
} |
This file contains 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
This file contains 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