Skip to content

Commit 6aa13e2

Browse files
committed
chore(deps-dev): bump @vitejs/plugin-react from 5.1.4 to 6.0.3 in /apps/web
- Updated @vitejs/plugin-react from 5.1.4 to 6.0.3 - Regenerated pnpm-lock.yaml to resolve merge conflicts
2 parents 13185e4 + 02aefe1 commit 6aa13e2

15 files changed

Lines changed: 1735 additions & 1610 deletions

.github/workflows/subgraph.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Subgraph
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/subgraph.yml'
7+
- 'apps/subgraph/**'
8+
- 'biome.json'
9+
- 'package.json'
10+
- 'pnpm-lock.yaml'
11+
- 'pnpm-workspace.yaml'
12+
13+
jobs:
14+
test-and-build:
15+
name: Codegen, test, build
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
with:
23+
persist-credentials: false
24+
25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@v6
27+
with:
28+
version: 9.15.2
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v6
32+
with:
33+
node-version: 'lts/*'
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Run tests
39+
run: pnpm --filter @dealbot/subgraph test
40+
41+
- name: Build calibration
42+
run: pnpm --filter @dealbot/subgraph run build:calibration
43+
44+
- name: Build mainnet
45+
run: pnpm --filter @dealbot/subgraph run build:mainnet

apps/backend/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
"dependencies": {
3232
"@clickhouse/client": "^1.11.0",
3333
"@filoz/synapse-core": "0.7.0",
34-
"@filoz/synapse-sdk": "1.0.1",
35-
"@ipld/car": "^5.4.2",
36-
"@ipld/dag-pb": "^4.1.4",
34+
"@filoz/synapse-sdk": "1.1.0",
35+
"@ipld/car": "^5.4.6",
36+
"@ipld/dag-pb": "^4.1.7",
3737
"@nestjs/axios": "^4.0.1",
3838
"@nestjs/common": "^11.1.13",
3939
"@nestjs/config": "^4.0.3",
@@ -50,10 +50,10 @@
5050
"class-validator": "^0.14.3",
5151
"cors": "^2.8.6",
5252
"cron": "4.4.0",
53-
"filecoin-pin": "^1.0.1",
53+
"filecoin-pin": "^1.2.0",
5454
"helmet": "^8.1.0",
5555
"joi": "^18.0.2",
56-
"multiformats": "^13.4.2",
56+
"multiformats": "^14.0.1",
5757
"nestjs-pino": "^4.6.1",
5858
"pg": "^8.18.0",
5959
"pg-boss": "^12.9.0",

apps/subgraph/biome.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"root": false,
3+
"$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
4+
"extends": "//",
5+
"overrides": [
6+
{
7+
"includes": ["**/*.spec.ts", "**/*.test.ts", "tests/**/*.ts"],
8+
"linter": {
9+
"rules": {
10+
"suspicious": {
11+
"noExplicitAny": "off"
12+
}
13+
}
14+
}
15+
},
16+
{
17+
"includes": ["src/**", "tests/**"],
18+
"linter": {
19+
"rules": {
20+
"style": {
21+
"useImportType": "off"
22+
},
23+
"suspicious": {
24+
"noShadowRestrictedNames": "off",
25+
"noDoubleEquals": "off"
26+
},
27+
"complexity": {
28+
"noStaticOnlyClass": "off"
29+
}
30+
}
31+
}
32+
}
33+
]
34+
}

apps/subgraph/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,22 @@
1010
"build:calibration": "pnpm run codegen && graph build --network filecoin-testnet",
1111
"deploy:mainnet": "goldsky subgraph deploy dealbot-mainnet/$VERSION --path ./build",
1212
"deploy:calibration": "goldsky subgraph deploy dealbot-calibration/$VERSION --path ./build",
13-
"test": "graph test && node --test scripts/check-networks.test.mjs"
13+
"pretest": "pnpm run codegen",
14+
"test": "graph test && node --test scripts/check-networks.test.mjs",
15+
"format": "biome format --write .",
16+
"format:check": "biome format .",
17+
"lint": "biome lint --write .",
18+
"lint:check": "biome lint .",
19+
"check": "biome check --write .",
20+
"check:ci": "biome ci ."
1421
},
1522
"dependencies": {
1623
"@filoz/synapse-core": "0.3.3",
1724
"@graphprotocol/graph-cli": "0.98.1",
1825
"@graphprotocol/graph-ts": "0.38.2"
1926
},
2027
"devDependencies": {
28+
"@biomejs/biome": "catalog:",
2129
"assemblyscript": "0.19.23",
2230
"matchstick-as": "0.6.0"
2331
}

apps/subgraph/scripts/check-networks.test.mjs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// FilOzone/filecoin-services). Bumping synapse-core is the trigger for any
44
// address change; this test fails fast if networks.json drifts.
55

6+
import assert from "node:assert/strict";
67
import { readFile } from "node:fs/promises";
78
import { dirname, join } from "node:path";
8-
import { fileURLToPath } from "node:url";
99
import { test } from "node:test";
10-
import assert from "node:assert/strict";
10+
import { fileURLToPath } from "node:url";
1111
import { generated } from "@filoz/synapse-core/abis";
1212

1313
const { filecoinWarmStorageServiceAddress, pdpVerifierAddress } = generated;
@@ -17,20 +17,24 @@ const networksPath = join(here, "..", "networks.json");
1717
const networks = JSON.parse(await readFile(networksPath, "utf8"));
1818

1919
const cases = {
20-
"filecoin": 314,
20+
filecoin: 314,
2121
"filecoin-testnet": 314159,
2222
};
2323

2424
for (const [network, chainId] of Object.entries(cases)) {
2525
test(`${network} PDPVerifier address matches synapse-core[${chainId}]`, () => {
2626
const actual = networks[network]?.PDPVerifier?.address;
2727
const expected = pdpVerifierAddress[chainId];
28-
assert.equal(actual, expected, `expected ${expected}, got ${actual} for ${network}.PDPVerifier.address`)
28+
assert.equal(actual, expected, `expected ${expected}, got ${actual} for ${network}.PDPVerifier.address`);
2929
});
3030

3131
test(`${network} FilecoinWarmStorageService address matches synapse-core[${chainId}]`, () => {
3232
const actual = networks[network]?.FilecoinWarmStorageService?.address;
3333
const expected = filecoinWarmStorageServiceAddress[chainId];
34-
assert.equal(actual, expected, `expected ${expected}, got ${actual} for ${network}.FilecoinWarmStorageService.address`);
34+
assert.equal(
35+
actual,
36+
expected,
37+
`expected ${expected}, got ${actual} for ${network}.FilecoinWarmStorageService.address`,
38+
);
3539
});
36-
}
40+
}

apps/subgraph/scripts/sync-abis.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// truth; bumping the synapse-core version is all that's needed to pick up
66
// ABI changes.
77

8-
import { writeFile, mkdir } from "node:fs/promises";
8+
import { mkdir, writeFile } from "node:fs/promises";
99
import { dirname, join } from "node:path";
1010
import { fileURLToPath } from "node:url";
1111
import { fwss, pdp } from "@filoz/synapse-core/abis";

apps/subgraph/src/fwss.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ export function handleFwssPdpPaymentTerminated(event: PDPPaymentTerminatedEvent)
8080
export function handleFwssDataSetServiceProviderChanged(event: DataSetServiceProviderChangedEvent): void {
8181
const ds = DataSet.load(getProofSetEntityId(event.params.dataSetId));
8282
if (ds == null) {
83-
log.warning("FWSS DataSetServiceProviderChanged for unknown dataSet {}", [
84-
event.params.dataSetId.toString(),
85-
]);
83+
log.warning("FWSS DataSetServiceProviderChanged for unknown dataSet {}", [event.params.dataSetId.toString()]);
8684
return;
8785
}
8886

apps/subgraph/src/helpers.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function getProofSetEntityId(setId: BigInt): Bytes {
77
}
88

99
export function getRootEntityId(setId: BigInt, rootId: BigInt): Bytes {
10-
return Bytes.fromUTF8(setId.toString() + "-" + rootId.toString());
10+
return Bytes.fromUTF8(`${setId.toString()}-${rootId.toString()}`);
1111
}
1212

1313
// Uniform pseudorandom sort key for Root entities. Used by dealbot to draw
@@ -77,7 +77,7 @@ export class UvarintResult {
7777
}
7878

7979
export function readUvarint(data: Bytes, offset: BigInt): UvarintResult {
80-
let offsetU32 = offset.toU32();
80+
const offsetU32 = offset.toU32();
8181

8282
if (offsetU32 >= u32(data.length)) {
8383
return new UvarintResult(false);
@@ -97,7 +97,7 @@ export function readUvarint(data: Bytes, offset: BigInt): UvarintResult {
9797
return new UvarintResult(false);
9898
}
9999

100-
let nextByte = u64(data[offsetU32 + i] & 0x7f);
100+
const nextByte = u64(data[offsetU32 + i] & 0x7f);
101101
value = value | (nextByte << (i * 7));
102102
}
103103

@@ -122,12 +122,12 @@ export function validateCommPv2(cidData: Bytes): CommPv2ValidationResult {
122122
return new CommPv2ValidationResult(false);
123123
}
124124

125-
let mhLengthResult = readUvarint(cidData, offset);
125+
const mhLengthResult = readUvarint(cidData, offset);
126126
if (!mhLengthResult.isValid) {
127127
return new CommPv2ValidationResult(false);
128128
}
129129

130-
let mhLength = mhLengthResult.value;
130+
const mhLength = mhLengthResult.value;
131131
offset = mhLengthResult.offset;
132132

133133
if (mhLength.lt(BigInt.fromU32(34))) {
@@ -142,19 +142,19 @@ export function validateCommPv2(cidData: Bytes): CommPv2ValidationResult {
142142
return new CommPv2ValidationResult(false);
143143
}
144144

145-
let paddingResult = readUvarint(cidData, offset);
145+
const paddingResult = readUvarint(cidData, offset);
146146
if (!paddingResult.isValid) {
147147
return new CommPv2ValidationResult(false);
148148
}
149149

150-
let padding = paddingResult.value;
150+
const padding = paddingResult.value;
151151
offset = paddingResult.offset;
152152

153153
if (offset.toU32() >= u32(cidData.length)) {
154154
return new CommPv2ValidationResult(false);
155155
}
156156

157-
let height = cidData[offset.toU32()];
157+
const height = cidData[offset.toU32()];
158158
offset = offset.plus(BigInt.fromU32(1));
159159

160160
return new CommPv2ValidationResult(true, padding, height, offset);

apps/subgraph/src/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export class DataSetStatus {
2-
static readonly EMPTY: string = "EMPTY";
3-
static readonly READY: string = "READY";
4-
static readonly PROVING: string = "PROVING";
5-
static readonly DELETED: string = "DELETED";
1+
export namespace DataSetStatus {
2+
export const EMPTY: string = "EMPTY";
3+
export const READY: string = "READY";
4+
export const PROVING: string = "PROVING";
5+
export const DELETED: string = "DELETED";
66
}

apps/subgraph/tests/dataset-status.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { afterEach, assert, clearStore, describe, test } from "matchstick-as/assembly/index";
21
import { Address, BigInt, Bytes } from "@graphprotocol/graph-ts";
2+
import { afterEach, assert, clearStore, describe, test } from "matchstick-as/assembly/index";
33
import {
44
handleDataSetCreated,
55
handleDataSetDeleted,

0 commit comments

Comments
 (0)