git.delta.rocks / unique-network / refs/commits / d47d7f05f33d

difftreelog

resolve paths

Max Andreev2023-06-09parent: #60e186a.patch.diff
in: master

2 files changed

deletedtests/src/migrations/942057-appPromotion/collect-data.shdiffbeforeafterboth

no content

modifiedtests/src/migrations/942057-appPromotion/collectData.tsdiffbeforeafterboth
--- a/tests/src/migrations/942057-appPromotion/collectData.ts
+++ b/tests/src/migrations/942057-appPromotion/collectData.ts
@@ -1,3 +1,15 @@
-import {spawnSync} from 'child_process';
+import {execSync} from 'child_process';
+import path from 'path';
+import {dirname} from 'path';
+import {fileURLToPath} from 'url';
+
+export const collectData = () => {
+  const dirName = dirname(fileURLToPath(import.meta.url));
+
+  const pathToScript = path.resolve(dirName, './stakersParser.jsonnet');
+  const outputPath = path.resolve(dirName, './output.json');
+  // execSync(`chainql --tla-str=chainUrl=wss://ws-quartz.unique.network:443 ${pathToScript} > ${outputPath}`);
+  execSync(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`);
+};
 
-export const collectData = () => spawnSync('sh', ['./collect-data.sh']);
+collectData();