From 2edc4be5d5daaa7d164edc3e70888d570be8534e Mon Sep 17 00:00:00 2001 From: Oleg Date: Sun, 1 Dec 2024 20:39:53 +0000 Subject: [PATCH] upd tests paths --- test/hardhat/DexSwap.ts | 2 +- .../testnet/ParentPoolStartAndCompleteDeposit.ts | 4 ++-- test/hardhat/utils/approve.ts | 14 ++++---------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/test/hardhat/DexSwap.ts b/test/hardhat/DexSwap.ts index e41c0c6a4..41bfa5c64 100644 --- a/test/hardhat/DexSwap.ts +++ b/test/hardhat/DexSwap.ts @@ -68,7 +68,7 @@ describe("swap", () => { it("should swap", async () => { try { const { abi: ConceroOrchestratorAbi } = await import( - "../artifacts/contracts/InfraOrchestrator.sol/InfraOrchestrator.json" + "../../artifacts/contracts/InfraOrchestrator.sol/InfraOrchestrator.json" ); await approveToken(publicClient, walletClient, srcTokenAddress, srcTokenAmount); diff --git a/test/hardhat/testnet/ParentPoolStartAndCompleteDeposit.ts b/test/hardhat/testnet/ParentPoolStartAndCompleteDeposit.ts index d8d3eb8f0..d5a93611c 100644 --- a/test/hardhat/testnet/ParentPoolStartAndCompleteDeposit.ts +++ b/test/hardhat/testnet/ParentPoolStartAndCompleteDeposit.ts @@ -5,8 +5,8 @@ import { getFallbackClients } from "../../../utils"; import { conceroNetworks } from "../../../constants"; const usdcAmount = parseUnits("10", 6); -const usdcTokenAddress = process.env.USDC_BASE_SEPOLIA as Address; -const poolAddress = process.env.PARENT_POOL_PROXY_BASE_SEPOLIA as Address; +const usdcTokenAddress = process.env.USDC_BASE_SEPOLIA; +const poolAddress = process.env.PARENT_POOL_PROXY_BASE_SEPOLIA; describe("start deposit usdc to parent pool\n", async () => { const { abi: ParentPoolAbi } = await import("../../../artifacts/contracts/ParentPool.sol/ParentPool.json"); diff --git a/test/hardhat/utils/approve.ts b/test/hardhat/utils/approve.ts index b6a9761e2..3e93451b2 100644 --- a/test/hardhat/utils/approve.ts +++ b/test/hardhat/utils/approve.ts @@ -1,14 +1,8 @@ -import { Address, erc20Abi } from "viem"; -import { WalletClient } from "viem/clients/createWalletClient"; -import { PublicClient } from "viem/clients/createPublicClient"; -import { HttpTransport } from "viem/clients/transports/http"; -import { Chain } from "viem/types/chain"; -import type { Account } from "viem/accounts/types"; -import { RpcSchema } from "viem/types/eip1193"; +import { Address, erc20Abi, WalletClient, PublicClient, HttpTransport, Chain, Account, RpcSchema } from "viem"; export async function approve( - erc20TokenAddress: Address | string, - contractAddress: Address | string, + erc20TokenAddress: Address, + contractAddress: Address, amount: BigInt, walletClient: WalletClient, publicClient: PublicClient, @@ -28,7 +22,7 @@ export async function approve( const tokenHash = await walletClient.writeContract({ abi: erc20Abi, functionName: "approve", - address: erc20TokenAddress as `0x${string}`, + address: erc20TokenAddress, args: [contractAddress, amount], });