@sentio/sdk 2.12.3 → 2.13.0-rc.1
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/aptos/aptos-processor.d.ts +1 -1
- package/lib/aptos/aptos-processor.js +16 -8
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/builtin/0x1.d.ts +106 -106
- package/lib/aptos/builtin/0x1.js.map +1 -1
- package/lib/aptos/builtin/0x3.d.ts +14 -14
- package/lib/aptos/builtin/0x3.js.map +1 -1
- package/lib/aptos/context.d.ts +2 -1
- package/lib/aptos/context.js +4 -2
- package/lib/aptos/context.js.map +1 -1
- package/lib/move/abstract-codegen.js +1 -1
- package/lib/move/abstract-codegen.js.map +1 -1
- package/lib/sui/builtin/0x2.d.ts +24 -24
- package/lib/sui/builtin/0x2.js.map +1 -1
- package/lib/sui/builtin/0x3.d.ts +34 -34
- package/lib/sui/builtin/0x3.js.map +1 -1
- package/lib/sui/sui-processor.d.ts +2 -2
- package/lib/sui/sui-processor.js +2 -2
- package/lib/sui/sui-processor.js.map +1 -1
- package/lib/testing/aptos-facet.d.ts +2 -2
- package/lib/testing/aptos-facet.js +14 -21
- package/lib/testing/aptos-facet.js.map +1 -1
- package/package.json +4 -4
- package/src/aptos/aptos-processor.ts +28 -17
- package/src/aptos/builtin/0x1.ts +106 -106
- package/src/aptos/builtin/0x3.ts +14 -14
- package/src/aptos/context.ts +5 -2
- package/src/move/abstract-codegen.ts +1 -1
- package/src/sui/builtin/0x2.ts +24 -24
- package/src/sui/builtin/0x3.ts +34 -34
- package/src/sui/sui-processor.ts +4 -4
- package/src/testing/aptos-facet.ts +13 -27
@@ -2,7 +2,7 @@ import { Transaction_UserTransaction, TransactionPayload_EntryFunctionPayload }
|
|
2
2
|
import { DataBinding, HandlerType } from '@sentio/protos'
|
3
3
|
import { getChainId } from '../aptos/network.js'
|
4
4
|
import { TestProcessorServer } from './test-processor-server.js'
|
5
|
-
import { AptosNetwork
|
5
|
+
import { AptosNetwork } from '@sentio/sdk/aptos'
|
6
6
|
import { parseMoveType } from '../move/types.js'
|
7
7
|
|
8
8
|
export class AptosFacet {
|
@@ -57,19 +57,8 @@ export class AptosFacet {
|
|
57
57
|
return undefined
|
58
58
|
}
|
59
59
|
|
60
|
-
testEvent(
|
61
|
-
transaction
|
62
|
-
event: number | Event,
|
63
|
-
network: AptosNetwork = AptosNetwork.MAIN_NET
|
64
|
-
) {
|
65
|
-
if (typeof event !== 'number') {
|
66
|
-
const transaction2: Transaction_UserTransaction = {} as any
|
67
|
-
Object.assign(transaction2, transaction)
|
68
|
-
transaction = transaction2
|
69
|
-
transaction.events = [event]
|
70
|
-
event = 0
|
71
|
-
}
|
72
|
-
const binding = this.buildEventBinding(transaction, event, network)
|
60
|
+
testEvent(transaction: Transaction_UserTransaction, network: AptosNetwork = AptosNetwork.MAIN_NET) {
|
61
|
+
const binding = this.buildEventBinding(transaction, network)
|
73
62
|
if (!binding) {
|
74
63
|
throw Error('Invalid test event: ' + JSON.stringify(transaction))
|
75
64
|
}
|
@@ -78,7 +67,6 @@ export class AptosFacet {
|
|
78
67
|
|
79
68
|
private buildEventBinding(
|
80
69
|
transaction: Transaction_UserTransaction,
|
81
|
-
eventIdx: number,
|
82
70
|
network: AptosNetwork = AptosNetwork.MAIN_NET
|
83
71
|
): DataBinding | undefined {
|
84
72
|
// const allEvents = new Set(transaction.events.map(e => e.type))
|
@@ -88,19 +76,17 @@ export class AptosFacet {
|
|
88
76
|
}
|
89
77
|
for (const eventConfig of config.moveEventConfigs) {
|
90
78
|
for (const eventFilter of eventConfig.filters) {
|
91
|
-
|
92
|
-
config.contract.address + '::' + eventFilter.type ===
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
aptEvent: {
|
99
|
-
transaction,
|
79
|
+
for (const event of transaction.events) {
|
80
|
+
if (config.contract.address + '::' + eventFilter.type === parseMoveType(event.type).qname) {
|
81
|
+
return {
|
82
|
+
data: {
|
83
|
+
aptEvent: {
|
84
|
+
transaction,
|
85
|
+
},
|
100
86
|
},
|
101
|
-
|
102
|
-
|
103
|
-
|
87
|
+
handlerIds: [eventConfig.handlerId],
|
88
|
+
handlerType: HandlerType.APT_EVENT,
|
89
|
+
}
|
104
90
|
}
|
105
91
|
}
|
106
92
|
}
|