@sentio/runtime 2.54.0-rc.11 → 2.54.0-rc.12
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-PSAWYB4F.js → chunk-TTUV7TP2.js} +15 -15
- package/lib/{chunk-PSAWYB4F.js.map → chunk-TTUV7TP2.js.map} +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/processor-runner.js +29 -29
- package/lib/processor-runner.js.map +1 -1
- package/package.json +1 -1
- package/src/full-service.ts +8 -10
- package/src/utils.ts +3 -3
package/package.json
CHANGED
package/src/full-service.ts
CHANGED
@@ -19,7 +19,7 @@ import fs from 'fs-extra'
|
|
19
19
|
import path from 'path'
|
20
20
|
import os from 'os'
|
21
21
|
import { GLOBAL_CONFIG } from './global-config.js'
|
22
|
-
import { compareSemver } from './utils.js'
|
22
|
+
import { compareSemver, parseSemver, Semver } from './utils.js'
|
23
23
|
|
24
24
|
const require = createRequire(import.meta.url)
|
25
25
|
|
@@ -35,7 +35,6 @@ function locatePackageJson(pkgId: string) {
|
|
35
35
|
}
|
36
36
|
|
37
37
|
export class FullProcessorServiceImpl implements ProcessorServiceImplementation {
|
38
|
-
private sdkVersion: string
|
39
38
|
constructor(instance: ProcessorServiceImplementation) {
|
40
39
|
this.instance = instance
|
41
40
|
const sdkPackageJson = locatePackageJson('@sentio/sdk')
|
@@ -43,14 +42,11 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
|
|
43
42
|
|
44
43
|
console.log('Runtime version:', runtimePackageJson.version, 'SDK version:', sdkPackageJson.version)
|
45
44
|
|
46
|
-
|
47
|
-
this.sdkMinorVersion = parseInt(version[1])
|
48
|
-
this.sdkVersion = sdkPackageJson.version
|
45
|
+
this.sdkVersion = parseSemver(sdkPackageJson.version)
|
49
46
|
}
|
50
47
|
|
51
48
|
instance: ProcessorServiceImplementation
|
52
|
-
|
53
|
-
semver: string
|
49
|
+
sdkVersion: Semver
|
54
50
|
|
55
51
|
async getConfig(request: ProcessConfigRequest, context: CallContext) {
|
56
52
|
const config = await this.instance.getConfig(request, context)
|
@@ -97,7 +93,7 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
|
|
97
93
|
}
|
98
94
|
return result
|
99
95
|
} catch (e) {
|
100
|
-
if (this.
|
96
|
+
if (this.sdkVersion.minor <= 16) {
|
101
97
|
// Old sdk doesn't handle this well
|
102
98
|
if (
|
103
99
|
e.code === os.constants.errno.ECONNRESET ||
|
@@ -134,7 +130,7 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
|
|
134
130
|
}
|
135
131
|
switch (dataBinding.handlerType) {
|
136
132
|
case HandlerType.FUEL_TRANSACTION:
|
137
|
-
if (compareSemver(this.sdkVersion,
|
133
|
+
if (compareSemver(this.sdkVersion, fuelProtoUpdateVersion) < 0) {
|
138
134
|
dataBinding.handlerType = HandlerType.FUEL_CALL
|
139
135
|
if (dataBinding.data) {
|
140
136
|
dataBinding.data.fuelCall = dataBinding.data?.fuelTransaction
|
@@ -142,7 +138,7 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
|
|
142
138
|
}
|
143
139
|
break
|
144
140
|
case HandlerType.FUEL_RECEIPT:
|
145
|
-
if (compareSemver(this.sdkVersion,
|
141
|
+
if (compareSemver(this.sdkVersion, fuelProtoUpdateVersion) < 0) {
|
146
142
|
dataBinding.handlerType = HandlerType.FUEL_CALL
|
147
143
|
if (dataBinding.data) {
|
148
144
|
dataBinding.data.fuelCall = dataBinding.data?.fuelLog
|
@@ -218,3 +214,5 @@ function getSecondary(d: DataBinding) {
|
|
218
214
|
d.data?.ethTrace?.trace?.transactionPosition
|
219
215
|
)
|
220
216
|
}
|
217
|
+
|
218
|
+
const fuelProtoUpdateVersion = parseSemver('2.54.0-rc.7')
|
package/src/utils.ts
CHANGED
@@ -61,9 +61,9 @@ export function parseSemver(version: string): Semver {
|
|
61
61
|
}
|
62
62
|
}
|
63
63
|
|
64
|
-
export function compareSemver(a:
|
65
|
-
const { major: ma, minor: mia, patch: pa, prerelease: pra } =
|
66
|
-
const { major: mb, minor: mib, patch: pb, prerelease: prb } =
|
64
|
+
export function compareSemver(a: Semver, b: Semver) {
|
65
|
+
const { major: ma, minor: mia, patch: pa, prerelease: pra } = a
|
66
|
+
const { major: mb, minor: mib, patch: pb, prerelease: prb } = b
|
67
67
|
|
68
68
|
if (ma !== mb) {
|
69
69
|
return ma - mb
|