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
| import type { Address } from 'viem' | |
| import { beforeEach, describe, expect, it, vi } from 'vitest' | |
| import type { FundingRateArbParams } from './open' | |
| // Only mock external deps - logger and storage | |
| vi.mock('@/lib/logger', () => ({ | |
| logger: { getChild: () => ({ info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() }) }, | |
| })) | |
| vi.mock('@/lib/storage/env-storage', () => ({ |
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
| import type { Address } from 'viem' | |
| import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' | |
| import type { StrategyPhase, StrategyState } from './strategy-store' | |
| // Mock setup - hoisted before imports | |
| const mockBusOn = vi.fn() | |
| const mockStrategyStoreGetState = vi.fn() | |
| const mockUpdateStrategy = vi.fn() | |
| // Capture the event handlers registered with bus.on |
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
| const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" | |
| const DAI_TOKEN_ADDRESS = "0x6b175474e89094c44da98b954eedeac495271d0f" | |
| const LUSD_TOKEN_ADDRESS = "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0" | |
| const migrateMakerVaultToLiquity = (dsa, helpers, vaultId) => { | |
| // 1. Look up how much collateral and debt exists in the Maker vault | |
| const vault = await helpers.getMakerResolver().getVaultById(vaultId) | |
| const vaultCollateral = vault.ink | |
| const vaultDebt = vault.debt |
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
| const moveLusdGainToStabilityPoolRecipe = (dsa, frontendTagAddress) => { | |
| const spells = dsa.Spell() | |
| const lusdGainId = 1; // ID reference to the LUSD amount that is claimed | |
| const claimStakingGainsSpell = { | |
| connector: "LIQUITY-A", | |
| method: "claimStakingGains", | |
| args: [0, lusdGainId] |
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
| export const asdf = 123 |
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
| import createThunkStore from './ceate-thunk-store' | |
| import { postUser } from './actions' | |
| import { | |
| POST_USER_REQUESTED, | |
| POST_USER_SUCCEEDED, | |
| POST_USER_FAILED, | |
| } from './action-types' | |
| const API_SERVICE_PATH = './api-service' |
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
| import createThunkStore from './create-thunk-store' | |
| import { postUser } from './actions' | |
| import { | |
| POST_USER_REQUESTED, | |
| POST_USER_SUCCEEDED, | |
| POST_USER_FAILED, | |
| } from './action-types' | |
| describe('postUser', () => { | |
| describe('dispatches correct actions', () => { |
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
| import createThunkStore from './create-thunk-store' | |
| import { | |
| POST_USER_REQUESTED, | |
| POST_USER_SUCCEEDED, | |
| POST_USER_FAILED, | |
| } from './action-types' | |
| const API_SERVICE_PATH = './api-service' | |
| describe('postUser', () => { |
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
| // some back ends don't respond correctly if origin header isn't set to target host. | |
| devServer: { | |
| proxy: { | |
| "/api": { | |
| ignorePath: true, | |
| target: "http|https://your-api.com/api", | |
| // secure: false, optional for https | |
| changeOrigin: true, | |
| }, | |
| }, |
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
| // | |
| // Copyright (c) 2014 PayPal. All rights reserved. | |
| // | |
| /** | |
| * The PayPalItem class defines an optional itemization for a payment. | |
| * @see https://developer.paypal.com/docs/api/#item-object for more details. | |
| * @param {String} name: Name of the item. 127 characters max | |
| * @param {Number} quantity: Number of units. 10 characters max. |
NewerOlder