From ff1de9a43a804dcd181c48e26792e5ac6d4a1d4e Mon Sep 17 00:00:00 2001 From: Corey Rice Date: Wed, 4 Dec 2024 13:43:18 -0300 Subject: [PATCH] fix: fix matchstick tests --- .../isolated-pools/src/constants/addresses.ts | 38 ++++++++++++++----- .../src/constants/config-template | 30 +++++++-------- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/subgraphs/isolated-pools/src/constants/addresses.ts b/subgraphs/isolated-pools/src/constants/addresses.ts index 982b7ff3..bae88a99 100644 --- a/subgraphs/isolated-pools/src/constants/addresses.ts +++ b/subgraphs/isolated-pools/src/constants/addresses.ts @@ -13,16 +13,34 @@ import { } from './config'; export const poolRegistryAddress = Address.fromString(poolRegistryAddressString); +const nullAddressString = '0x0000000000000000000000000000000000000000'; +export const nullAddress = Address.fromString(nullAddressString); -export const nullAddress = Address.fromString('0x0000000000000000000000000000000000000000'); - -export const vBifiAddress = Address.fromString(vBifiAddressString); -export const vLisUsdAddress = Address.fromString(vLisUsdAddressString); -export const vagEURAddress = Address.fromString(vagEURAddressString); +export const vBifiAddress = Address.fromString( + vBifiAddressString.length > 0 ? vBifiAddressString : nullAddressString, +); +export const vLisUsdAddress = Address.fromString( + vLisUsdAddressString.length > 0 ? vLisUsdAddressString : nullAddressString, +); +export const vagEURAddress = Address.fromString( + vagEURAddressString.length > 0 ? vagEURAddressString : nullAddressString, +); export const vankrBNBLiquidStakedBNBAddress = Address.fromString( - vankrBNBLiquidStakedBNBAddressString, + vankrBNBLiquidStakedBNBAddressString.length > 0 + ? vankrBNBLiquidStakedBNBAddressString + : nullAddressString, +); +export const vankrBNBDeFiAddress = Address.fromString( + vankrBNBDeFiAddressString.length > 0 ? vankrBNBDeFiAddressString : nullAddressString, +); +export const vSnBNBAddress = Address.fromString( + vSnBNBAddressString.length > 0 ? vSnBNBAddressString : nullAddressString, +); +export const vWETHLiquidStakedETHAddress = Address.fromString( + vWETHLiquidStakedETHAddressString.length > 0 + ? vWETHLiquidStakedETHAddressString + : nullAddressString, +); +export const vWETHCoreAddress = Address.fromString( + vWETHCoreAddressString.length > 0 ? vWETHCoreAddressString : nullAddressString, ); -export const vankrBNBDeFiAddress = Address.fromString(vankrBNBDeFiAddressString); -export const vSnBNBAddress = Address.fromString(vSnBNBAddressString); -export const vWETHLiquidStakedETHAddress = Address.fromString(vWETHLiquidStakedETHAddressString); -export const vWETHCoreAddress = Address.fromString(vWETHCoreAddressString); diff --git a/subgraphs/isolated-pools/src/constants/config-template b/subgraphs/isolated-pools/src/constants/config-template index 04c243de..e63da011 100644 --- a/subgraphs/isolated-pools/src/constants/config-template +++ b/subgraphs/isolated-pools/src/constants/config-template @@ -1,21 +1,19 @@ // Use yarn prepare commands to generate config typescript file per env export const poolRegistryAddress = '{{ poolRegistryAddress }}'; -// @ts-ignore When the template is created this will fallback to a null string -export const vBifiAddress = '{{ vBifiAddress }}' || '0x0000000000000000000000000000000000000000' -// @ts-ignore When the template is created this will fallback to a null string -export const vLisUsdAddress = '{{ vLisUsdAddress }}' || '0x0000000000000000000000000000000000000000' -// @ts-ignore When the template is created this will fallback to a null string -export const vagEURAddress = '{{ vagEURAddress }}' || '0x0000000000000000000000000000000000000000' -// @ts-ignore When the template is created this will fallback to a null string -export const vankrBNBLiquidStakedBNBAddress = '{{ vankrBNBLiquidStakedBNBAddress }}' || '0x0000000000000000000000000000000000000000' -// @ts-ignore When the template is created this will fallback to a null string -export const vankrBNBDeFiAddress = '{{ vankrBNBDeFiAddress }}' || '0x0000000000000000000000000000000000000000' -// @ts-ignore When the template is created this will fallback to a null string -export const vSnBNBAddress = '{{ vSnBNBAddress }}' || '0x0000000000000000000000000000000000000000' -// @ts-ignore When the template is created this will fallback to a null string -export const vWETHLiquidStakedETHAddress = '{{ vWETHLiquidStakedETHAddress }}' || '0x0000000000000000000000000000000000000000' -// @ts-ignore When the template is created this will fallback to a null string -export const vWETHCoreAddress = '{{ vWETHCoreAddress }}' || '0x0000000000000000000000000000000000000000' +export const vBifiAddress = '{{ vBifiAddress }}' +export const vLisUsdAddress = '{{ vLisUsdAddress }}' + +export const vagEURAddress = '{{ vagEURAddress }}' + +export const vankrBNBLiquidStakedBNBAddress = '{{ vankrBNBLiquidStakedBNBAddress }}' + +export const vankrBNBDeFiAddress = '{{ vankrBNBDeFiAddress }}' + +export const vSnBNBAddress = '{{ vSnBNBAddress }}' + +export const vWETHLiquidStakedETHAddress = '{{ vWETHLiquidStakedETHAddress }}' + +export const vWETHCoreAddress = '{{ vWETHCoreAddress }}'