Skip to content

Commit

Permalink
Merge pull request #41 from maticnetwork/sync-data-to-string
Browse files Browse the repository at this point in the history
sync data to string from bytes.
  • Loading branch information
reddyismav authored Jun 2, 2021
2 parents 1a5843d + 45b3b3e commit 6da5cd6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion root/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type StateSync @entity {
syncType: Int!
depositorOrRootToken: String!
depositedTokenOrChildToken: String!
data: Bytes!
data: String!
transactionHash: Bytes!
timestamp: BigInt!
}
Expand Down
4 changes: 2 additions & 2 deletions root/src/mappings/state-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions root/src/mappings/withdraw-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit 6da5cd6

Please sign in to comment.