@sentio/runtime 2.40.0-rc.15 → 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-IO6D7U2E.js → chunk-ADIQF3IB.js} +15 -4
- package/lib/index.js +1 -1
- package/lib/processor-runner.js +1 -1
- package/package.json +1 -1
- package/src/service.ts +14 -3
- 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,8 @@ 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");
|
78596
|
+
this.preparedData = { ethCallResults: {} };
|
78592
78597
|
subject.complete();
|
78593
78598
|
}).catch((e) => {
|
78594
78599
|
console.error(e);
|
@@ -78606,7 +78611,13 @@ var ProcessorServiceImpl = class {
|
|
78606
78611
|
const dbContext = contexts.new(request.processId, subject);
|
78607
78612
|
const start = Date.now();
|
78608
78613
|
this.preprocessBindings(bindings, dbContext).then((preparedData) => {
|
78609
|
-
|
78614
|
+
Object.keys(preparedData.ethCallResults).forEach((key) => console.log("got prepared data, key:", key));
|
78615
|
+
this.preparedData = {
|
78616
|
+
ethCallResults: {
|
78617
|
+
...this.preparedData?.ethCallResults,
|
78618
|
+
...preparedData.ethCallResults
|
78619
|
+
}
|
78620
|
+
};
|
78610
78621
|
subject.next({
|
78611
78622
|
processId: request.processId
|
78612
78623
|
});
|
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,8 @@ 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')
|
287
|
+
this.preparedData = { ethCallResults: {} }
|
283
288
|
subject.complete()
|
284
289
|
})
|
285
290
|
.catch((e) => {
|
@@ -305,7 +310,13 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
|
|
305
310
|
this.preprocessBindings(bindings, dbContext)
|
306
311
|
.then((preparedData) => {
|
307
312
|
// TODO maybe not proper to pass data in this way
|
308
|
-
|
313
|
+
Object.keys(preparedData.ethCallResults).forEach((key) => console.log('got prepared data, key:', key))
|
314
|
+
this.preparedData = {
|
315
|
+
ethCallResults: {
|
316
|
+
...this.preparedData?.ethCallResults,
|
317
|
+
...preparedData.ethCallResults
|
318
|
+
}
|
319
|
+
}
|
309
320
|
subject.next({
|
310
321
|
processId: request.processId
|
311
322
|
})
|
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
|
}
|