Skip to content

Commit b5bec16

Browse files
committed
chore: biome format
1 parent 70021d7 commit b5bec16

File tree

522 files changed

+20632
-20603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

522 files changed

+20632
-20603
lines changed

.lintstagedrc.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default {
2-
"**/*.(js|jsx|ts|tsx|md|mdx|json|html|css)": ["biome check --apply"],
2+
"**/*.(js|jsx|ts|tsx|md|mdx|json|html|css)": ["biome check --apply"],
33
};

biome.json

+69-50
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,71 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
3-
"organizeImports": {
4-
"enabled": true
5-
},
6-
"linter": {
7-
"enabled": true,
8-
"rules": {
9-
"recommended": true,
10-
"style": {
11-
"noNonNullAssertion": "off"
12-
},
13-
"suspicious": {
14-
"noExplicitAny": "warn"
15-
},
16-
"correctness": {
17-
"useExhaustiveDependencies": "off"
18-
},
19-
"complexity": {
20-
"noStaticOnlyClass": "off",
21-
"noForEach": "warn"
22-
}
23-
}
24-
},
25-
"vcs": {
26-
"enabled": true,
27-
"clientKind": "git",
28-
"useIgnoreFile": true
29-
},
30-
"files": {
31-
"ignore": [
32-
"**/node_modules",
33-
"**/.turbo",
34-
"**/.next",
35-
"**/.vercel",
36-
"**/dist",
37-
"**/build",
38-
"**/fuel-v2-contracts",
39-
"**/coverage",
40-
"**/generated",
41-
"**/storybook-static",
42-
"*.typegen.ts",
43-
"./packages/app-explorer/public/storybook",
44-
"./packages/app-explorer/public/ui",
45-
"./packages/app-explorer/public/portal",
46-
"./packages/app-explorer/public/portal-storybook",
47-
"./packages/app-portal/public/**",
48-
"./packages/app-portal/src/types",
49-
"pnpm-lock.yaml"
50-
]
51-
}
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"formatter": {
7+
"enabled": true,
8+
"formatWithErrors": true,
9+
"indentStyle": "space",
10+
"indentWidth": 2,
11+
"lineWidth": 80
12+
},
13+
"linter": {
14+
"enabled": true,
15+
"rules": {
16+
"recommended": true,
17+
"style": {
18+
"noNonNullAssertion": "off"
19+
},
20+
"suspicious": {
21+
"noExplicitAny": "warn",
22+
"noImplicitAnyLet": "warn",
23+
"noArrayIndexKey": "off",
24+
"noConfusingVoidType": "off",
25+
"noSelfCompare": "off"
26+
},
27+
"correctness": {
28+
"useExhaustiveDependencies": "off"
29+
},
30+
"complexity": {
31+
"noStaticOnlyClass": "off",
32+
"noForEach": "warn",
33+
"noBannedTypes": "off"
34+
},
35+
"performance": {
36+
"noAccumulatingSpread": "off"
37+
},
38+
"a11y": {
39+
"noSvgWithoutTitle": "off"
40+
}
41+
}
42+
},
43+
"vcs": {
44+
"enabled": true,
45+
"clientKind": "git",
46+
"useIgnoreFile": true
47+
},
48+
"files": {
49+
"ignore": [
50+
"**/node_modules",
51+
"**/.turbo",
52+
"**/.next",
53+
"**/.vercel",
54+
"**/dist",
55+
"**/build",
56+
"**/fuel-v2-contracts",
57+
"**/coverage",
58+
"**/generated",
59+
"**/storybook-static",
60+
"*.typegen.ts",
61+
"./packages/app-explorer/public/storybook",
62+
"./packages/app-explorer/public/ui",
63+
"./packages/app-explorer/public/portal",
64+
"./packages/app-explorer/public/portal-storybook",
65+
"./packages/app-portal/public/**",
66+
"./packages/app-portal/src/types",
67+
"pnpm-lock.yaml",
68+
"**/**/*.json"
69+
]
70+
}
5271
}

contracts/predicate/scripts/run-predicate.ts

+43-43
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,52 @@ const BIN_PATH = resolve(__dirname, "../out/debug/predicate-app.bin");
77
const AMOUNT = 300_000;
88

99
if (!FUEL_PROVIDER || !PRIVATE_KEY) {
10-
throw new Error(
11-
"Missing some config in .env file. Should have FUEL_PROVIDER and PRIVATE_KEY",
12-
);
10+
throw new Error(
11+
"Missing some config in .env file. Should have FUEL_PROVIDER and PRIVATE_KEY",
12+
);
1313
}
1414

1515
async function main() {
16-
const binHex = hexlify(await fs.readFile(BIN_PATH));
17-
const provider = await Provider.create(FUEL_PROVIDER!);
18-
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY!, provider);
19-
const { minGasPrice: gasPrice } = wallet.provider.getGasConfig();
20-
const walletAddress = wallet.address.toB256();
21-
const abiPath = resolve(__dirname, "../out/debug/predicate-app-abi.json");
22-
const abi = await fs.readFile(abiPath, "utf-8");
23-
const abiJson = JSON.parse(abi);
24-
const predicate = new Predicate(binHex, provider, abiJson);
25-
26-
console.log("💰 Funding predicate...");
27-
const tx1 = await wallet.transfer(predicate.address, AMOUNT, BaseAssetId, {
28-
gasPrice,
29-
});
30-
31-
const res1 = await tx1.waitForResult();
32-
const predicateBalance = bn(await predicate.getBalance());
33-
console.log(`→ Transaction Id: ${res1.id}`);
34-
console.log(`→ Predicate balance: ${predicateBalance.format()}`);
35-
console.log(`→ Predicate Id: ${predicate.address.toB256()}`);
36-
console.log(`📝 Wallet address: ${walletAddress}\n`);
37-
38-
console.log("⌛️ Running predicate...");
39-
predicate.setData(walletAddress);
40-
41-
try {
42-
const tx2 = await predicate.transfer(
43-
wallet.address,
44-
AMOUNT - 150_000,
45-
BaseAssetId,
46-
{
47-
gasPrice,
48-
},
49-
);
50-
const res2 = await tx2.waitForResult();
51-
console.log(`→ Transaction Id: ${res2.id}`);
52-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
53-
} catch (error: any) {
54-
console.error(error?.response?.errors?.[0].message);
55-
}
16+
const binHex = hexlify(await fs.readFile(BIN_PATH));
17+
const provider = await Provider.create(FUEL_PROVIDER!);
18+
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY!, provider);
19+
const { minGasPrice: gasPrice } = wallet.provider.getGasConfig();
20+
const walletAddress = wallet.address.toB256();
21+
const abiPath = resolve(__dirname, "../out/debug/predicate-app-abi.json");
22+
const abi = await fs.readFile(abiPath, "utf-8");
23+
const abiJson = JSON.parse(abi);
24+
const predicate = new Predicate(binHex, provider, abiJson);
25+
26+
console.log("💰 Funding predicate...");
27+
const tx1 = await wallet.transfer(predicate.address, AMOUNT, BaseAssetId, {
28+
gasPrice,
29+
});
30+
31+
const res1 = await tx1.waitForResult();
32+
const predicateBalance = bn(await predicate.getBalance());
33+
console.log(`→ Transaction Id: ${res1.id}`);
34+
console.log(`→ Predicate balance: ${predicateBalance.format()}`);
35+
console.log(`→ Predicate Id: ${predicate.address.toB256()}`);
36+
console.log(`📝 Wallet address: ${walletAddress}\n`);
37+
38+
console.log("⌛️ Running predicate...");
39+
predicate.setData(walletAddress);
40+
41+
try {
42+
const tx2 = await predicate.transfer(
43+
wallet.address,
44+
AMOUNT - 150_000,
45+
BaseAssetId,
46+
{
47+
gasPrice,
48+
},
49+
);
50+
const res2 = await tx2.waitForResult();
51+
console.log(`→ Transaction Id: ${res2.id}`);
52+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
53+
} catch (error: any) {
54+
console.error(error?.response?.errors?.[0].message);
55+
}
5656
}
5757

5858
main();

contracts/predicate/vitest.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vitest/config";
22

33
export default defineConfig({
4-
test: {
5-
include: ["./tests/**.ts"],
6-
},
4+
test: {
5+
include: ["./tests/**.ts"],
6+
},
77
});
+57-57
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
11
import { createServer } from "http";
22
import {
3-
getOrDeployECR20Contract,
4-
getOrDeployFuelTokenContract,
5-
getTokenId,
6-
setupEnvironment,
3+
getOrDeployECR20Contract,
4+
getOrDeployFuelTokenContract,
5+
getTokenId,
6+
setupEnvironment,
77
} from "@fuel-bridge/test-utils";
88

99
const {
10-
PORT,
11-
L1_CHAIN_HTTP,
12-
DEPLOYMENTS_HTTP,
13-
FUEL_GRAPHQL_ENDPOINT,
14-
PK_ETH_WALLET,
10+
PORT,
11+
L1_CHAIN_HTTP,
12+
DEPLOYMENTS_HTTP,
13+
FUEL_GRAPHQL_ENDPOINT,
14+
PK_ETH_WALLET,
1515
} = process.env;
1616
const APP_PORT = PORT || 9090;
1717

1818
async function main() {
19-
const env = await setupEnvironment({
20-
http_ethereum_client: L1_CHAIN_HTTP,
21-
http_fuel_client: FUEL_GRAPHQL_ENDPOINT,
22-
http_deployer: DEPLOYMENTS_HTTP,
23-
pk_eth_signer2: PK_ETH_WALLET,
24-
pk_eth_deployer: PK_ETH_WALLET,
25-
});
26-
const ETHToken = await getOrDeployECR20Contract(env);
27-
const FuelToken = await getOrDeployFuelTokenContract(
28-
env,
29-
ETHToken,
30-
env.eth.fuelERC20Gateway,
31-
{
32-
gasPrice: 1,
33-
gasLimit: 1_000_000,
34-
},
35-
9,
36-
);
37-
const tokenId = getTokenId(FuelToken);
38-
await startServer({
39-
ETH_ERC20: ETHToken.address,
40-
FUEL_TokenContract: FuelToken.id.toB256(),
41-
FUEL_TokenAsset: tokenId,
42-
});
19+
const env = await setupEnvironment({
20+
http_ethereum_client: L1_CHAIN_HTTP,
21+
http_fuel_client: FUEL_GRAPHQL_ENDPOINT,
22+
http_deployer: DEPLOYMENTS_HTTP,
23+
pk_eth_signer2: PK_ETH_WALLET,
24+
pk_eth_deployer: PK_ETH_WALLET,
25+
});
26+
const ETHToken = await getOrDeployECR20Contract(env);
27+
const FuelToken = await getOrDeployFuelTokenContract(
28+
env,
29+
ETHToken,
30+
env.eth.fuelERC20Gateway,
31+
{
32+
gasPrice: 1,
33+
gasLimit: 1_000_000,
34+
},
35+
9,
36+
);
37+
const tokenId = getTokenId(FuelToken);
38+
await startServer({
39+
ETH_ERC20: ETHToken.address,
40+
FUEL_TokenContract: FuelToken.id.toB256(),
41+
FUEL_TokenAsset: tokenId,
42+
});
4343
}
4444

4545
function startServer(deployments: Record<string, string>) {
46-
return new Promise((resolve) => {
47-
createServer((req, res) => {
48-
switch (req.url) {
49-
case "/health":
50-
res.writeHead(200, { "Content-Type": "text/plain" });
51-
res.end("OK");
52-
break;
53-
case "/deployments":
54-
res.writeHead(200, { "Content-Type": "application/json" });
55-
res.end(JSON.stringify(deployments));
56-
break;
57-
default:
58-
res.writeHead(404, "Not Found");
59-
res.end();
60-
}
61-
}).listen(Number(APP_PORT), 511, () => resolve(true));
62-
});
46+
return new Promise((resolve) => {
47+
createServer((req, res) => {
48+
switch (req.url) {
49+
case "/health":
50+
res.writeHead(200, { "Content-Type": "text/plain" });
51+
res.end("OK");
52+
break;
53+
case "/deployments":
54+
res.writeHead(200, { "Content-Type": "application/json" });
55+
res.end(JSON.stringify(deployments));
56+
break;
57+
default:
58+
res.writeHead(404, "Not Found");
59+
res.end();
60+
}
61+
}).listen(Number(APP_PORT), 511, () => resolve(true));
62+
});
6363
}
6464

6565
main()
66-
.then(() => {
67-
console.log(`Server listening on port ${APP_PORT}`);
68-
})
69-
.catch((err) => {
70-
console.error(err);
71-
process.exit(1);
72-
});
66+
.then(() => {
67+
console.log(`Server listening on port ${APP_PORT}`);
68+
})
69+
.catch((err) => {
70+
console.error(err);
71+
process.exit(1);
72+
});

0 commit comments

Comments
 (0)