@sentio/cli 2.18.3 → 2.18.4-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/abi.d.ts +9 -0
- package/lib/abi.d.ts.map +1 -0
- package/lib/abi.js +136 -0
- package/lib/abi.js.map +1 -0
- package/lib/abi.test.d.ts +2 -0
- package/lib/abi.test.d.ts.map +1 -0
- package/lib/abi.test.js.map +1 -0
- package/lib/commands/build.d.ts +28 -0
- package/lib/commands/build.d.ts.map +1 -0
- package/lib/commands/build.js +213 -0
- package/lib/commands/build.js.map +1 -0
- package/lib/commands/login-server.d.ts +8 -0
- package/lib/commands/login-server.d.ts.map +1 -0
- package/lib/commands/login-server.js +110 -0
- package/lib/commands/login-server.js.map +1 -0
- package/lib/commands/run-add.d.ts +2 -0
- package/lib/commands/run-add.d.ts.map +1 -0
- package/lib/commands/run-add.js +100 -0
- package/lib/commands/run-add.js.map +1 -0
- package/lib/commands/run-compile.d.ts +2 -0
- package/lib/commands/run-compile.d.ts.map +1 -0
- package/lib/commands/run-compile.js +199 -0
- package/lib/commands/run-compile.js.map +1 -0
- package/lib/commands/run-create.d.ts +2 -0
- package/lib/commands/run-create.d.ts.map +1 -0
- package/lib/commands/run-create.js +142 -0
- package/lib/commands/run-create.js.map +1 -0
- package/lib/commands/run-graph.d.ts +3 -0
- package/lib/commands/run-graph.d.ts.map +1 -0
- package/lib/commands/run-graph.js +136 -0
- package/lib/commands/run-graph.js.map +1 -0
- package/lib/commands/run-login.d.ts +2 -0
- package/lib/commands/run-login.d.ts.map +1 -0
- package/lib/commands/run-login.js +107 -0
- package/lib/commands/run-login.js.map +1 -0
- package/lib/commands/run-test.d.ts +2 -0
- package/lib/commands/run-test.d.ts.map +1 -0
- package/lib/commands/run-test.js +11 -0
- package/lib/commands/run-test.js.map +1 -0
- package/lib/commands/run-upload.d.ts +14 -0
- package/lib/commands/run-upload.d.ts.map +1 -0
- package/lib/commands/run-upload.js +332 -0
- package/lib/commands/run-upload.js.map +1 -0
- package/lib/commands/run-version.d.ts +2 -0
- package/lib/commands/run-version.d.ts.map +1 -0
- package/lib/commands/run-version.js +38 -0
- package/lib/commands/run-version.js.map +1 -0
- package/lib/config.d.ts +23 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +70 -0
- package/lib/config.js.map +1 -0
- package/lib/execution.d.ts +5 -0
- package/lib/execution.d.ts.map +1 -0
- package/lib/execution.js +31 -0
- package/lib/execution.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +130 -1183
- package/lib/index.js.map +1 -7
- package/lib/key.d.ts +3 -0
- package/lib/key.d.ts.map +1 -0
- package/lib/key.js +36 -0
- package/lib/key.js.map +1 -0
- package/lib/utils.d.ts +4 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +32 -0
- package/lib/utils.js.map +1 -0
- package/package.json +23 -5
- package/src/commands/run-test.ts +2 -4
- package/templates/aptos/src/processor.test.ts +4 -2
- package/templates/aptos/tsconfig.json +1 -1
- package/templates/eth/src/processor.test.ts +6 -4
- package/templates/eth/tsconfig.json +1 -1
- package/templates/fuel/src/processor.test.ts +4 -2
- package/templates/fuel/tsconfig.json +1 -1
- package/templates/raw/src/processor.test.ts +4 -2
- package/templates/raw/tsconfig.json +1 -1
- package/templates/solana/src/processor.test.ts +4 -2
- package/templates/solana/tsconfig.json +1 -1
- package/src/cjs-shim.ts +0 -8
- package/templates/aptos/jest.config.ts +0 -8
- package/templates/eth/jest.config.ts +0 -8
- package/templates/raw/jest.config.ts +0 -8
- package/templates/solana/jest.config.ts +0 -8
package/lib/key.d.ts
ADDED
package/lib/key.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../src/key.ts"],"names":[],"mappings":"AAcA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAcrD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYxD"}
|
package/lib/key.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
const homeDir = os.homedir();
|
|
5
|
+
const sentioDir = path.join(homeDir, '.sentio');
|
|
6
|
+
const configFile = path.join(sentioDir, 'config.json');
|
|
7
|
+
export function WriteKey(host, api_key) {
|
|
8
|
+
const sentioDir = path.join(homeDir, '.sentio');
|
|
9
|
+
if (!fs.existsSync(sentioDir)) {
|
|
10
|
+
fs.mkdirSync(sentioDir, { recursive: true });
|
|
11
|
+
}
|
|
12
|
+
let config = {};
|
|
13
|
+
if (fs.existsSync(configFile)) {
|
|
14
|
+
const content = fs.readFileSync(configFile, 'utf8');
|
|
15
|
+
config = JSON.parse(content);
|
|
16
|
+
}
|
|
17
|
+
const hostConfig = config[host] || { api_keys: {} };
|
|
18
|
+
hostConfig.api_keys = api_key;
|
|
19
|
+
config[host] = hostConfig;
|
|
20
|
+
fs.writeFileSync(configFile, JSON.stringify(config, null, 2));
|
|
21
|
+
}
|
|
22
|
+
export function ReadKey(host) {
|
|
23
|
+
if (!fs.existsSync(sentioDir)) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const configFile = path.join(sentioDir, 'config.json');
|
|
27
|
+
if (fs.existsSync(configFile)) {
|
|
28
|
+
const content = fs.readFileSync(configFile, 'utf8');
|
|
29
|
+
const config = JSON.parse(content);
|
|
30
|
+
return config[host]?.api_keys;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=key.js.map
|
package/lib/key.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.js","sourceRoot":"","sources":["../src/key.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAA;AAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;AAQtD,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,OAAe;IACpD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAC/C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC9C,CAAC;IACD,IAAI,MAAM,GAAoB,EAAE,CAAA;IAChC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;QACnD,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAC9B,CAAC;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;IACnD,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAA;IAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAA;IACzB,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AAC/D,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IACtD,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;IAC/B,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
|
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAQA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED,wBAAgB,aAAa,QAM5B;AAED,wBAAgB,aAAa,QAS5B"}
|
package/lib/utils.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
|
+
import url from 'url';
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const PACKAGE_JSON = 'package.json';
|
|
7
|
+
export function getPackageRoot(pkgId) {
|
|
8
|
+
const m = require.resolve(pkgId);
|
|
9
|
+
let dir = path.dirname(m);
|
|
10
|
+
while (!fs.existsSync(path.join(dir, PACKAGE_JSON))) {
|
|
11
|
+
dir = path.dirname(dir);
|
|
12
|
+
}
|
|
13
|
+
return dir;
|
|
14
|
+
}
|
|
15
|
+
export function getCliVersion() {
|
|
16
|
+
const packageJsonPath = url.fileURLToPath(new URL('../' + PACKAGE_JSON, import.meta.url));
|
|
17
|
+
const packageJsonContent = fs.readFileSync(packageJsonPath, 'utf-8');
|
|
18
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
19
|
+
return packageJson.version;
|
|
20
|
+
}
|
|
21
|
+
export function getSdkVersion() {
|
|
22
|
+
try {
|
|
23
|
+
const packageJsonPath = getPackageRoot('@sentio/sdk');
|
|
24
|
+
const packageJsonContent = fs.readFileSync(path.join(packageJsonPath, PACKAGE_JSON), 'utf-8');
|
|
25
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
26
|
+
return packageJson.version;
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,YAAY,GAAG,cAAc,CAAA;AAEnC,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAEhC,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACzB,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC;QACpD,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACzB,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,eAAe,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,KAAK,GAAG,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACzF,MAAM,kBAAkB,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IACpE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;IAElD,OAAO,WAAW,CAAC,OAAO,CAAA;AAC5B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,cAAc,CAAC,aAAa,CAAC,CAAA;QACrD,MAAM,kBAAkB,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAA;QAC7F,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAClD,OAAO,WAAW,CAAC,OAAO,CAAA;IAC5B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentio/cli",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.4-rc.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -14,7 +14,26 @@
|
|
|
14
14
|
"!{lib,src}/**/*.test.{js,ts}"
|
|
15
15
|
],
|
|
16
16
|
"types": "module",
|
|
17
|
-
"dependencies": {
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@aptos-labs/ts-sdk": "~1.14.0",
|
|
19
|
+
"@mysten/sui.js": "~0.54.1",
|
|
20
|
+
"@sentio/chain": "^1.1.4",
|
|
21
|
+
"@types/node": "^20.11.7",
|
|
22
|
+
"chalk": "^5.3.0",
|
|
23
|
+
"command-line-args": "^5.2.1",
|
|
24
|
+
"command-line-usage": "^7.0.1",
|
|
25
|
+
"express": "^4.18.2",
|
|
26
|
+
"form-data": "^4.0.0",
|
|
27
|
+
"fs-extra": "^11.2.0",
|
|
28
|
+
"jszip": "^3.10.1",
|
|
29
|
+
"latest-version": "^9.0.0",
|
|
30
|
+
"node-fetch": "^3.3.2",
|
|
31
|
+
"open": "^10.0.3",
|
|
32
|
+
"solc": "^0.8.25",
|
|
33
|
+
"tsup": "npm:@sentio/tsup@^6.7.2",
|
|
34
|
+
"tsx": "^4.15.2",
|
|
35
|
+
"yaml": "^2.3.4"
|
|
36
|
+
},
|
|
18
37
|
"peerDependencies": {},
|
|
19
38
|
"devDependencies": {
|
|
20
39
|
"@types/command-line-args": "^5.2.3",
|
|
@@ -26,11 +45,10 @@
|
|
|
26
45
|
"node": ">=16"
|
|
27
46
|
},
|
|
28
47
|
"scripts": {
|
|
29
|
-
"build": "pnpm
|
|
48
|
+
"build": "pnpm compile",
|
|
30
49
|
"postbuild": "pnpm install",
|
|
31
|
-
"bundle": "esbuild --platform=node --format=esm --bundle src/index.ts --outfile=lib/index.js --minify --sourcemap --inject:src/cjs-shim.ts --external:@sentio/sdk",
|
|
32
50
|
"cli": "tsx src/index.ts",
|
|
33
51
|
"compile": "tsc",
|
|
34
|
-
"test": "
|
|
52
|
+
"test": "glob -c 'tsx --test' '**/*.test.ts'"
|
|
35
53
|
}
|
|
36
54
|
}
|
package/src/commands/run-test.ts
CHANGED
|
@@ -3,12 +3,10 @@ import path from 'path'
|
|
|
3
3
|
import { getPackageRoot } from '../utils.js'
|
|
4
4
|
|
|
5
5
|
export function runTest(argv: string[]) {
|
|
6
|
-
const
|
|
7
|
-
// if config not existed copy that
|
|
8
|
-
const jest = path.resolve(getPackageRoot('jest'), 'bin', 'jest')
|
|
6
|
+
const tsx = path.resolve(getPackageRoot('tsx'), 'dist', 'cli.mjs')
|
|
9
7
|
|
|
10
8
|
// Run tsc to do check before test
|
|
11
9
|
const tsc = path.resolve(getPackageRoot('typescript'), 'bin', 'tsc')
|
|
12
10
|
execSync(`node ${tsc} --noEmit`, { stdio: 'inherit' })
|
|
13
|
-
execSync(`
|
|
11
|
+
execSync(`node ${tsx} --test **/*.test.ts ${argv.join(' ')}`, { stdio: 'inherit' })
|
|
14
12
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import assert from 'assert'
|
|
2
|
+
import { before, describe, test } from 'node:test'
|
|
1
3
|
import { TestProcessorServer } from '@sentio/sdk/testing'
|
|
2
4
|
|
|
3
5
|
describe('Test Processor', () => {
|
|
4
6
|
const service = new TestProcessorServer(() => import('./processor.js'))
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
before(async () => {
|
|
7
9
|
await service.start()
|
|
8
10
|
})
|
|
9
11
|
|
|
10
12
|
test('has config', async () => {
|
|
11
13
|
const config = await service.getConfig({})
|
|
12
|
-
|
|
14
|
+
assert.ok(config.contractConfigs.length > 0)
|
|
13
15
|
})
|
|
14
16
|
})
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import assert from 'assert'
|
|
2
|
+
import { before, describe, test } from 'node:test'
|
|
1
3
|
import { TestProcessorServer, firstCounterValue } from '@sentio/sdk/testing'
|
|
2
4
|
import { mockTransferLog } from '@sentio/sdk/eth/builtin/erc20'
|
|
3
5
|
|
|
4
6
|
describe('Test Processor', () => {
|
|
5
7
|
const service = new TestProcessorServer(() => import('./processor.js'))
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
before(async () => {
|
|
8
10
|
await service.start()
|
|
9
11
|
})
|
|
10
12
|
|
|
11
13
|
test('has valid config', async () => {
|
|
12
14
|
const config = await service.getConfig({})
|
|
13
|
-
|
|
15
|
+
assert(config.contractConfigs.length > 0)
|
|
14
16
|
})
|
|
15
17
|
|
|
16
18
|
test('check transfer event handling', async () => {
|
|
@@ -18,11 +20,11 @@ describe('Test Processor', () => {
|
|
|
18
20
|
mockTransferLog('0x1e4ede388cbc9f4b5c79681b7f94d36a11abebc9', {
|
|
19
21
|
from: '0x0000000000000000000000000000000000000000',
|
|
20
22
|
to: '0xb329e39ebefd16f40d38f07643652ce17ca5bac1',
|
|
21
|
-
value: 10n ** 18n * 10n
|
|
23
|
+
value: 10n ** 18n * 10n
|
|
22
24
|
})
|
|
23
25
|
)
|
|
24
26
|
|
|
25
27
|
const tokenCounter = firstCounterValue(resp.result, 'token')
|
|
26
|
-
|
|
28
|
+
assert.equal(tokenCounter, 10n)
|
|
27
29
|
})
|
|
28
30
|
})
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import assert from 'assert'
|
|
2
|
+
import { before, describe, test } from 'node:test'
|
|
1
3
|
import { TestProcessorServer } from '@sentio/sdk/testing'
|
|
2
4
|
|
|
3
5
|
describe('Test Processor', () => {
|
|
4
6
|
const service = new TestProcessorServer(async () => await import('./processor.js'))
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
before(async () => {
|
|
7
9
|
await service.start()
|
|
8
10
|
})
|
|
9
11
|
|
|
10
12
|
test('has config', async () => {
|
|
11
13
|
const config = await service.getConfig({})
|
|
12
|
-
|
|
14
|
+
assert(config.contractConfigs.length > 0)
|
|
13
15
|
})
|
|
14
16
|
})
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import assert from 'assert'
|
|
2
|
+
import { before, describe, test } from 'node:test'
|
|
1
3
|
import { TestProcessorServer } from '@sentio/sdk/testing'
|
|
2
4
|
|
|
3
5
|
describe('Test Processor', () => {
|
|
4
6
|
const service = new TestProcessorServer(() => import('./processor.js'))
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
before(async () => {
|
|
7
9
|
await service.start()
|
|
8
10
|
})
|
|
9
11
|
|
|
10
12
|
test('has valid config', async () => {
|
|
11
13
|
// const config = await service.getConfig({})
|
|
12
|
-
//
|
|
14
|
+
// assert(config.contractConfigs.length > 0)
|
|
13
15
|
})
|
|
14
16
|
})
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import assert from 'assert'
|
|
2
|
+
import { before, describe, test } from 'node:test'
|
|
1
3
|
import { TestProcessorServer } from '@sentio/sdk/testing'
|
|
2
4
|
|
|
3
5
|
describe('Test Processor', () => {
|
|
4
6
|
const service = new TestProcessorServer(() => import('./processor.js'))
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
before(async () => {
|
|
7
9
|
await service.start()
|
|
8
10
|
})
|
|
9
11
|
|
|
10
12
|
test('has valid config', async () => {
|
|
11
13
|
const config = await service.getConfig({})
|
|
12
|
-
|
|
14
|
+
assert.ok(config.contractConfigs.length > 0)
|
|
13
15
|
})
|
|
14
16
|
})
|
package/src/cjs-shim.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// https://github.com/evanw/esbuild/issues/1921#issuecomment-1898197331
|
|
2
|
-
import { createRequire } from 'node:module'
|
|
3
|
-
import path from 'node:path'
|
|
4
|
-
import url from 'node:url'
|
|
5
|
-
|
|
6
|
-
globalThis.require = createRequire(import.meta.url)
|
|
7
|
-
globalThis.__filename = url.fileURLToPath(import.meta.url)
|
|
8
|
-
globalThis.__dirname = path.dirname(__filename)
|