Skip to content

Commit 7888b62

Browse files
kerguometalboyrickgithub-actions[bot]
authored
fix: format log.ts with prettier, fix: yarn deploy fails in the latest version v1.1.2 (#660)
Co-authored-by: Richard (Rick) <53423618+metalboyrick@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 607151b commit 7888b62

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

.github/workflows/sync-bulletproof-contracts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ jobs:
6161
- name: Merge develop into v3-bulletproof-contracts
6262
run: |
6363
git merge origin/develop --no-edit || echo "No changes to merge"
64-
git push origin v3-bulletproof-contracts
64+
git push origin v3-bulletproof-contracts

packages/snfoundry/deployments/clear.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (args.some((x) => !x.includes("help")) || args.length === 0) {
1515
if (args.length === 0) mf = f.filter((x) => k.some((w) => x.startsWith(w)));
1616
else
1717
mf = f.filter((x) =>
18-
x.startsWith(match ? args[0].substring(2) : args[1])
18+
x.startsWith(match ? args[0].substring(2) : args[1]),
1919
);
2020

2121
for (let i = 0; i < mf.length; i++) {

packages/snfoundry/scripts-ts/helpers/colorize-log.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const colors = {
33
red: "\x1b[31m",
44
green: "\x1b[32m",
55
yellow: "\x1b[33m",
6+
blue: "\x1b[34m",
7+
cyan: "\x1b[36m",
68
};
79

810
const colorize = (color: string, message: string): string => {
@@ -14,3 +16,5 @@ export const green = (message: string): string =>
1416
colorize(colors.green, message);
1517
export const yellow = (message: string): string =>
1618
colorize(colors.yellow, message);
19+
export const blue = (message: string): string => colorize(colors.blue, message);
20+
export const cyan = (message: string): string => colorize(colors.cyan, message);

packages/snfoundry/scripts-ts/helpers/log.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import chalk from "chalk";
2-
import { Account, Contract, RpcProvider, shortString } from "starknet";
1+
import { Account, Contract, RpcProvider } from "starknet";
2+
import { blue, cyan, green, red, yellow } from "./colorize-log";
33

44
const createHyperlink = (url: string, text?: string) => {
55
const displayText = text || url;
@@ -21,18 +21,18 @@ export const logDeploymentSummary = ({
2121
} else if (network === "mainnet") {
2222
baseUrl = `https://starkscan.co`;
2323
} else {
24-
console.error(chalk.red(`Unsupported network: ${network}`));
24+
console.error(red(`Unsupported network: ${network}`));
2525
return;
2626
}
2727

28-
console.log(chalk.green("\n📦 Deployment Summary\n"));
29-
console.log(`${chalk.blue("🌐 Network:")} ${chalk.white(network)}\n`);
30-
console.log(chalk.cyan("🔗 Transaction:"));
28+
console.log(green("\n📦 Deployment Summary\n"));
29+
console.log(`${blue("🌐 Network:")} ${network}\n`);
30+
console.log(cyan("🔗 Transaction:"));
3131
const txUrl = `${baseUrl}/tx/${transactionHash}`;
3232
console.log(createHyperlink(txUrl) + "\n");
3333

3434
for (const [name, { address }] of Object.entries(deployments)) {
35-
console.log(chalk.yellow(`📄 ${name} Contract:`));
35+
console.log(yellow(`📄 ${name} Contract:`));
3636
const contractUrl = `${baseUrl}/contract/${address}`;
3737
console.log(createHyperlink(contractUrl) + "\n");
3838
}
@@ -52,14 +52,12 @@ export const postDeploymentBalanceSummary = async ({
5252
address: string;
5353
}[];
5454
}) => {
55-
console.log(chalk.blue("💰 Deployer Balance Summary:"));
55+
console.log(blue("💰 Deployer Balance Summary:"));
5656
console.log(`Deployer-Address: ${deployer.address}`);
5757

5858
if (!feeToken || feeToken.length === 0) {
5959
console.log(
60-
chalk.red(
61-
"Error: No fee token information provided. Cannot fetch balance."
62-
)
60+
red("Error: No fee token information provided. Cannot fetch balance.")
6361
);
6462
return;
6563
}
@@ -92,7 +90,7 @@ export const postDeploymentBalanceSummary = async ({
9290
}
9391
} catch (e) {
9492
console.warn(
95-
chalk.yellow(
93+
yellow(
9694
`Could not fetch decimals for ${tokenInfo.name}. Assuming 18 decimals.`
9795
)
9896
);
@@ -109,11 +107,11 @@ export const postDeploymentBalanceSummary = async ({
109107
);
110108
} catch (error) {
111109
console.error(
112-
chalk.red(`Error fetching deployer balance for ${tokenInfo.name}:`),
110+
red(`Error fetching deployer balance for ${tokenInfo.name}:`),
113111
error
114112
);
115113
if (error instanceof Error) {
116-
console.error(chalk.red("Error message:"), error.message);
114+
console.error(red("Error message:"), error.message);
117115
}
118116
}
119117
};

packages/snfoundry/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"*": ["node_modules/*", "src/types/*"]
1111
}
1212
},
13-
"include": ["scripts-ts/**/*.ts"],
13+
"include": ["scripts-ts/**/*.ts"]
1414
}

0 commit comments

Comments
 (0)