Skip to content

Commit 463ea47

Browse files
committed
tests: Make topic-filter test more predictable
Use insertion order instead of transaction hash as the id so that sorting of entities is independent of hashes, and always returns entities in the order in which they were created
1 parent d836f78 commit 463ea47

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tests/integration-tests/topic-filter/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type AnotherTriggerEntity @entity {
2-
id: ID!
2+
id: Int8!
33
a: BigInt
44
b: BigInt
55
c: BigInt

tests/integration-tests/topic-filter/src/mapping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AnotherTrigger } from "../generated/Contract/Contract";
33
import { AnotherTriggerEntity } from "../generated/schema";
44

55
export function handleAnotherTrigger(event: AnotherTrigger): void {
6-
let entity = new AnotherTriggerEntity(event.transaction.hash.toHex());
6+
let entity = new AnotherTriggerEntity("auto");
77
entity.a = event.params.a;
88
entity.b = event.params.b;
99
entity.c = event.params.c;

0 commit comments

Comments
 (0)