Skip to content

Commit

Permalink
Fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
alavarello committed Dec 26, 2024
1 parent fbda16a commit 3393174
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml → .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Smart Contract Tests
name: Smart Contract Checks

on:
push:
Expand Down Expand Up @@ -30,3 +30,6 @@ jobs:

- name: Run Tests
run: pnpm test

- name: Run Lint
run: pnpm lint:fail
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@
],
"homepage": "https://sci.domains/",
"scripts": {
"prepublish": "pnpm build; pnpm lint; pnpm test:cov; ",
"build": "pnpm compile; tsc",
"prepublish": "corepack pnpm build; corepack pnpm lint; corepack pnpm test:cov; ",
"build": "corepack pnpm compile; tsc",
"compile": "hardhat compile",
"node": "hardhat node",
"clean": "rm -r artifacts cache types dist",
"test": "hardhat test",
"test:cov": "hardhat coverage",
"lint": "hardhat check; lint --fix .; prettier --write .",
"dev": "pnpm setup:localhost; pnpm deploy:localhost",
"lint:fail": "hardhat check; prettier --check .",
"lint": "hardhat check; prettier --write .",
"dev": "corepack pnpm setup:localhost; pnpm deploy:localhost",
"setup:localhost": "hardhat run scripts/setup-localhost.ts --network localhost",
"deploy": "hardhat ignition deploy ignition/modules/ProtocolModule.ts",
"save:deployments": "hardhat run scripts/build-deployment-address.ts",
"deploy:sepolia": "pnpm run deploy --verify --network sepolia --parameters ignition/parameters/sepolia.json5",
"deploy:localhost": "pnpm run deploy --network localhost --parameters ignition/parameters/sepolia.json5",
"prepare:package": "pnpm clean; pnpm build; pnpm save:deployments"
"deploy:sepolia": "corepack pnpm run deploy --verify --network sepolia --parameters ignition/parameters/sepolia.json5",
"deploy:localhost": "corepack pnpm run deploy --network localhost --parameters ignition/parameters/sepolia.json5",
"prepare:package": "corepack pnpm clean; corepack pnpm build; corepack pnpm save:deployments"
},
"engines": {
"node": ">=20",
Expand Down
15 changes: 6 additions & 9 deletions scripts/build-deployment-address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,31 @@ async function main() {

// Filter for directories matching "chain-<chain number>"
const validChains = files
.filter((file) => /^chain-\d+$/.test(file)) // Matches "chain-<number>"
.map((file) => file.split('-')[1]) // Extract the chain number
.filter((chain) => !EXCLUDE_CHAINS.includes(chain)); // Exclude chains
.filter((file) => /^chain-\d+$/.test(file)) // Matches "chain-<number>"
.map((file) => file.split('-')[1]) // Extract the chain number
.filter((chain) => !EXCLUDE_CHAINS.includes(chain)); // Exclude chains

const outputJson: { [key: string]: Object } = {};

for (const chain of validChains) {
const deployedAddressesPath = path.join(
deploymentsDir,
`chain-${chain}`,
'deployed_addresses.json'
deploymentsDir,
`chain-${chain}`,
'deployed_addresses.json',
);

try {
// Read and include deployed addresses
outputJson[chain] = await readJson(deployedAddressesPath);
} catch (error) {
console.warn(`Skipping chain-${chain}: Failed to read deployed_addresses.json.`);
}
}

// Write the JSON output
await writeJson('deployments.json', outputJson, { spaces: 2 });
console.log(`Created`);
} catch (error) {
console.error('An error occurred:', error);
}
}

// Execute the script
main();

0 comments on commit 3393174

Please sign in to comment.