@sentio/runtime 2.59.0-rc.34 → 2.59.0-rc.36

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/index.d.ts CHANGED
@@ -127,6 +127,7 @@ declare class TemplateInstanceState extends ListStateStorage<TemplateInstance> {
127
127
  }
128
128
 
129
129
  declare function mergeProcessResults(results: ProcessResult[]): Required<ProcessResult, 'states'>;
130
+ declare function mergeProcessResultsInPlace(res: ProcessResult, results: ProcessResult[]): Required<ProcessResult, 'states'>;
130
131
  declare function errorString(e: Error): string;
131
132
  declare const USER_PROCESSOR = "user_processor";
132
133
  declare function makeEthCallKey(param: EthCallParam): string;
@@ -1292,4 +1293,4 @@ declare const processMetrics: {
1292
1293
  };
1293
1294
  declare const metricsStorage: AsyncLocalStorage<string>;
1294
1295
 
1295
- export { AbstractStoreContext, type ChainConfig, DataBinding, Data_EthBlock, Data_EthLog, Data_EthTrace, Data_EthTransaction, DummyProvider, Endpoints, GLOBAL_CONFIG, type GlobalConfig, type IStoreContext, ListStateStorage, MapStateStorage, Plugin, PluginManager, ProcessorServiceImpl, QueuedStaticJsonRpcProvider, type Semver, State, StateStorage, StoreContext, TemplateInstanceState, USER_PROCESSOR, compareSemver, configureEndpoints, dbMetrics, errorString, getProvider, makeEthCallKey, mergeProcessResults, metricsStorage, parseSemver, processMetrics, providerMetrics, recordRuntimeInfo, timeoutError };
1296
+ export { AbstractStoreContext, type ChainConfig, DataBinding, Data_EthBlock, Data_EthLog, Data_EthTrace, Data_EthTransaction, DummyProvider, Endpoints, GLOBAL_CONFIG, type GlobalConfig, type IStoreContext, ListStateStorage, MapStateStorage, Plugin, PluginManager, ProcessorServiceImpl, QueuedStaticJsonRpcProvider, type Semver, State, StateStorage, StoreContext, TemplateInstanceState, USER_PROCESSOR, compareSemver, configureEndpoints, dbMetrics, errorString, getProvider, makeEthCallKey, mergeProcessResults, mergeProcessResultsInPlace, metricsStorage, parseSemver, processMetrics, providerMetrics, recordRuntimeInfo, timeoutError };
package/lib/index.js CHANGED
@@ -22,13 +22,14 @@ import {
22
22
  getProvider,
23
23
  makeEthCallKey,
24
24
  mergeProcessResults,
25
+ mergeProcessResultsInPlace,
25
26
  metricsStorage,
26
27
  parseSemver,
27
28
  processMetrics,
28
29
  providerMetrics,
29
30
  recordRuntimeInfo,
30
31
  timeoutError
31
- } from "./chunk-QWKQ7U4H.js";
32
+ } from "./chunk-OS67OWYG.js";
32
33
  import {
33
34
  Plugin,
34
35
  PluginManager
@@ -62,6 +63,7 @@ export {
62
63
  getProvider,
63
64
  makeEthCallKey,
64
65
  mergeProcessResults,
66
+ mergeProcessResultsInPlace,
65
67
  metricsStorage,
66
68
  parseSemver,
67
69
  processMetrics,
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chain-config.ts","../src/index.ts"],"sourcesContent":["export interface ChainConfig {\n ChainID: string\n Https?: string[]\n ChainServer?: string\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './plugin.js'\nexport * from './state.js'\nexport * from './utils.js'\nexport * from './endpoints.js'\nexport * from './chain-config.js'\nexport * from './service.js'\nexport { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'\nexport * from './db-context.js'\nexport * from './provider.js'\nexport * from './metrics.js'\nexport {\n type DataBinding,\n type Data_EthLog,\n type Data_EthBlock,\n type Data_EthTransaction,\n type Data_EthTrace\n} from './gen/processor/protos/processor.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKC,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;;;ACYrD,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/chain-config.ts","../src/index.ts"],"sourcesContent":["export interface ChainConfig {\n ChainID: string\n Https?: string[]\n ChainServer?: string\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './plugin.js'\nexport * from './state.js'\nexport * from './utils.js'\nexport * from './endpoints.js'\nexport * from './chain-config.js'\nexport * from './service.js'\nexport { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'\nexport * from './db-context.js'\nexport * from './provider.js'\nexport * from './metrics.js'\nexport {\n type DataBinding,\n type Data_EthLog,\n type Data_EthBlock,\n type Data_EthTransaction,\n type Data_EthTrace\n} from './gen/processor/protos/processor.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKC,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;;;ACYrD,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
@@ -44,7 +44,7 @@ import {
44
44
  require_lodash,
45
45
  require_src,
46
46
  trace
47
- } from "./chunk-QWKQ7U4H.js";
47
+ } from "./chunk-OS67OWYG.js";
48
48
  import {
49
49
  ExecutionConfig,
50
50
  HandlerType,
@@ -10,7 +10,7 @@ import {
10
10
  recordRuntimeInfo,
11
11
  require_lib3 as require_lib,
12
12
  require_lib4 as require_lib2
13
- } from "./chunk-QWKQ7U4H.js";
13
+ } from "./chunk-OS67OWYG.js";
14
14
  import {
15
15
  PluginManager,
16
16
  ProcessConfigResponse,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.59.0-rc.34",
3
+ "version": "2.59.0-rc.36",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
package/src/utils.ts CHANGED
@@ -10,13 +10,20 @@ export function mergeProcessResults(results: ProcessResult[]): Required<ProcessR
10
10
  ...ProcessResultFull.create(),
11
11
  states: StateResult.create()
12
12
  }
13
+ return mergeProcessResultsInPlace(res, results)
14
+ }
13
15
 
16
+ export function mergeProcessResultsInPlace(
17
+ res: ProcessResult,
18
+ results: ProcessResult[]
19
+ ): Required<ProcessResult, 'states'> {
20
+ res.states = res.states || StateResult.create()
14
21
  for (const r of results) {
15
- res.counters = res.counters.concat(r.counters)
16
- res.gauges = res.gauges.concat(r.gauges)
17
- res.events = res.events.concat(r.events)
18
- res.exports = res.exports.concat(r.exports)
19
- res.timeseriesResult = res.timeseriesResult.concat(r.timeseriesResult)
22
+ res.counters.push(...r.counters)
23
+ res.gauges.push(...r.gauges)
24
+ res.events.push(...r.events)
25
+ res.exports.push(...r.exports)
26
+ res.timeseriesResult.push(...r.timeseriesResult)
20
27
  res.states = {
21
28
  configUpdated: res.states?.configUpdated || r.states?.configUpdated || false
22
29
  }