@sentio/runtime 2.40.0-rc.16 → 2.40.0-rc.17
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/{chunk-K6CPN5YU.js → chunk-ADIQF3IB.js} +8 -3
- package/lib/index.js +1 -1
- package/lib/processor-runner.js +1 -1
- package/package.json +1 -1
- package/src/service.ts +7 -2
- package/src/utils.ts +1 -1
@@ -59531,7 +59531,7 @@ function makeEthCallKey(param) {
|
|
59531
59531
|
throw new Error("null context for eth call");
|
59532
59532
|
}
|
59533
59533
|
const { chainId, address, blockTag } = param.context;
|
59534
|
-
return `${chainId}|${address}|${blockTag}|${param.calldata}
|
59534
|
+
return `${chainId}|${address}|${blockTag}|${param.calldata}`.toLowerCase();
|
59535
59535
|
}
|
59536
59536
|
|
59537
59537
|
// src/endpoints.ts
|
@@ -78523,14 +78523,17 @@ var ProcessorServiceImpl = class {
|
|
78523
78523
|
const callPromises = [];
|
78524
78524
|
for (const params of groupedRequests.values()) {
|
78525
78525
|
const { chainId, address, blockTag } = params[0].context;
|
78526
|
-
console.log(`chain: ${chainId}, address: ${address}, blockTag: ${blockTag}, totalCalls: ${params.length}`);
|
78527
78526
|
for (const param of params) {
|
78528
78527
|
callPromises.push(
|
78529
78528
|
providers2.get(chainId).call({
|
78530
78529
|
to: address,
|
78531
78530
|
data: param.calldata,
|
78532
78531
|
blockTag
|
78533
|
-
}).then((result) =>
|
78532
|
+
}).then((result) => {
|
78533
|
+
const ret = [makeEthCallKey(param), result];
|
78534
|
+
console.log(`got eth call result, key: ${ret[0]}, result: ${result}`);
|
78535
|
+
return ret;
|
78536
|
+
})
|
78534
78537
|
);
|
78535
78538
|
}
|
78536
78539
|
}
|
@@ -78589,6 +78592,7 @@ var ProcessorServiceImpl = class {
|
|
78589
78592
|
}
|
78590
78593
|
const subject = new import_rxjs.Subject();
|
78591
78594
|
this.handleRequests(requests, subject).then(() => {
|
78595
|
+
console.log("clearing prepared data");
|
78592
78596
|
this.preparedData = { ethCallResults: {} };
|
78593
78597
|
subject.complete();
|
78594
78598
|
}).catch((e) => {
|
@@ -78607,6 +78611,7 @@ var ProcessorServiceImpl = class {
|
|
78607
78611
|
const dbContext = contexts.new(request.processId, subject);
|
78608
78612
|
const start = Date.now();
|
78609
78613
|
this.preprocessBindings(bindings, dbContext).then((preparedData) => {
|
78614
|
+
Object.keys(preparedData.ethCallResults).forEach((key) => console.log("got prepared data, key:", key));
|
78610
78615
|
this.preparedData = {
|
78611
78616
|
ethCallResults: {
|
78612
78617
|
...this.preparedData?.ethCallResults,
|
package/lib/index.js
CHANGED
package/lib/processor-runner.js
CHANGED
package/package.json
CHANGED
package/src/service.ts
CHANGED
@@ -197,7 +197,6 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
197
197
|
const callPromises = []
|
198
198
|
for (const params of groupedRequests.values()) {
|
199
199
|
const { chainId, address, blockTag } = params[0].context!
|
200
|
-
console.log(`chain: ${chainId}, address: ${address}, blockTag: ${blockTag}, totalCalls: ${params.length}`)
|
201
200
|
// TODO multicall
|
202
201
|
for (const param of params) {
|
203
202
|
callPromises.push(
|
@@ -208,7 +207,11 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
208
207
|
data: param.calldata,
|
209
208
|
blockTag
|
210
209
|
})
|
211
|
-
.then((result) =>
|
210
|
+
.then((result) => {
|
211
|
+
const ret = [makeEthCallKey(param), result]
|
212
|
+
console.log(`got eth call result, key: ${ret[0]}, result: ${result}`)
|
213
|
+
return ret
|
214
|
+
})
|
212
215
|
)
|
213
216
|
}
|
214
217
|
}
|
@@ -280,6 +283,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
280
283
|
const subject = new Subject<DeepPartial<ProcessStreamResponse>>()
|
281
284
|
this.handleRequests(requests, subject)
|
282
285
|
.then(() => {
|
286
|
+
console.log('clearing prepared data')
|
283
287
|
this.preparedData = { ethCallResults: {} }
|
284
288
|
subject.complete()
|
285
289
|
})
|
@@ -306,6 +310,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
306
310
|
this.preprocessBindings(bindings, dbContext)
|
307
311
|
.then((preparedData) => {
|
308
312
|
// TODO maybe not proper to pass data in this way
|
313
|
+
Object.keys(preparedData.ethCallResults).forEach((key) => console.log('got prepared data, key:', key))
|
309
314
|
this.preparedData = {
|
310
315
|
ethCallResults: {
|
311
316
|
...this.preparedData?.ethCallResults,
|
package/src/utils.ts
CHANGED
@@ -34,5 +34,5 @@ export function makeEthCallKey(param: EthCallParam) {
|
|
34
34
|
throw new Error('null context for eth call')
|
35
35
|
}
|
36
36
|
const { chainId, address, blockTag } = param.context
|
37
|
-
return `${chainId}|${address}|${blockTag}|${param.calldata}
|
37
|
+
return `${chainId}|${address}|${blockTag}|${param.calldata}`.toLowerCase()
|
38
38
|
}
|