Skip to content

Commit

Permalink
upd tests paths
Browse files Browse the repository at this point in the history
  • Loading branch information
olegkron committed Dec 1, 2024
1 parent 2edc4be commit 9f1ada7
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .env.clf
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ CLF_SUBID_CELO_ALFAJORES=66
# DON-HOSTED SECRETS VERSIONS
# testnet
CLF_DON_SECRETS_VERSION_SEPOLIA=0
CLF_DON_SECRETS_VERSION_ARBITRUM_SEPOLIA=1732737721
CLF_DON_SECRETS_VERSION_ARBITRUM_SEPOLIA=1733087213
CLF_DON_SECRETS_VERSION_OPTIMISM_SEPOLIA=1720388109
CLF_DON_SECRETS_VERSION_FUJI=1715386158
CLF_DON_SECRETS_VERSION_BASE_SEPOLIA=1732811050
CLF_DON_SECRETS_VERSION_BASE_SEPOLIA=1733087226
CLF_DON_SECRETS_VERSION_POLYGON_AMOY=1718960274

# mainnet
Expand Down
3 changes: 2 additions & 1 deletion tasks/CLF/donSecrets/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import log, { err } from "../../../utils/log";
import listSecrets from "./list";
import { setDonHostedSecretsVersion } from "../../concero/deployInfra/setContractVariables";
import { liveChains } from "../../../constants";
import { HardhatRuntimeEnvironment } from "hardhat/types";

async function upload(chains: CNetwork[], slotid: number, ttl: number) {
const slotId = parseInt(slotid);
Expand Down Expand Up @@ -61,7 +62,7 @@ task("clf-donsecrets-upload", "Encrypts and uploads secrets to the DON")
.addFlag("all", "Upload secrets to all networks")
.addFlag("updatecontracts", "Update the contracts with the new secrets")
.setAction(async taskArgs => {
const hre = require("hardhat");
const hre: HardhatRuntimeEnvironment = require("hardhat");
const { slotid, ttl, all, updatecontracts } = taskArgs;

const processNetwork = async (chain: CNetwork) => {
Expand Down
4 changes: 3 additions & 1 deletion tasks/CLF/unused/Functions-billing/transfer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"use strict";
import { HardhatRuntimeEnvironment } from "hardhat/types";

var __importDefault =
(this && this.__importDefault) ||
function (mod) {
Expand All @@ -12,7 +14,7 @@ const CNetworks_1 = __importDefault(require("../../../../constants/conceroNetwor
.addParam("subid", "Subscription ID")
.addParam("newowner", "Address of the new owner")
.setAction(async taskArgs => {
const hre = require("hardhat");
const hre: HardhatRuntimeEnvironment = require("hardhat");
const { name, live } = hre.network;
if (!CNetworks_1.default[name]) throw new Error(`Chain ${name} not supported`);
const subscriptionId = parseInt(taskArgs.subid);
Expand Down
3 changes: 2 additions & 1 deletion tasks/concero/deployInfra/deployInfra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import deployTransparentProxy from "../../../deploy/TransparentProxy";
import { upgradeProxyImplementation } from "../upgradeProxyImplementation";
import { DeployInfraParams } from "./types";
import { CLF_SECRETS_MAINNET_EXPIRATION, CLF_SECRETS_TESTNET_EXPIRATION } from "../../../constants/CLFSecrets";
import { HardhatRuntimeEnvironment } from "hardhat/types";

task("deploy-infra", "Deploy the CCIP infrastructure")
.addFlag("deployproxy", "Deploy the proxy")
Expand All @@ -23,7 +24,7 @@ task("deploy-infra", "Deploy the CCIP infrastructure")
.setAction(async taskArgs => {
compileContracts({ quiet: true });

const hre = require("hardhat");
const hre: HardhatRuntimeEnvironment = require("hardhat");
const { live, name } = hre.network;
const networkType = conceroNetworks[name].type;
let deployableChains: CNetwork[] = [];
Expand Down
2 changes: 1 addition & 1 deletion tasks/concero/deployInfra/setContractVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,11 @@ export async function setContractVariables(deployableChains: CNetwork[], slotId:

for (const deployableChain of deployableChains) {
if (deployableChain.type === networkTypes.mainnet) await setDexSwapAllowedRouters(deployableChain, abi); // once
await setDstConceroPools(deployableChain, abi); // once

await setDonHostedSecretsVersion(deployableChain, slotId, abi);
await setDonSecretsSlotId(deployableChain, slotId, abi);

await setDstConceroPools(deployableChain, abi); // once
await setFunctionsPremiumFees(deployableChain, abi);
await setJsHashes(deployableChain, abi);
}
Expand Down
3 changes: 2 additions & 1 deletion tasks/concero/pools/removePoolFromPool.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { compileContracts, getClients, getEnvAddress, getEnvVar } from "../../../utils";
import { conceroNetworks, networkEnvKeys, ProxyEnum } from "../../../constants";
import { task } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";

task("remove-pool-from-pool", "Deploy the CCIP infrastructure")
.addParam("pooltoremovechain", "Deploy the proxy")
.setAction(async taskArgs => {
compileContracts({ quiet: true });

const hre = require("hardhat");
const hre: HardhatRuntimeEnvironment = require("hardhat");
const { live, name } = hre.network;
const poolToRemoveNetworkName = taskArgs.pooltoremovechain;
const [poolToRemoveFromAddress] = getEnvAddress(ProxyEnum.parentPoolProxy, name);
Expand Down
8 changes: 4 additions & 4 deletions test/hardhat/testBase/bridgeBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ export async function bridgeBase({
feeBps: 0n,
};

const bridgeTx = await walletClient.writeContract({
const bridgeTxHash = await walletClient.writeContract({
abi: ConceroOrchestratorAbi,
functionName: "bridge",
address: srcContractAddress,
args: [bridgeData, "", integration],
gas: 4_000_000n,
});

const { status } = await publicClient.waitForTransactionReceipt({ hash: bridgeTx });
const { status } = await publicClient.waitForTransactionReceipt({ hash: bridgeTxHash });

if (status === "success") {
console.log(`Bridge successful`, "bridge", "hash:", bridgeTx);
console.log(`Bridge successful`, "bridge", "hash:", bridgeTxHash);
} else {
throw new Error(`Bridge failed. Hash: ${bridgeTx}`);
throw new Error(`Bridge failed. Hash: ${bridgeTxHash}`);
}
}
29 changes: 17 additions & 12 deletions test/hardhat/testnet/Bridge.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "@nomicfoundation/hardhat-chai-matchers";
import { parseUnits } from "viem";
import { bridgeBase } from "../testBase/bridgeBase";
import { getFallbackClients } from "../../../utils";
import { getFallbackClients } from "../../../utils/";
import { conceroNetworks } from "../../../constants";

describe("bridge", () => {
Expand All @@ -12,14 +11,20 @@ describe("bridge", () => {
const srcTokenAmount = parseUnits("1", 6);
const srcContractAddress = process.env.CONCERO_INFRA_PROXY_BASE_SEPOLIA;

it("should bridge", () =>
bridgeBase({
srcTokenAddress,
srcTokenAmount,
srcContractAddress,
dstChainSelector,
senderAddress,
walletClient,
publicClient,
})).timeout(0);
it("should bridge", async () => {
try {
await bridgeBase({
srcTokenAddress,
srcTokenAmount,
srcContractAddress,
dstChainSelector,
senderAddress,
walletClient,
publicClient,
});
} catch (error) {
console.error("Bridge test failed:", error);
throw error;
}
});
});
97 changes: 89 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
"@chainlink/contracts" "^1.1.1"
"@chainlink/contracts-ccip" "^1.5.0"

"@chainlink/solhint-plugin-chainlink-solidity@^1.0.1", "solhint-plugin-chainlink-solidity@npm:@chainlink/solhint-plugin-chainlink-solidity":
"@chainlink/solhint-plugin-chainlink-solidity@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@chainlink/solhint-plugin-chainlink-solidity/-/solhint-plugin-chainlink-solidity-1.0.1.tgz#bc4c417fe068ed3b13c239e071f550cc130f6bee"
integrity sha512-ld0eHzKJZjs/iNKfZtwbR4yP/0YdkBiB+GASYCUz89V+hEn6nCaRoRywgIONRERhHIv5DEDOhcKjo2u2zYHIUA==
Expand Down Expand Up @@ -1641,7 +1641,7 @@
"@openzeppelin/contracts" "4.7.3"
"@openzeppelin/contracts-upgradeable" "4.7.3"

"@openzeppelin/contracts-upgradeable-4.7.3@npm:@openzeppelin/[email protected]", "@openzeppelin/[email protected]":
"@openzeppelin/contracts-upgradeable-4.7.3@npm:@openzeppelin/[email protected]":
version "4.7.3"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz#f1d606e2827d409053f3e908ba4eb8adb1dd6995"
integrity sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==
Expand All @@ -1651,6 +1651,11 @@
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.5.2.tgz#90d9e47bacfd8693bfad0ac8a394645575528d05"
integrity sha512-xgWZYaPlrEOQo3cBj97Ufiuv79SPd8Brh4GcFYhPgb6WvAq4ppz8dWKL6h+jLAK01rUqMRp/TS9AdXgAeNvCLA==

"@openzeppelin/[email protected]":
version "4.7.3"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz#f1d606e2827d409053f3e908ba4eb8adb1dd6995"
integrity sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==

"@openzeppelin/[email protected]":
version "4.8.3"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz#6b076a7b751811b90fe3a172a7faeaa603e13a3f"
Expand Down Expand Up @@ -2525,7 +2530,7 @@
"@uniswap/v3-core" "^1.0.0"
base64-sol "1.0.1"

"@uniswap/v3-periphery@https://github.com/sushiswap/v3-periphery", "sushiswap-v3-periphery@https://github.com/sushiswap/v3-periphery":
"@uniswap/v3-periphery@https://github.com/sushiswap/v3-periphery":
version "1.4.3"
resolved "https://github.com/sushiswap/v3-periphery#c526ab65338a1141afdbc0682b345721ea872abc"
dependencies:
Expand Down Expand Up @@ -5176,7 +5181,43 @@ ethereumjs-vm@^2.3.4:
rustbn.js "~0.2.0"
safe-buffer "^5.1.1"

"ethers-v5@npm:[email protected]", [email protected], ethers@^5.4.7, ethers@^5.7.0, ethers@^5.7.2, ethers@~5.7.0:
"ethers-v5@npm:[email protected]":
version "5.7.2"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e"
integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==
dependencies:
"@ethersproject/abi" "5.7.0"
"@ethersproject/abstract-provider" "5.7.0"
"@ethersproject/abstract-signer" "5.7.0"
"@ethersproject/address" "5.7.0"
"@ethersproject/base64" "5.7.0"
"@ethersproject/basex" "5.7.0"
"@ethersproject/bignumber" "5.7.0"
"@ethersproject/bytes" "5.7.0"
"@ethersproject/constants" "5.7.0"
"@ethersproject/contracts" "5.7.0"
"@ethersproject/hash" "5.7.0"
"@ethersproject/hdnode" "5.7.0"
"@ethersproject/json-wallets" "5.7.0"
"@ethersproject/keccak256" "5.7.0"
"@ethersproject/logger" "5.7.0"
"@ethersproject/networks" "5.7.1"
"@ethersproject/pbkdf2" "5.7.0"
"@ethersproject/properties" "5.7.0"
"@ethersproject/providers" "5.7.2"
"@ethersproject/random" "5.7.0"
"@ethersproject/rlp" "5.7.0"
"@ethersproject/sha2" "5.7.0"
"@ethersproject/signing-key" "5.7.0"
"@ethersproject/solidity" "5.7.0"
"@ethersproject/strings" "5.7.0"
"@ethersproject/transactions" "5.7.0"
"@ethersproject/units" "5.7.0"
"@ethersproject/wallet" "5.7.0"
"@ethersproject/web" "5.7.1"
"@ethersproject/wordlists" "5.7.0"

[email protected], ethers@^5.4.7, ethers@^5.7.0, ethers@^5.7.2, ethers@~5.7.0:
version "5.7.2"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e"
integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==
Expand Down Expand Up @@ -8958,7 +8999,7 @@ [email protected]:
node-addon-api "^2.0.0"
node-gyp-build "^4.2.0"

[email protected]:
[email protected], secp256k1@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-5.0.1.tgz#dc2c86187d48ff2da756f0f7e96417ee03c414b1"
integrity sha512-lDFs9AAIaWP9UCdtWrotXWWF9t8PWgQDcxqgAnpM9rMqxb3Oaq2J0thzPVSxBwdJgyQtkU/sYtFtbM1RSt/iYA==
Expand Down Expand Up @@ -9269,6 +9310,11 @@ solhint-community@^4.0.0:
optionalDependencies:
prettier "^2.8.3"

"solhint-plugin-chainlink-solidity@npm:@chainlink/solhint-plugin-chainlink-solidity":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@chainlink/solhint-plugin-chainlink-solidity/-/solhint-plugin-chainlink-solidity-1.0.1.tgz#bc4c417fe068ed3b13c239e071f550cc130f6bee"
integrity sha512-ld0eHzKJZjs/iNKfZtwbR4yP/0YdkBiB+GASYCUz89V+hEn6nCaRoRywgIONRERhHIv5DEDOhcKjo2u2zYHIUA==

solhint-plugin-prettier@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/solhint-plugin-prettier/-/solhint-plugin-prettier-0.1.0.tgz#2f46999e26d6c6bc80281c22a7a21e381175bef7"
Expand Down Expand Up @@ -9455,7 +9501,7 @@ string-format@^2.0.0:
resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b"
integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand All @@ -9472,6 +9518,15 @@ string-width@^2.1.1:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"

string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^5.0.1, string-width@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
Expand Down Expand Up @@ -9509,7 +9564,7 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -9523,6 +9578,13 @@ strip-ansi@^4.0.0:
dependencies:
ansi-regex "^3.0.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1, strip-ansi@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -9585,6 +9647,16 @@ supports-preserve-symlinks-flag@^1.0.0:
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==

"sushiswap-v3-periphery@https://github.com/sushiswap/v3-periphery":
version "1.4.3"
resolved "https://github.com/sushiswap/v3-periphery#c526ab65338a1141afdbc0682b345721ea872abc"
dependencies:
"@openzeppelin/contracts" "3.4.2-solc-0.7"
"@uniswap/lib" "^4.0.1-alpha"
"@uniswap/v2-core" "1.0.1"
"@uniswap/v3-core" "1.0.0"
base64-sol "1.0.1"

swarm-js@^0.1.40:
version "0.1.42"
resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.42.tgz#497995c62df6696f6e22372f457120e43e727979"
Expand Down Expand Up @@ -10667,7 +10739,7 @@ workerpool@^6.5.1:
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544"
integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -10685,6 +10757,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit 9f1ada7

Please sign in to comment.