-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.4.0: getMerklStrategies, jest, ci, refactoring
- Loading branch information
Showing
12 changed files
with
2,330 additions
and
56 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Test and coverage | ||
on: [push, pull_request] | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Node 18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Run yarn install | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install # will run `yarn install` command | ||
- name: Run tests and collect coverage | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: coverage # will run `yarn coverage` command | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
node_modules | ||
out | ||
.tmp | ||
coverage |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
preset: "ts-jest", | ||
transform: {'^.+\\.ts?$': 'ts-jest'}, | ||
testEnvironment: 'node', | ||
testRegex: '/tests/.*\\.(test|spec)?\\.(ts|tsx)$', | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
modulePathIgnorePatterns: ["out"], | ||
collectCoverageFrom: ["src/**/*.ts"] | ||
}; |
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {NetworkId, networks, strategies, deployments, integrations, StrategyShortId} from "../src"; | ||
|
||
describe('index', () => { | ||
test('deployments', () => { | ||
expect(deployments["137"].platform).toBe("0xb2a0737ef27b5Cc474D24c779af612159b1c3e60") | ||
}) | ||
test('networks', () => { | ||
expect(networks["1"].id).toBe(NetworkId.ETHEREUM) | ||
}) | ||
test('strategies', () => { | ||
expect(strategies[StrategyShortId.CCF].id).toBe('Curve Convex Farm') | ||
}) | ||
test('integrations', () => { | ||
expect(integrations["chainlink"].name).toBe('ChainLink') | ||
}) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { getIntegrationStatus} from "../src/integrations"; | ||
import {NetworkId, strategies, StrategyShortId, StrategyState, DefiCategory, DeFiProtocol, IntegrationStatus} from "../src"; | ||
|
||
describe('testing integrations', () => { | ||
test('get protocol integration status', () => { | ||
const protocol: DeFiProtocol = { | ||
name: 'Test', | ||
category: DefiCategory.AMM, | ||
networks: [NetworkId.BSC,], | ||
} | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.PROPOSED) | ||
protocol.networks = [NetworkId.POLYGON,] | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.POSSIBLE) | ||
protocol.coreContracts = ['PriceReader',] | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.LIVE) | ||
protocol.coreContracts = undefined | ||
protocol.adapters = ['TestAdapter',] | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.LIVE) | ||
protocol.adapters = undefined | ||
protocol.strategies = [StrategyShortId.IQMF,] | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.LIVE) | ||
strategies[StrategyShortId.IQMF].state = StrategyState.AWAITING_DEPLOYMENT | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.BEING_DEPLOYED) | ||
strategies[StrategyShortId.IQMF].state = StrategyState.DEVELOPMENT | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.DEVELOPMENT) | ||
strategies[StrategyShortId.IQMF].state = StrategyState.PROPOSED | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.AWAITING) | ||
protocol.strategies = undefined | ||
protocol.intermediaryStrategies = [StrategyShortId.IQMF,] | ||
strategies[StrategyShortId.IQMF].state = StrategyState.LIVE | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.IN_USE) | ||
strategies[StrategyShortId.IQMF].state = StrategyState.AWAITING_DEPLOYMENT | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.BEING_DEPLOYED) | ||
strategies[StrategyShortId.IQMF].state = StrategyState.DEVELOPMENT | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.DEVELOPMENT) | ||
strategies[StrategyShortId.IQMF].state = StrategyState.PROPOSED | ||
expect(getIntegrationStatus(protocol)).toBe(IntegrationStatus.AWAITING) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {getMerklStrategies} from "../src/strategies"; | ||
|
||
describe('testing strategies', () => { | ||
test('get merkl strategies', () => { | ||
const merklStrategies = getMerklStrategies(); | ||
expect(merklStrategies.includes('Gamma UniswapV3 Merkl Farm')).toBe(true); | ||
expect(merklStrategies.includes('A51 BaseSwap Merkl Farm')).toBe(true); | ||
expect(merklStrategies.length).toBeGreaterThan(13) | ||
}); | ||
}); |
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
Oops, something went wrong.