From b497da5c8eb5f6f50a79179ae13598836f4adb3e Mon Sep 17 00:00:00 2001 From: Satyajeet Kolhapure Date: Fri, 15 Nov 2024 11:30:22 +0000 Subject: [PATCH] fixed review comment --- sdk/doc/cli-examples.md | 2 +- sdk/examples/portal/portalExamples.ts | 4 ++++ sdk/examples/utils/countUniqueSubjects.ts | 2 +- sdk/examples/utils/getAllAttestations.ts | 2 +- sdk/examples/utils/getAttestationIdCounter.ts | 5 ----- sdk/examples/utils/getModulesNumber.ts | 5 ----- sdk/examples/utils/getPortalsCount.ts | 5 ----- sdk/examples/utils/getSchemasNumber.ts | 5 ----- subgraph/abis/ModuleRegistry.json | 13 ------------- subgraph/abis/PortalRegistry.json | 13 ------------- subgraph/abis/SchemaRegistry.json | 13 ------------- 11 files changed, 7 insertions(+), 62 deletions(-) delete mode 100644 sdk/examples/utils/getAttestationIdCounter.ts delete mode 100644 sdk/examples/utils/getModulesNumber.ts delete mode 100644 sdk/examples/utils/getPortalsCount.ts delete mode 100644 sdk/examples/utils/getSchemasNumber.ts diff --git a/sdk/doc/cli-examples.md b/sdk/doc/cli-examples.md index f89d5d6f..1da7d54f 100644 --- a/sdk/doc/cli-examples.md +++ b/sdk/doc/cli-examples.md @@ -43,7 +43,7 @@ pnpm portal isPortalRegistered '{\"portalAddress\":\"0x8b833796869b5debb9b06370d6d47016f0d7973b\"}' - pnpm portal getPortalsCount + pnpm portal getPortalsNumber ``` diff --git a/sdk/examples/portal/portalExamples.ts b/sdk/examples/portal/portalExamples.ts index 7653ca6b..3475a626 100644 --- a/sdk/examples/portal/portalExamples.ts +++ b/sdk/examples/portal/portalExamples.ts @@ -399,6 +399,10 @@ export default class PortalExamples { console.log(await this.veraxSdk.portal.getPortalByAddress(portalAddress)); } + if (methodName.toLowerCase() == "getPortalsNumber".toLowerCase() || methodName == "") { + console.log(await this.veraxSdk.portal.getPortalsNumber()); + } + if (methodName.toLowerCase() == "isPortalRegistered".toLowerCase() || methodName == "") { let params; if (argv !== "") params = JSON.parse(argv); diff --git a/sdk/examples/utils/countUniqueSubjects.ts b/sdk/examples/utils/countUniqueSubjects.ts index 1ccfaba3..9888384a 100644 --- a/sdk/examples/utils/countUniqueSubjects.ts +++ b/sdk/examples/utils/countUniqueSubjects.ts @@ -11,7 +11,7 @@ const fetchSubjectsFromFile = async (fileSuffix: number): Promise => { async function main() { const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_MAINNET); - const attestationNumber = await veraxSdk.utils.getAttestationIdCounter(); + const attestationNumber = await veraxSdk.attestation.getAttestationIdCounter(); const filesNumber = Math.ceil(Number(attestationNumber) / BATCH_SIZE); const allSubjects: string[][] = []; diff --git a/sdk/examples/utils/getAllAttestations.ts b/sdk/examples/utils/getAllAttestations.ts index 42871c1d..b686fa83 100644 --- a/sdk/examples/utils/getAllAttestations.ts +++ b/sdk/examples/utils/getAllAttestations.ts @@ -29,7 +29,7 @@ const fetchAllAttestations = async (batchNumber: number, veraxSdk: VeraxSdk) => async function main() { const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_MAINNET); - const attestationNumber = await veraxSdk.utils.getAttestationIdCounter(); + const attestationNumber = await veraxSdk.attestation.getAttestationIdCounter(); const batchesNumber = Math.ceil(Number(attestationNumber) / BATCH_SIZE); console.log(`Creating ${batchesNumber} batches of ${BATCH_SIZE} items to get all ${attestationNumber} attestations.`); diff --git a/sdk/examples/utils/getAttestationIdCounter.ts b/sdk/examples/utils/getAttestationIdCounter.ts deleted file mode 100644 index 78f6752d..00000000 --- a/sdk/examples/utils/getAttestationIdCounter.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VeraxSdk } from "../../src/VeraxSdk"; - -const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_SEPOLIA); - -veraxSdk.utils.getAttestationIdCounter().then((res) => console.log(res)); diff --git a/sdk/examples/utils/getModulesNumber.ts b/sdk/examples/utils/getModulesNumber.ts deleted file mode 100644 index 747896a8..00000000 --- a/sdk/examples/utils/getModulesNumber.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VeraxSdk } from "../../src/VeraxSdk"; - -const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_SEPOLIA); - -veraxSdk.utils.getModulesNumber().then((res) => console.log(res)); diff --git a/sdk/examples/utils/getPortalsCount.ts b/sdk/examples/utils/getPortalsCount.ts deleted file mode 100644 index 88f09904..00000000 --- a/sdk/examples/utils/getPortalsCount.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VeraxSdk } from "../../src/VeraxSdk"; - -const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_SEPOLIA); - -veraxSdk.utils.getPortalsCount().then((res) => console.log(res)); diff --git a/sdk/examples/utils/getSchemasNumber.ts b/sdk/examples/utils/getSchemasNumber.ts deleted file mode 100644 index 12dd6ac2..00000000 --- a/sdk/examples/utils/getSchemasNumber.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { VeraxSdk } from "../../src/VeraxSdk"; - -const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_SEPOLIA); - -veraxSdk.utils.getSchemasNumber().then((res) => console.log(res)); diff --git a/subgraph/abis/ModuleRegistry.json b/subgraph/abis/ModuleRegistry.json index eec4a015..09d4f7d9 100644 --- a/subgraph/abis/ModuleRegistry.json +++ b/subgraph/abis/ModuleRegistry.json @@ -151,19 +151,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "getModulesNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "initialize", diff --git a/subgraph/abis/PortalRegistry.json b/subgraph/abis/PortalRegistry.json index eca94eda..57765cb4 100644 --- a/subgraph/abis/PortalRegistry.json +++ b/subgraph/abis/PortalRegistry.json @@ -234,19 +234,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "getPortalsCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "initialize", diff --git a/subgraph/abis/SchemaRegistry.json b/subgraph/abis/SchemaRegistry.json index c8806b2f..c70e46fe 100644 --- a/subgraph/abis/SchemaRegistry.json +++ b/subgraph/abis/SchemaRegistry.json @@ -219,19 +219,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "getSchemasNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "initialize",