diff --git a/subgraph/src/order.ts b/subgraph/src/order.ts index efc55e97a..826a1950b 100644 --- a/subgraph/src/order.ts +++ b/subgraph/src/order.ts @@ -68,7 +68,7 @@ export function createAddOrderEntity(event: AddOrderV2): void { let addOrder = new AddOrder(event.transaction.hash); addOrder.id = eventId(event); addOrder.orderbook = event.address; - addOrder.order = event.params.orderHash; + addOrder.order = makeOrderId(event.address, event.params.orderHash); addOrder.sender = event.params.sender; addOrder.transaction = createTransactionEntity(event); addOrder.save(); @@ -78,7 +78,7 @@ export function createRemoveOrderEntity(event: RemoveOrderV2): void { let removeOrder = new RemoveOrder(event.transaction.hash); removeOrder.id = eventId(event); removeOrder.orderbook = event.address; - removeOrder.order = event.params.orderHash; + removeOrder.order = makeOrderId(event.address, event.params.orderHash); removeOrder.sender = event.params.sender; removeOrder.transaction = createTransactionEntity(event); removeOrder.save(); diff --git a/subgraph/tests/order.test.ts b/subgraph/tests/order.test.ts index 85eee91df..d39b2b984 100644 --- a/subgraph/tests/order.test.ts +++ b/subgraph/tests/order.test.ts @@ -205,11 +205,13 @@ describe("Add and remove orders", () => { let id = eventId(event); + let orderid = makeOrderId(event.address, event.params.orderHash); + assert.fieldEquals( "AddOrder", id.toHexString(), "order", - "0x0987654321098765432109876543210987654321" + orderid.toHexString() ); assert.fieldEquals( @@ -260,11 +262,13 @@ describe("Add and remove orders", () => { let id = eventId(event); + let orderid = makeOrderId(event.address, event.params.orderHash); + assert.fieldEquals( "RemoveOrder", id.toHexString(), "order", - "0x0987654321098765432109876543210987654321" + orderid.toHexString() ); assert.fieldEquals(