From 45b3b3e239d20eac2f342491c3fe1fca82e97bc1 Mon Sep 17 00:00:00 2001 From: Vamsi Date: Wed, 2 Jun 2021 13:50:57 +0530 Subject: [PATCH] sync data to string --- root/schema.graphql | 2 +- root/src/mappings/state-sync.ts | 4 ++-- root/src/mappings/withdraw-manager.ts | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/root/schema.graphql b/root/schema.graphql index 73a6911..e380491 100644 --- a/root/schema.graphql +++ b/root/schema.graphql @@ -18,7 +18,7 @@ type StateSync @entity { syncType: Int! depositorOrRootToken: String! depositedTokenOrChildToken: String! - data: Bytes! + data: String! transactionHash: Bytes! timestamp: BigInt! } diff --git a/root/src/mappings/state-sync.ts b/root/src/mappings/state-sync.ts index b67c774..a24bf41 100644 --- a/root/src/mappings/state-sync.ts +++ b/root/src/mappings/state-sync.ts @@ -35,7 +35,7 @@ export function handleStateSynced(event: StateSynced): void { entity.syncType = -1 entity.depositorOrRootToken = '0x' entity.depositedTokenOrChildToken = '0x' - entity.data = event.params.data + entity.data = event.params.data.toString() // save entity entity.save() @@ -51,7 +51,7 @@ export function handleStateSynced(event: StateSynced): void { entity.syncType = decoded.value0 entity.depositorOrRootToken = decoded.value1.toHex() entity.depositedTokenOrChildToken = decoded.value2.toHex() - entity.data = decoded.value3 + entity.data = decoded.value3.toString() // save entity entity.save() diff --git a/root/src/mappings/withdraw-manager.ts b/root/src/mappings/withdraw-manager.ts index f40e580..9db9955 100644 --- a/root/src/mappings/withdraw-manager.ts +++ b/root/src/mappings/withdraw-manager.ts @@ -52,6 +52,7 @@ export function handleExitCancelled(event: ExitCancelled): void { if (entity == null) { entity = new PlasmaExit(id) + entity.counter = BigInt.fromI32(0) entity.isRegularExit = true entity.exited = 1 } @@ -77,6 +78,7 @@ export function handleWithdraw(event: Withdraw): void { if (entity == null) { entity = new PlasmaExit(id) + entity.counter = BigInt.fromI32(0) entity.isRegularExit = true entity.exited = 2 }