@subql/node-ethereum 2.9.3-4 → 2.10.0

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +13 -4
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/configure/configure.module.d.ts +6 -0
  4. package/dist/configure/configure.module.js +5 -1
  5. package/dist/configure/configure.module.js.map +1 -1
  6. package/dist/ethereum/api.connection.d.ts +1 -5
  7. package/dist/ethereum/api.connection.js +4 -17
  8. package/dist/ethereum/api.connection.js.map +1 -1
  9. package/dist/ethereum/api.service.ethereum.js +40 -15
  10. package/dist/ethereum/api.service.ethereum.js.map +1 -1
  11. package/dist/indexer/blockDispatcher/ethereum-block-dispatcher.js +2 -2
  12. package/dist/indexer/blockDispatcher/ethereum-block-dispatcher.js.map +1 -1
  13. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.d.ts +3 -2
  14. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js +6 -17
  15. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js.map +1 -1
  16. package/dist/indexer/fetch.module.js +5 -2
  17. package/dist/indexer/fetch.module.js.map +1 -1
  18. package/dist/indexer/indexer.module.js +9 -0
  19. package/dist/indexer/indexer.module.js.map +1 -1
  20. package/dist/indexer/worker/worker.js +6 -1
  21. package/dist/indexer/worker/worker.js.map +1 -1
  22. package/dist/subcommands/testing.init.js +4 -11
  23. package/dist/subcommands/testing.init.js.map +1 -1
  24. package/dist/subcommands/testing.module.js +11 -1
  25. package/dist/subcommands/testing.module.js.map +1 -1
  26. package/dist/subcommands/testing.service.d.ts +4 -4
  27. package/dist/subcommands/testing.service.js +23 -13
  28. package/dist/subcommands/testing.service.js.map +1 -1
  29. package/package.json +6 -7
@@ -3,22 +3,15 @@
3
3
  // SPDX-License-Identifier: GPL-3.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.testingInit = void 0;
6
- const core_1 = require("@nestjs/core");
7
6
  const node_core_1 = require("@subql/node-core");
8
- const project_service_1 = require("../indexer/project.service");
9
- const testing_module_1 = require("./testing.module");
7
+ const configure_module_1 = require("../configure/configure.module");
10
8
  const testing_service_1 = require("./testing.service");
11
9
  const logger = (0, node_core_1.getLogger)('Testing');
12
10
  async function testingInit() {
13
11
  try {
14
- const app = await core_1.NestFactory.create(testing_module_1.TestingModule, {
15
- logger: new node_core_1.NestLogger(),
16
- });
17
- await app.init();
18
- const projectService = app.get(project_service_1.ProjectService);
19
- // Initialise async services, we do this here rather than in factories, so we can capture one off events
20
- await projectService.init();
21
- const testingService = app.get(testing_service_1.TestingService);
12
+ const { config, project } = await configure_module_1.ConfigureModule.getInstance();
13
+ const subqueryProject = await project();
14
+ const testingService = new testing_service_1.TestingService(config, subqueryProject);
22
15
  await testingService.init();
23
16
  await testingService.run();
24
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"testing.init.js","sourceRoot":"","sources":["../../src/subcommands/testing.init.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,uCAA2C;AAC3C,gDAAqE;AAErE,gEAA4D;AAC5D,qDAAiD;AACjD,uDAAmD;AAEnD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,SAAS,CAAC,CAAC;AAC7B,KAAK,UAAU,WAAW;IAC/B,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,8BAAa,EAAE;YAClD,MAAM,EAAE,IAAI,sBAAU,EAAE;SACzB,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC;QAE/C,wGAAwG;QACxG,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAE5B,MAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC;QAC/C,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,cAAc,CAAC,GAAG,EAAE,CAAC;KAC5B;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AApBD,kCAoBC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { NestFactory } from '@nestjs/core';\nimport { ApiService, getLogger, NestLogger } from '@subql/node-core';\nimport { EthereumApiService } from '../ethereum';\nimport { ProjectService } from '../indexer/project.service';\nimport { TestingModule } from './testing.module';\nimport { TestingService } from './testing.service';\n\nconst logger = getLogger('Testing');\nexport async function testingInit(): Promise<void> {\n try {\n const app = await NestFactory.create(TestingModule, {\n logger: new NestLogger(),\n });\n\n await app.init();\n const projectService = app.get(ProjectService);\n\n // Initialise async services, we do this here rather than in factories, so we can capture one off events\n await projectService.init();\n\n const testingService = app.get(TestingService);\n await testingService.init();\n await testingService.run();\n } catch (e) {\n logger.error(e, 'Testing failed');\n process.exit(1);\n }\n process.exit(0);\n}\n"]}
1
+ {"version":3,"file":"testing.init.js","sourceRoot":"","sources":["../../src/subcommands/testing.init.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,gDAA6C;AAC7C,oEAAgE;AAChE,uDAAmD;AAEnD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,SAAS,CAAC,CAAC;AAC7B,KAAK,UAAU,WAAW;IAC/B,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,kCAAe,CAAC,WAAW,EAAE,CAAC;QAChE,MAAM,eAAe,GAAG,MAAM,OAAO,EAAE,CAAC;QAExC,MAAM,cAAc,GAAG,IAAI,gCAAc,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QACnE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,cAAc,CAAC,GAAG,EAAE,CAAC;KAC5B;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAbD,kCAaC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { getLogger } from '@subql/node-core';\nimport { ConfigureModule } from '../configure/configure.module';\nimport { TestingService } from './testing.service';\n\nconst logger = getLogger('Testing');\nexport async function testingInit(): Promise<void> {\n try {\n const { config, project } = await ConfigureModule.getInstance();\n const subqueryProject = await project();\n\n const testingService = new TestingService(config, subqueryProject);\n await testingService.init();\n await testingService.run();\n } catch (e) {\n logger.error(e, 'Testing failed');\n process.exit(1);\n }\n process.exit(0);\n}\n"]}
@@ -38,6 +38,7 @@ TestingFeatureModule = __decorate([
38
38
  dynamic_ds_service_1.DynamicDsService,
39
39
  unfinalizedBlocks_service_1.UnfinalizedBlocksService,
40
40
  project_service_1.ProjectService,
41
+ unfinalizedBlocks_service_1.UnfinalizedBlocksService,
41
42
  node_core_1.ConnectionPoolService,
42
43
  {
43
44
  provide: 'IProjectService',
@@ -52,11 +53,20 @@ TestingFeatureModule = __decorate([
52
53
  },
53
54
  inject: ['ISubqueryProject', node_core_1.ConnectionPoolService, event_emitter_1.EventEmitter2],
54
55
  },
55
- indexer_manager_1.IndexerManager,
56
56
  schedule_1.SchedulerRegistry,
57
+ node_core_1.TestRunner,
58
+ {
59
+ provide: 'IApi',
60
+ useClass: ethereum_1.EthereumApiService,
61
+ },
62
+ {
63
+ provide: 'IIndexerManager',
64
+ useClass: indexer_manager_1.IndexerManager,
65
+ },
57
66
  ],
58
67
  imports: [meta_module_1.MetaModule, fetch_module_1.FetchModule],
59
68
  controllers: [],
69
+ exports: [node_core_1.TestRunner],
60
70
  })
61
71
  ], TestingFeatureModule);
62
72
  exports.TestingFeatureModule = TestingFeatureModule;
@@ -1 +1 @@
1
- {"version":3,"file":"testing.module.js","sourceRoot":"","sources":["../../src/subcommands/testing.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA0E;AAC1E,+CAAqE;AACrE,gDAO0B;AAC1B,oEAAgE;AAEhE,0CAAiD;AAEjD,0EAAqE;AACrE,sEAAiE;AACjE,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,gEAA4D;AAC5D,oFAAgF;AAChF,qDAAiD;AACjD,uDAAmD;AA0C5C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IAxChC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,wBAAY;YACZ,gCAAc;YACd,6BAAa;YACb,sBAAU;YACV,gCAAc;YACd,yCAAkB;YAClB,qCAAgB;YAChB,oDAAwB;YACxB,gCAAc;YACd,iCAAqB;YACrB;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,gCAAc;aACzB;YACD;gBACE,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,KAAK,EACf,OAAwB,EACxB,qBAAmE,EACnE,YAA2B,EAC3B,EAAE;oBACF,MAAM,UAAU,GAAG,IAAI,6BAAkB,CACvC,OAAO,EACP,qBAAqB,EACrB,YAAY,CACb,CAAC;oBACF,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;oBACxB,OAAO,UAAU,CAAC;gBACpB,CAAC;gBACD,MAAM,EAAE,CAAC,kBAAkB,EAAE,iCAAqB,EAAE,6BAAa,CAAC;aACnE;YACD,gCAAc;YACd,4BAAiB;SAClB;QAED,OAAO,EAAE,CAAC,wBAAU,EAAE,0BAAW,CAAC;QAClC,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,oBAAoB,CAAG;AAAvB,oDAAoB;AAY1B,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IAVzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,oBAAQ,CAAC,OAAO,EAAE;YAClB,kCAAe,CAAC,QAAQ,EAAE;YAC1B,kCAAkB,CAAC,OAAO,EAAE;YAC5B,yBAAc,CAAC,OAAO,EAAE;YACxB,oBAAoB;SACrB;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';\nimport { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule';\nimport {\n ApiService,\n ConnectionPoolService,\n DbModule,\n NodeConfig,\n PoiService,\n StoreService,\n} from '@subql/node-core';\nimport { ConfigureModule } from '../configure/configure.module';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { EthereumApiService } from '../ethereum';\nimport { EthereumApiConnection } from '../ethereum/api.connection';\nimport { DsProcessorService } from '../indexer/ds-processor.service';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { FetchModule } from '../indexer/fetch.module';\nimport { IndexerManager } from '../indexer/indexer.manager';\nimport { ProjectService } from '../indexer/project.service';\nimport { SandboxService } from '../indexer/sandbox.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\nimport { MetaModule } from '../meta/meta.module';\nimport { TestingService } from './testing.service';\n\n@Module({\n providers: [\n StoreService,\n TestingService,\n EventEmitter2,\n PoiService,\n SandboxService,\n DsProcessorService,\n DynamicDsService,\n UnfinalizedBlocksService,\n ProjectService,\n ConnectionPoolService,\n {\n provide: 'IProjectService',\n useClass: ProjectService,\n },\n {\n provide: ApiService,\n useFactory: async (\n project: SubqueryProject,\n connectionPoolService: ConnectionPoolService<EthereumApiConnection>,\n eventEmitter: EventEmitter2,\n ) => {\n const apiService = new EthereumApiService(\n project,\n connectionPoolService,\n eventEmitter,\n );\n await apiService.init();\n return apiService;\n },\n inject: ['ISubqueryProject', ConnectionPoolService, EventEmitter2],\n },\n IndexerManager,\n SchedulerRegistry,\n ],\n\n imports: [MetaModule, FetchModule],\n controllers: [],\n})\nexport class TestingFeatureModule {}\n\n@Module({\n imports: [\n DbModule.forRoot(),\n ConfigureModule.register(),\n EventEmitterModule.forRoot(),\n ScheduleModule.forRoot(),\n TestingFeatureModule,\n ],\n controllers: [],\n})\nexport class TestingModule {}\n"]}
1
+ {"version":3,"file":"testing.module.js","sourceRoot":"","sources":["../../src/subcommands/testing.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA0E;AAC1E,+CAAqE;AACrE,gDAO0B;AAC1B,oEAAgE;AAEhE,0CAAiD;AAEjD,0EAAqE;AACrE,sEAAiE;AACjE,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,gEAA4D;AAC5D,oFAAgF;AAChF,qDAAiD;AACjD,uDAAmD;AAoD5C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IAlDhC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,wBAAY;YACZ,gCAAc;YACd,6BAAa;YACb,sBAAU;YACV,gCAAc;YACd,yCAAkB;YAClB,qCAAgB;YAChB,oDAAwB;YACxB,gCAAc;YACd,oDAAwB;YACxB,iCAAqB;YACrB;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,gCAAc;aACzB;YACD;gBACE,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,KAAK,EACf,OAAwB,EACxB,qBAAmE,EACnE,YAA2B,EAC3B,EAAE;oBACF,MAAM,UAAU,GAAG,IAAI,6BAAkB,CACvC,OAAO,EACP,qBAAqB,EACrB,YAAY,CACb,CAAC;oBACF,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;oBACxB,OAAO,UAAU,CAAC;gBACpB,CAAC;gBACD,MAAM,EAAE,CAAC,kBAAkB,EAAE,iCAAqB,EAAE,6BAAa,CAAC;aACnE;YACD,4BAAiB;YACjB,sBAAU;YACV;gBACE,OAAO,EAAE,MAAM;gBACf,QAAQ,EAAE,6BAAkB;aAC7B;YACD;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,gCAAc;aACzB;SACF;QAED,OAAO,EAAE,CAAC,wBAAU,EAAE,0BAAW,CAAC;QAClC,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,CAAC,sBAAU,CAAC;KACtB,CAAC;GACW,oBAAoB,CAAG;AAAvB,oDAAoB;AAY1B,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IAVzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,oBAAQ,CAAC,OAAO,EAAE;YAClB,kCAAe,CAAC,QAAQ,EAAE;YAC1B,kCAAkB,CAAC,OAAO,EAAE;YAC5B,yBAAc,CAAC,OAAO,EAAE;YACxB,oBAAoB;SACrB;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';\nimport { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule';\nimport {\n ApiService,\n ConnectionPoolService,\n DbModule,\n PoiService,\n StoreService,\n TestRunner,\n} from '@subql/node-core';\nimport { ConfigureModule } from '../configure/configure.module';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { EthereumApiService } from '../ethereum';\nimport { EthereumApiConnection } from '../ethereum/api.connection';\nimport { DsProcessorService } from '../indexer/ds-processor.service';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { FetchModule } from '../indexer/fetch.module';\nimport { IndexerManager } from '../indexer/indexer.manager';\nimport { ProjectService } from '../indexer/project.service';\nimport { SandboxService } from '../indexer/sandbox.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\nimport { MetaModule } from '../meta/meta.module';\nimport { TestingService } from './testing.service';\n\n@Module({\n providers: [\n StoreService,\n TestingService,\n EventEmitter2,\n PoiService,\n SandboxService,\n DsProcessorService,\n DynamicDsService,\n UnfinalizedBlocksService,\n ProjectService,\n UnfinalizedBlocksService,\n ConnectionPoolService,\n {\n provide: 'IProjectService',\n useClass: ProjectService,\n },\n {\n provide: ApiService,\n useFactory: async (\n project: SubqueryProject,\n connectionPoolService: ConnectionPoolService<EthereumApiConnection>,\n eventEmitter: EventEmitter2,\n ) => {\n const apiService = new EthereumApiService(\n project,\n connectionPoolService,\n eventEmitter,\n );\n await apiService.init();\n return apiService;\n },\n inject: ['ISubqueryProject', ConnectionPoolService, EventEmitter2],\n },\n SchedulerRegistry,\n TestRunner,\n {\n provide: 'IApi',\n useClass: EthereumApiService,\n },\n {\n provide: 'IIndexerManager',\n useClass: IndexerManager,\n },\n ],\n\n imports: [MetaModule, FetchModule],\n controllers: [],\n exports: [TestRunner],\n})\nexport class TestingFeatureModule {}\n\n@Module({\n imports: [\n DbModule.forRoot(),\n ConfigureModule.register(),\n EventEmitterModule.forRoot(),\n ScheduleModule.forRoot(),\n TestingFeatureModule,\n ],\n controllers: [],\n})\nexport class TestingModule {}\n"]}
@@ -1,11 +1,11 @@
1
- import { NodeConfig, StoreService, TestingService as BaseTestingService, ApiService } from '@subql/node-core';
1
+ import { NodeConfig, TestingService as BaseTestingService, TestRunner } from '@subql/node-core';
2
2
  import { EthereumBlockWrapper } from '@subql/types-ethereum';
3
- import { Sequelize } from '@subql/x-sequelize';
4
3
  import { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject';
5
4
  import { EthereumApi } from '../ethereum';
6
5
  import SafeEthProvider from '../ethereum/safe-api';
7
6
  import { IndexerManager } from '../indexer/indexer.manager';
8
7
  export declare class TestingService extends BaseTestingService<EthereumApi, SafeEthProvider, EthereumBlockWrapper, SubqlProjectDs> {
9
- constructor(sequelize: Sequelize, nodeConfig: NodeConfig, storeService: StoreService, project: SubqueryProject, apiService: ApiService, indexerManager: IndexerManager);
10
- indexBlock(block: EthereumBlockWrapper, handler: string): Promise<void>;
8
+ constructor(nodeConfig: NodeConfig, project: SubqueryProject);
9
+ getTestRunner(): Promise<TestRunner<EthereumApi, SafeEthProvider, EthereumBlockWrapper, SubqlProjectDs>>;
10
+ indexBlock(block: EthereumBlockWrapper, handler: string, indexerManager: IndexerManager): Promise<void>;
11
11
  }
@@ -16,27 +16,37 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.TestingService = void 0;
18
18
  const common_1 = require("@nestjs/common");
19
+ const core_1 = require("@nestjs/core");
19
20
  const node_core_1 = require("@subql/node-core");
20
- const x_sequelize_1 = require("@subql/x-sequelize");
21
21
  const SubqueryProject_1 = require("../configure/SubqueryProject");
22
- const indexer_manager_1 = require("../indexer/indexer.manager");
22
+ const ethereum_1 = require("../ethereum");
23
+ const project_service_1 = require("../indexer/project.service");
24
+ const testing_module_1 = require("./testing.module");
23
25
  let TestingService = class TestingService extends node_core_1.TestingService {
24
- constructor(sequelize, nodeConfig, storeService, project, apiService, indexerManager) {
25
- super(sequelize, nodeConfig, storeService, project, apiService, indexerManager);
26
+ constructor(nodeConfig, project) {
27
+ super(nodeConfig, project);
26
28
  }
27
- async indexBlock(block, handler) {
28
- await this.indexerManager.indexBlock(block, this.getDsWithHandler(handler));
29
+ async getTestRunner() {
30
+ const testContext = await core_1.NestFactory.createApplicationContext(testing_module_1.TestingModule, {
31
+ logger: new node_core_1.NestLogger(),
32
+ });
33
+ await testContext.init();
34
+ const projectService = testContext.get(project_service_1.ProjectService);
35
+ const apiService = testContext.get(ethereum_1.EthereumApi);
36
+ // Initialise async services, we do this here rather than in factories, so we can capture one off events
37
+ await apiService.init();
38
+ await projectService.init();
39
+ return testContext.get(node_core_1.TestRunner);
40
+ }
41
+ async indexBlock(block, handler, indexerManager) {
42
+ await indexerManager.indexBlock(block, this.getDsWithHandler(handler));
29
43
  }
30
44
  };
31
45
  TestingService = __decorate([
32
46
  (0, common_1.Injectable)(),
33
- __param(3, (0, common_1.Inject)('ISubqueryProject')),
34
- __metadata("design:paramtypes", [x_sequelize_1.Sequelize,
35
- node_core_1.NodeConfig,
36
- node_core_1.StoreService,
37
- SubqueryProject_1.SubqueryProject,
38
- node_core_1.ApiService,
39
- indexer_manager_1.IndexerManager])
47
+ __param(1, (0, common_1.Inject)('ISubqueryProject')),
48
+ __metadata("design:paramtypes", [node_core_1.NodeConfig,
49
+ SubqueryProject_1.SubqueryProject])
40
50
  ], TestingService);
41
51
  exports.TestingService = TestingService;
42
52
  //# sourceMappingURL=testing.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.service.js","sourceRoot":"","sources":["../../src/subcommands/testing.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AACpD,gDAK0B;AAE1B,oDAA+C;AAC/C,kEAA+E;AAG/E,gEAA4D;AAGrD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,0BAKnC;IACC,YACE,SAAoB,EACpB,UAAsB,EACtB,YAA0B,EACE,OAAwB,EACpD,UAAsB,EACtB,cAA8B;QAE9B,KAAK,CACH,SAAS,EACT,UAAU,EACV,YAAY,EACZ,OAAO,EACP,UAAU,EACV,cAAc,CACf,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CACd,KAA2B,EAC3B,OAAe;QAEf,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9E,CAAC;CACF,CAAA;AA9BY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAWR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAHhB,uBAAS;QACR,sBAAU;QACR,wBAAY;QACW,iCAAe;QACxC,sBAAU;QACN,gCAAc;GAZrB,cAAc,CA8B1B;AA9BY,wCAAc","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport {\n NodeConfig,\n StoreService,\n TestingService as BaseTestingService,\n ApiService,\n} from '@subql/node-core';\nimport { EthereumBlockWrapper } from '@subql/types-ethereum';\nimport { Sequelize } from '@subql/x-sequelize';\nimport { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject';\nimport { EthereumApi } from '../ethereum';\nimport SafeEthProvider from '../ethereum/safe-api';\nimport { IndexerManager } from '../indexer/indexer.manager';\n\n@Injectable()\nexport class TestingService extends BaseTestingService<\n EthereumApi,\n SafeEthProvider,\n EthereumBlockWrapper,\n SubqlProjectDs\n> {\n constructor(\n sequelize: Sequelize,\n nodeConfig: NodeConfig,\n storeService: StoreService,\n @Inject('ISubqueryProject') project: SubqueryProject,\n apiService: ApiService,\n indexerManager: IndexerManager,\n ) {\n super(\n sequelize,\n nodeConfig,\n storeService,\n project,\n apiService,\n indexerManager,\n );\n }\n\n async indexBlock(\n block: EthereumBlockWrapper,\n handler: string,\n ): Promise<void> {\n await this.indexerManager.indexBlock(block, this.getDsWithHandler(handler));\n }\n}\n"]}
1
+ {"version":3,"file":"testing.service.js","sourceRoot":"","sources":["../../src/subcommands/testing.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AACpD,uCAA2C;AAE3C,gDAM0B;AAE1B,kEAA+E;AAC/E,0CAA0C;AAG1C,gEAA4D;AAC5D,qDAAiD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,0BAKnC;IACC,YACE,UAAsB,EACM,OAAwB;QAEpD,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,aAAa;QAQjB,MAAM,WAAW,GAAG,MAAM,kBAAW,CAAC,wBAAwB,CAC5D,8BAAa,EACb;YACE,MAAM,EAAE,IAAI,sBAAU,EAAE;SACzB,CACF,CAAC;QAEF,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,MAAM,cAAc,GAAmB,WAAW,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,sBAAW,CAAC,CAAC;QAEhD,wGAAwG;QACxG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;QACxB,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAE5B,OAAO,WAAW,CAAC,GAAG,CAAC,sBAAU,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,UAAU,CACd,KAA2B,EAC3B,OAAe,EACf,cAA8B;QAE9B,MAAM,cAAc,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IACzE,CAAC;CACF,CAAA;AA/CY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IASR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCADf,sBAAU;QACe,iCAAe;GAR3C,cAAc,CA+C1B;AA/CY,wCAAc","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport { NestFactory } from '@nestjs/core';\n\nimport {\n NodeConfig,\n TestingService as BaseTestingService,\n ApiService,\n NestLogger,\n TestRunner,\n} from '@subql/node-core';\nimport { EthereumBlockWrapper } from '@subql/types-ethereum';\nimport { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject';\nimport { EthereumApi } from '../ethereum';\nimport SafeEthProvider from '../ethereum/safe-api';\nimport { IndexerManager } from '../indexer/indexer.manager';\nimport { ProjectService } from '../indexer/project.service';\nimport { TestingModule } from './testing.module';\n\n@Injectable()\nexport class TestingService extends BaseTestingService<\n EthereumApi,\n SafeEthProvider,\n EthereumBlockWrapper,\n SubqlProjectDs\n> {\n constructor(\n nodeConfig: NodeConfig,\n @Inject('ISubqueryProject') project: SubqueryProject,\n ) {\n super(nodeConfig, project);\n }\n\n async getTestRunner(): Promise<\n TestRunner<\n EthereumApi,\n SafeEthProvider,\n EthereumBlockWrapper,\n SubqlProjectDs\n >\n > {\n const testContext = await NestFactory.createApplicationContext(\n TestingModule,\n {\n logger: new NestLogger(),\n },\n );\n\n await testContext.init();\n\n const projectService: ProjectService = testContext.get(ProjectService);\n const apiService = testContext.get(EthereumApi);\n\n // Initialise async services, we do this here rather than in factories, so we can capture one off events\n await apiService.init();\n await projectService.init();\n\n return testContext.get(TestRunner);\n }\n\n async indexBlock(\n block: EthereumBlockWrapper,\n handler: string,\n indexerManager: IndexerManager,\n ): Promise<void> {\n await indexerManager.indexBlock(block, this.getDsWithHandler(handler));\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subql/node-ethereum",
3
- "version": "2.9.3-4",
3
+ "version": "2.10.0",
4
4
  "description": "",
5
5
  "author": "Ian He",
6
6
  "license": "GPL-3.0",
@@ -24,12 +24,12 @@
24
24
  "@nestjs/event-emitter": "^2.0.0",
25
25
  "@nestjs/platform-express": "^9.4.0",
26
26
  "@nestjs/schedule": "^3.0.1",
27
- "@subql/common": "^2.3.0",
28
- "@subql/common-ethereum": "2.2.1-0",
29
- "@subql/node-core": "^3.1.2",
27
+ "@subql/common": "^2.4.0",
28
+ "@subql/common-ethereum": "2.2.1",
29
+ "@subql/node-core": "^4.0.1",
30
30
  "@subql/testing": "^2.0.0",
31
31
  "@subql/types": "^2.1.2",
32
- "@subql/types-ethereum": "2.2.3-2",
32
+ "@subql/types-ethereum": "2.2.3",
33
33
  "@willsoto/nestjs-prometheus": "^4.4.0",
34
34
  "cacheable-lookup": "6",
35
35
  "cron-converter": "^1.0.2",
@@ -66,6 +66,5 @@
66
66
  "files": [
67
67
  "/dist",
68
68
  "/bin"
69
- ],
70
- "stableVersion": "2.9.3-3"
69
+ ]
71
70
  }