@sentio/runtime 2.57.9-rc.11 → 2.57.9-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.57.9-rc.11",
3
+ "version": "2.57.9-rc.12",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -28,6 +28,7 @@ const FUEL_PROTO_UPDATE_VERSION = parseSemver('2.54.0-rc.7')
28
28
  const FUEL_PROTO_NO_FUEL_TRANSACTION_AS_CALL_VERSION = parseSemver('2.55.0-rc.1')
29
29
 
30
30
  const MOVE_USE_RAW_VERSION = parseSemver('2.55.0-rc.1')
31
+ const ETH_USE_RAW_VERSION = parseSemver('2.57.9-rc.12')
31
32
  // new driver (after MOVE_USE_RAW_VERSION) will sent the same event multiple times when fetch all true
32
33
  // so we need to cache it, key will be tx-handler_id
33
34
  const PROCESSED_MOVE_EVENT_TX_HANDLER = new LRUCache<string, boolean>({
@@ -162,11 +163,31 @@ export class FullProcessorServiceImpl implements ProcessorServiceImplementation
162
163
 
163
164
  private adjustDataBinding(dataBinding?: DataBinding): void {
164
165
  const isBeforeMoveUseRawVersion = compareSemver(this.sdkVersion, MOVE_USE_RAW_VERSION) < 0
166
+ // const isBeforeEthUseRawVersion = compareSemver(this.sdkVersion,ETH_USE_RAW_VERSION) < 0
165
167
 
166
168
  if (!dataBinding) {
167
169
  return
168
170
  }
169
171
  switch (dataBinding.handlerType) {
172
+ case HandlerType.ETH_LOG:
173
+ const ethLog = dataBinding.data?.ethLog
174
+ if (ethLog?.log == null && ethLog?.rawLog) {
175
+ ethLog.log = JSON.parse(ethLog.rawLog)
176
+ ethLog.transaction = ethLog.rawTransaction ? JSON.parse(ethLog.rawTransaction) : undefined
177
+ ethLog.block = ethLog.rawBlock ? JSON.parse(ethLog.rawBlock) : undefined
178
+ ethLog.transactionReceipt = ethLog.rawTransactionReceipt
179
+ ? JSON.parse(ethLog.rawTransactionReceipt)
180
+ : undefined
181
+ }
182
+ break
183
+ case HandlerType.ETH_TRANSACTION:
184
+ const ethTx = dataBinding.data?.ethTransaction
185
+ if (ethTx?.transaction == null && ethTx?.rawTransaction) {
186
+ ethTx.transaction = JSON.parse(ethTx.rawTransaction)
187
+ ethTx.block = ethTx.rawBlock ? JSON.parse(ethTx.rawBlock) : undefined
188
+ ethTx.transactionReceipt = ethTx.rawTransactionReceipt ? JSON.parse(ethTx.rawTransactionReceipt) : undefined
189
+ }
190
+ break
170
191
  case HandlerType.FUEL_TRANSACTION:
171
192
  if (compareSemver(this.sdkVersion, FUEL_PROTO_UPDATE_VERSION) < 0) {
172
193
  dataBinding.handlerType = HandlerType.FUEL_CALL
@@ -1118,6 +1118,10 @@ export interface Data_EthLog {
1118
1118
  transaction?: { [key: string]: any } | undefined;
1119
1119
  transactionReceipt?: { [key: string]: any } | undefined;
1120
1120
  block?: { [key: string]: any } | undefined;
1121
+ rawLog: string;
1122
+ rawTransaction?: string | undefined;
1123
+ rawTransactionReceipt?: string | undefined;
1124
+ rawBlock?: string | undefined;
1121
1125
  }
1122
1126
 
1123
1127
  export interface Data_EthBlock {
@@ -1130,6 +1134,10 @@ export interface Data_EthTransaction {
1130
1134
  transactionReceipt?: { [key: string]: any } | undefined;
1131
1135
  block?: { [key: string]: any } | undefined;
1132
1136
  trace?: { [key: string]: any } | undefined;
1137
+ rawTransaction: string;
1138
+ rawTransactionReceipt?: string | undefined;
1139
+ rawBlock?: string | undefined;
1140
+ rawTrace?: string | undefined;
1133
1141
  }
1134
1142
 
1135
1143
  export interface Data_EthTrace {
@@ -9607,6 +9615,10 @@ function createBaseData_EthLog(): Data_EthLog {
9607
9615
  transaction: undefined,
9608
9616
  transactionReceipt: undefined,
9609
9617
  block: undefined,
9618
+ rawLog: "",
9619
+ rawTransaction: undefined,
9620
+ rawTransactionReceipt: undefined,
9621
+ rawBlock: undefined,
9610
9622
  };
9611
9623
  }
9612
9624
 
@@ -9627,6 +9639,18 @@ export const Data_EthLog = {
9627
9639
  if (message.block !== undefined) {
9628
9640
  Struct.encode(Struct.wrap(message.block), writer.uint32(50).fork()).ldelim();
9629
9641
  }
9642
+ if (message.rawLog !== "") {
9643
+ writer.uint32(58).string(message.rawLog);
9644
+ }
9645
+ if (message.rawTransaction !== undefined) {
9646
+ writer.uint32(66).string(message.rawTransaction);
9647
+ }
9648
+ if (message.rawTransactionReceipt !== undefined) {
9649
+ writer.uint32(74).string(message.rawTransactionReceipt);
9650
+ }
9651
+ if (message.rawBlock !== undefined) {
9652
+ writer.uint32(82).string(message.rawBlock);
9653
+ }
9630
9654
  return writer;
9631
9655
  },
9632
9656
 
@@ -9672,6 +9696,34 @@ export const Data_EthLog = {
9672
9696
 
9673
9697
  message.block = Struct.unwrap(Struct.decode(reader, reader.uint32()));
9674
9698
  continue;
9699
+ case 7:
9700
+ if (tag !== 58) {
9701
+ break;
9702
+ }
9703
+
9704
+ message.rawLog = reader.string();
9705
+ continue;
9706
+ case 8:
9707
+ if (tag !== 66) {
9708
+ break;
9709
+ }
9710
+
9711
+ message.rawTransaction = reader.string();
9712
+ continue;
9713
+ case 9:
9714
+ if (tag !== 74) {
9715
+ break;
9716
+ }
9717
+
9718
+ message.rawTransactionReceipt = reader.string();
9719
+ continue;
9720
+ case 10:
9721
+ if (tag !== 82) {
9722
+ break;
9723
+ }
9724
+
9725
+ message.rawBlock = reader.string();
9726
+ continue;
9675
9727
  }
9676
9728
  if ((tag & 7) === 4 || tag === 0) {
9677
9729
  break;
@@ -9688,6 +9740,12 @@ export const Data_EthLog = {
9688
9740
  transaction: isObject(object.transaction) ? object.transaction : undefined,
9689
9741
  transactionReceipt: isObject(object.transactionReceipt) ? object.transactionReceipt : undefined,
9690
9742
  block: isObject(object.block) ? object.block : undefined,
9743
+ rawLog: isSet(object.rawLog) ? globalThis.String(object.rawLog) : "",
9744
+ rawTransaction: isSet(object.rawTransaction) ? globalThis.String(object.rawTransaction) : undefined,
9745
+ rawTransactionReceipt: isSet(object.rawTransactionReceipt)
9746
+ ? globalThis.String(object.rawTransactionReceipt)
9747
+ : undefined,
9748
+ rawBlock: isSet(object.rawBlock) ? globalThis.String(object.rawBlock) : undefined,
9691
9749
  };
9692
9750
  },
9693
9751
 
@@ -9708,6 +9766,18 @@ export const Data_EthLog = {
9708
9766
  if (message.block !== undefined) {
9709
9767
  obj.block = message.block;
9710
9768
  }
9769
+ if (message.rawLog !== "") {
9770
+ obj.rawLog = message.rawLog;
9771
+ }
9772
+ if (message.rawTransaction !== undefined) {
9773
+ obj.rawTransaction = message.rawTransaction;
9774
+ }
9775
+ if (message.rawTransactionReceipt !== undefined) {
9776
+ obj.rawTransactionReceipt = message.rawTransactionReceipt;
9777
+ }
9778
+ if (message.rawBlock !== undefined) {
9779
+ obj.rawBlock = message.rawBlock;
9780
+ }
9711
9781
  return obj;
9712
9782
  },
9713
9783
 
@@ -9721,6 +9791,10 @@ export const Data_EthLog = {
9721
9791
  message.transaction = object.transaction ?? undefined;
9722
9792
  message.transactionReceipt = object.transactionReceipt ?? undefined;
9723
9793
  message.block = object.block ?? undefined;
9794
+ message.rawLog = object.rawLog ?? "";
9795
+ message.rawTransaction = object.rawTransaction ?? undefined;
9796
+ message.rawTransactionReceipt = object.rawTransactionReceipt ?? undefined;
9797
+ message.rawBlock = object.rawBlock ?? undefined;
9724
9798
  return message;
9725
9799
  },
9726
9800
  };
@@ -9789,6 +9863,10 @@ function createBaseData_EthTransaction(): Data_EthTransaction {
9789
9863
  transactionReceipt: undefined,
9790
9864
  block: undefined,
9791
9865
  trace: undefined,
9866
+ rawTransaction: "",
9867
+ rawTransactionReceipt: undefined,
9868
+ rawBlock: undefined,
9869
+ rawTrace: undefined,
9792
9870
  };
9793
9871
  }
9794
9872
 
@@ -9809,6 +9887,18 @@ export const Data_EthTransaction = {
9809
9887
  if (message.trace !== undefined) {
9810
9888
  Struct.encode(Struct.wrap(message.trace), writer.uint32(58).fork()).ldelim();
9811
9889
  }
9890
+ if (message.rawTransaction !== "") {
9891
+ writer.uint32(66).string(message.rawTransaction);
9892
+ }
9893
+ if (message.rawTransactionReceipt !== undefined) {
9894
+ writer.uint32(74).string(message.rawTransactionReceipt);
9895
+ }
9896
+ if (message.rawBlock !== undefined) {
9897
+ writer.uint32(82).string(message.rawBlock);
9898
+ }
9899
+ if (message.rawTrace !== undefined) {
9900
+ writer.uint32(90).string(message.rawTrace);
9901
+ }
9812
9902
  return writer;
9813
9903
  },
9814
9904
 
@@ -9854,6 +9944,34 @@ export const Data_EthTransaction = {
9854
9944
 
9855
9945
  message.trace = Struct.unwrap(Struct.decode(reader, reader.uint32()));
9856
9946
  continue;
9947
+ case 8:
9948
+ if (tag !== 66) {
9949
+ break;
9950
+ }
9951
+
9952
+ message.rawTransaction = reader.string();
9953
+ continue;
9954
+ case 9:
9955
+ if (tag !== 74) {
9956
+ break;
9957
+ }
9958
+
9959
+ message.rawTransactionReceipt = reader.string();
9960
+ continue;
9961
+ case 10:
9962
+ if (tag !== 82) {
9963
+ break;
9964
+ }
9965
+
9966
+ message.rawBlock = reader.string();
9967
+ continue;
9968
+ case 11:
9969
+ if (tag !== 90) {
9970
+ break;
9971
+ }
9972
+
9973
+ message.rawTrace = reader.string();
9974
+ continue;
9857
9975
  }
9858
9976
  if ((tag & 7) === 4 || tag === 0) {
9859
9977
  break;
@@ -9870,6 +9988,12 @@ export const Data_EthTransaction = {
9870
9988
  transactionReceipt: isObject(object.transactionReceipt) ? object.transactionReceipt : undefined,
9871
9989
  block: isObject(object.block) ? object.block : undefined,
9872
9990
  trace: isObject(object.trace) ? object.trace : undefined,
9991
+ rawTransaction: isSet(object.rawTransaction) ? globalThis.String(object.rawTransaction) : "",
9992
+ rawTransactionReceipt: isSet(object.rawTransactionReceipt)
9993
+ ? globalThis.String(object.rawTransactionReceipt)
9994
+ : undefined,
9995
+ rawBlock: isSet(object.rawBlock) ? globalThis.String(object.rawBlock) : undefined,
9996
+ rawTrace: isSet(object.rawTrace) ? globalThis.String(object.rawTrace) : undefined,
9873
9997
  };
9874
9998
  },
9875
9999
 
@@ -9890,6 +10014,18 @@ export const Data_EthTransaction = {
9890
10014
  if (message.trace !== undefined) {
9891
10015
  obj.trace = message.trace;
9892
10016
  }
10017
+ if (message.rawTransaction !== "") {
10018
+ obj.rawTransaction = message.rawTransaction;
10019
+ }
10020
+ if (message.rawTransactionReceipt !== undefined) {
10021
+ obj.rawTransactionReceipt = message.rawTransactionReceipt;
10022
+ }
10023
+ if (message.rawBlock !== undefined) {
10024
+ obj.rawBlock = message.rawBlock;
10025
+ }
10026
+ if (message.rawTrace !== undefined) {
10027
+ obj.rawTrace = message.rawTrace;
10028
+ }
9893
10029
  return obj;
9894
10030
  },
9895
10031
 
@@ -9903,6 +10039,10 @@ export const Data_EthTransaction = {
9903
10039
  message.transactionReceipt = object.transactionReceipt ?? undefined;
9904
10040
  message.block = object.block ?? undefined;
9905
10041
  message.trace = object.trace ?? undefined;
10042
+ message.rawTransaction = object.rawTransaction ?? "";
10043
+ message.rawTransactionReceipt = object.rawTransactionReceipt ?? undefined;
10044
+ message.rawBlock = object.rawBlock ?? undefined;
10045
+ message.rawTrace = object.rawTrace ?? undefined;
9906
10046
  return message;
9907
10047
  },
9908
10048
  };
package/src/service.ts CHANGED
@@ -418,7 +418,6 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
418
418
  subject: Subject<DeepPartial<ProcessStreamResponse>>
419
419
  ) {
420
420
  const contexts = new Contexts()
421
-
422
421
  for await (const request of requests) {
423
422
  try {
424
423
  // console.debug('received request:', request)