@@ -26,6 +26,7 @@ const TEST_EVENT = {
26
26
] ,
27
27
} ,
28
28
{ name : 'd' , type : 'string' , indexed : true } ,
29
+ { name : 'id' , type : 'string' } ,
29
30
] ,
30
31
} ;
31
32
@@ -106,7 +107,7 @@ dataSources:
106
107
- name: Contract
107
108
file: ./abis/Contract.json
108
109
eventHandlers:
109
- - event: ExampleEvent(indexed uint256,bytes[4],string,(uint256,bytes32,string,(uint96,string,bytes32)),indexed string)
110
+ - event: ExampleEvent(indexed uint256,bytes[4],string,(uint256,bytes32,string,(uint96,string,bytes32)),indexed string,string )
110
111
handler: handleExampleEvent
111
112
- event: ExampleEvent(bytes32)
112
113
handler: handleExampleEvent1
@@ -139,6 +140,7 @@ type ExampleEvent @entity(immutable: true) {
139
140
c_c3_value1: String! # string
140
141
c_c3_value2: Bytes! # bytes32
141
142
d: String! # string
143
+ internal_id: String! # string
142
144
blockNumber: BigInt!
143
145
blockTimestamp: BigInt!
144
146
transactionHash: Bytes!
@@ -233,6 +235,7 @@ export function handleExampleEvent(event: ExampleEventEvent): void {
233
235
entity.c_c3_value1 = event.params.c.c3.value1
234
236
entity.c_c3_value2 = event.params.c.c3.value2
235
237
entity.d = event.params.d
238
+ entity.internal_id = event.params.id
236
239
237
240
entity.blockNumber = event.block.number
238
241
entity.blockTimestamp = event.block.timestamp
@@ -285,7 +288,8 @@ describe("Describe entity assertions", () => {
285
288
let param2 = "Example string value"
286
289
let c = "ethereum.Tuple Not implemented"
287
290
let d = "Example string value"
288
- let newExampleEventEvent = createExampleEventEvent(a, b, param2, c, d)
291
+ let id = "Example string value"
292
+ let newExampleEventEvent = createExampleEventEvent(a, b, param2, c, d, id)
289
293
handleExampleEvent(newExampleEventEvent)
290
294
})
291
295
@@ -346,7 +350,8 @@ export function createExampleEventEvent(
346
350
b: Array<Bytes>,
347
351
param2: string,
348
352
c: ethereum.Tuple,
349
- d: string
353
+ d: string,
354
+ id: string
350
355
): ExampleEvent {
351
356
let exampleEventEvent = changetype<ExampleEvent>(newMockEvent())
352
357
@@ -367,6 +372,9 @@ export function createExampleEventEvent(
367
372
exampleEventEvent.parameters.push(
368
373
new ethereum.EventParam("d", ethereum.Value.fromString(d))
369
374
)
375
+ exampleEventEvent.parameters.push(
376
+ new ethereum.EventParam("id", ethereum.Value.fromString(id))
377
+ )
370
378
371
379
return exampleEventEvent
372
380
}
@@ -415,7 +423,8 @@ describe("Describe entity assertions", () => {
415
423
let param2 = "Example string value"
416
424
let c = "ethereum.Tuple Not implemented"
417
425
let d = "Example string value"
418
- let newExampleEventEvent = createExampleEventEvent(a, b, param2, c, d)
426
+ let id = "Example string value"
427
+ let newExampleEventEvent = createExampleEventEvent(a, b, param2, c, d, id)
419
428
handleExampleEvent(newExampleEventEvent)
420
429
})
421
430
@@ -476,7 +485,8 @@ export function createExampleEventEvent(
476
485
b: Array<Bytes>,
477
486
param2: string,
478
487
c: ethereum.Tuple,
479
- d: string
488
+ d: string,
489
+ id: string
480
490
): ExampleEvent {
481
491
let exampleEventEvent = changetype<ExampleEvent>(newMockEvent())
482
492
@@ -497,6 +507,9 @@ export function createExampleEventEvent(
497
507
exampleEventEvent.parameters.push(
498
508
new ethereum.EventParam("d", ethereum.Value.fromString(d))
499
509
)
510
+ exampleEventEvent.parameters.push(
511
+ new ethereum.EventParam("id", ethereum.Value.fromString(id))
512
+ )
500
513
501
514
return exampleEventEvent
502
515
}
0 commit comments