Skip to content

Commit

Permalink
add logindex
Browse files Browse the repository at this point in the history
  • Loading branch information
fewensa committed Feb 19, 2024
1 parent 6d8c2a7 commit 1a1c8c7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions thegraph/packages/ormpipe/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,19 @@ type OrmpProtocolMessageAccepted @entity(immutable: true) {
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
logIndex: BigInt!

# ---- oracle
oracleAssigned: Boolean
oracleAssignedFee: BigInt
oracleLogIndex: BigInt!

# ---- relayer
relayerAssigned: Boolean
relayerAssignedFee: BigInt # uint256
relayerAssignedParams: Bytes # bytes
relayerAssignedProof: [Bytes!] # bytes32[32]
relayerLogIndex: BigInt!
}

type OrmpProtocolMessageDispatched @entity(immutable: true) {
Expand Down
1 change: 1 addition & 0 deletions thegraph/packages/ormpipe/src/ormp-oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function handleAssigned(event: AssignedEvent): void {
if (messageAccepted) {
messageAccepted.oracleAssigned = true;
messageAccepted.oracleAssignedFee = entity.fee;
messageAccepted.oracleLogIndex = event.logIndex;
messageAccepted.save();
}
}
Expand Down
1 change: 1 addition & 0 deletions thegraph/packages/ormpipe/src/ormp-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function handleMessageAccepted(event: MessageAcceptedEvent): void {
entity.message_to = event.params.message.to
entity.message_gasLimit = event.params.message.gasLimit
entity.message_encoded = event.params.message.encoded
entity.logIndex = event.logIndex

entity.blockNumber = event.block.number
entity.blockTimestamp = event.block.timestamp
Expand Down
1 change: 1 addition & 0 deletions thegraph/packages/ormpipe/src/ormp-relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function handleAssigned(event: AssignedEvent): void {
messageAccepted.relayerAssignedFee = entity.fee
messageAccepted.relayerAssignedParams = entity.params
messageAccepted.relayerAssignedProof = entity.proof
messageAccepted.relayerLogIndex = event.logIndex;
messageAccepted.save()
}
}
Expand Down

0 comments on commit 1a1c8c7

Please sign in to comment.