Skip to content

Commit

Permalink
rename endpoint to protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
fewensa committed Aug 22, 2023
1 parent 74e0f62 commit 08bb85b
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 112 deletions.
File renamed without changes.
8 changes: 4 additions & 4 deletions thegraph/ormpipe/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"AirnodeDapi": {
"address": "0xa681492DBAd5a3999cFCE2d72196d5784dd08D0c"
},
"OrmpEndpoint": {
"address": "0x00000000fec9f746a2138D9C6f42794236f3aca8"
},
"OrmpOracle": {
"address": "0x00000012f877F68a8D2410b683FDC8214f4b5194"
},
"OrmpRelayer": {
"address": "0x000000fbfBc6954C8CBba3130b5Aee7f3Ea5108e"
},
"OrmpProtocol": {
"address": "0x00000000fec9f746a2138D9C6f42794236f3aca8"
}
}
}
}
108 changes: 54 additions & 54 deletions thegraph/ormpipe/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -48,141 +48,141 @@ type RemoveBeacon @entity(immutable: true) {

## ---

type OrmpEndpointAppConfigUpdated @entity(immutable: true) {
type OrmpOracleAssigned @entity(immutable: true) {
id: Bytes!
ua: Bytes! # address
oracle: Bytes! # address
relayer: Bytes! # address
msgHash: Bytes! # bytes32
fee: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpEndpointClearFailedMessage @entity(immutable: true) {
type OrmpOracleSetApproved @entity(immutable: true) {
id: Bytes!
msgHash: Bytes! # bytes32
operator: Bytes! # address
approve: Boolean! # bool
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpEndpointMessageAccepted @entity(immutable: true) {
type OrmpOracleSetDapi @entity(immutable: true) {
id: Bytes!
msgHash: Bytes! # bytes32
root: Bytes! # bytes32
message_channel: Bytes! # address
message_index: BigInt! # uint256
message_fromChainId: BigInt! # uint256
message_from: Bytes! # address
message_toChainId: BigInt! # uint256
message_to: Bytes! # address
message_encoded: Bytes! # bytes
chainId: BigInt! # uint256
dapi: Bytes! # address
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpEndpointMessageDispatched @entity(immutable: true) {
type OrmpOracleSetFee @entity(immutable: true) {
id: Bytes!
msgHash: Bytes! # bytes32
dispatchResult: Boolean! # bool
chainId: BigInt! # uint256
fee: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpEndpointRetryFailedMessage @entity(immutable: true) {
## ---

type OrmpRelayerAssigned @entity(immutable: true) {
id: Bytes!
msgHash: Bytes! # bytes32
dispatchResult: Boolean! # bool
fee: BigInt! # uint256
parmas: Bytes! # bytes
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpEndpointSetDefaultConfig @entity(immutable: true) {
type OrmpRelayerSetApproved @entity(immutable: true) {
id: Bytes!
oracle: Bytes! # address
relayer: Bytes! # address
operator: Bytes! # address
approve: Boolean! # bool
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

## ---

type OrmpOracleAssigned @entity(immutable: true) {
type OrmpRelayerSetDstConfig @entity(immutable: true) {
id: Bytes!
msgHash: Bytes! # bytes32
fee: BigInt! # uint256
chainId: BigInt! # uint256
baseGas: BigInt! # uint64
gasPerByte: BigInt! # uint64
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpOracleSetApproved @entity(immutable: true) {
type OrmpRelayerSetDstPrice @entity(immutable: true) {
id: Bytes!
operator: Bytes! # address
approve: Boolean! # bool
chainId: BigInt! # uint256
dstPriceRatio: BigInt! # uint128
dstGasPriceInWei: BigInt! # uint128
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpOracleSetDapi @entity(immutable: true) {
## ---

type OrmpProtocolAppConfigUpdated @entity(immutable: true) {
id: Bytes!
chainId: BigInt! # uint256
dapi: Bytes! # address
ua: Bytes! # address
oracle: Bytes! # address
relayer: Bytes! # address
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpOracleSetFee @entity(immutable: true) {
type OrmpProtocolClearFailedMessage @entity(immutable: true) {
id: Bytes!
chainId: BigInt! # uint256
fee: BigInt! # uint256
msgHash: Bytes! # bytes32
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

## ---

type OrmpRelayerAssigned @entity(immutable: true) {
type OrmpProtocolMessageAccepted @entity(immutable: true) {
id: Bytes!
msgHash: Bytes! # bytes32
fee: BigInt! # uint256
parmas: Bytes! # bytes
root: Bytes! # bytes32
message_channel: Bytes! # address
message_index: BigInt! # uint256
message_fromChainId: BigInt! # uint256
message_from: Bytes! # address
message_toChainId: BigInt! # uint256
message_to: Bytes! # address
message_encoded: Bytes! # bytes
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpRelayerSetApproved @entity(immutable: true) {
type OrmpProtocolMessageDispatched @entity(immutable: true) {
id: Bytes!
operator: Bytes! # address
approve: Boolean! # bool
msgHash: Bytes! # bytes32
dispatchResult: Boolean! # bool
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpRelayerSetDstConfig @entity(immutable: true) {
type OrmpProtocolRetryFailedMessage @entity(immutable: true) {
id: Bytes!
chainId: BigInt! # uint256
baseGas: BigInt! # uint64
gasPerByte: BigInt! # uint64
msgHash: Bytes! # bytes32
dispatchResult: Boolean! # bool
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OrmpRelayerSetDstPrice @entity(immutable: true) {
type OrmpProtocolSetDefaultConfig @entity(immutable: true) {
id: Bytes!
chainId: BigInt! # uint256
dstPriceRatio: BigInt! # uint128
dstGasPriceInWei: BigInt! # uint128
oracle: Bytes! # address
relayer: Bytes! # address
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import {
MessageDispatched as MessageDispatchedEvent,
RetryFailedMessage as RetryFailedMessageEvent,
SetDefaultConfig as SetDefaultConfigEvent
} from "../generated/OrmpEndpoint/OrmpEndpoint"
} from "../generated/OrmpProtocol/OrmpProtocol"
import {
OrmpEndpointAppConfigUpdated,
OrmpEndpointClearFailedMessage,
OrmpEndpointMessageAccepted,
OrmpEndpointMessageDispatched,
OrmpEndpointRetryFailedMessage,
OrmpEndpointSetDefaultConfig
OrmpProtocolAppConfigUpdated,
OrmpProtocolClearFailedMessage,
OrmpProtocolMessageAccepted,
OrmpProtocolMessageDispatched,
OrmpProtocolRetryFailedMessage,
OrmpProtocolSetDefaultConfig
} from "../generated/schema"

export function handleAppConfigUpdated(event: AppConfigUpdatedEvent): void {
let entity = new OrmpEndpointAppConfigUpdated(
let entity = new OrmpProtocolAppConfigUpdated(
event.transaction.hash.concatI32(event.logIndex.toI32())
)
entity.ua = event.params.ua
Expand All @@ -31,7 +31,7 @@ export function handleAppConfigUpdated(event: AppConfigUpdatedEvent): void {
}

export function handleClearFailedMessage(event: ClearFailedMessageEvent): void {
let entity = new OrmpEndpointClearFailedMessage(
let entity = new OrmpProtocolClearFailedMessage(
event.transaction.hash.concatI32(event.logIndex.toI32())
)
entity.msgHash = event.params.msgHash
Expand All @@ -44,7 +44,7 @@ export function handleClearFailedMessage(event: ClearFailedMessageEvent): void {
}

export function handleMessageAccepted(event: MessageAcceptedEvent): void {
let entity = new OrmpEndpointMessageAccepted(
let entity = new OrmpProtocolMessageAccepted(
event.transaction.hash.concatI32(event.logIndex.toI32())
)
entity.msgHash = event.params.msgHash
Expand All @@ -65,7 +65,7 @@ export function handleMessageAccepted(event: MessageAcceptedEvent): void {
}

export function handleMessageDispatched(event: MessageDispatchedEvent): void {
let entity = new OrmpEndpointMessageDispatched(
let entity = new OrmpProtocolMessageDispatched(
event.transaction.hash.concatI32(event.logIndex.toI32())
)
entity.msgHash = event.params.msgHash
Expand All @@ -79,7 +79,7 @@ export function handleMessageDispatched(event: MessageDispatchedEvent): void {
}

export function handleRetryFailedMessage(event: RetryFailedMessageEvent): void {
let entity = new OrmpEndpointRetryFailedMessage(
let entity = new OrmpProtocolRetryFailedMessage(
event.transaction.hash.concatI32(event.logIndex.toI32())
)
entity.msgHash = event.params.msgHash
Expand All @@ -93,7 +93,7 @@ export function handleRetryFailedMessage(event: RetryFailedMessageEvent): void {
}

export function handleSetDefaultConfig(event: SetDefaultConfigEvent): void {
let entity = new OrmpEndpointSetDefaultConfig(
let entity = new OrmpProtocolSetDefaultConfig(
event.transaction.hash.concatI32(event.logIndex.toI32())
)
entity.oracle = event.params.oracle
Expand Down
72 changes: 36 additions & 36 deletions thegraph/ormpipe/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,6 @@ dataSources:
- event: RemoveBeacon(indexed bytes32)
handler: handleRemoveBeacon
file: ./src/airnode-dapi.ts
- kind: ethereum
name: OrmpEndpoint
network: arbitrum-goerli
source:
address: "0x00000000fec9f746a2138D9C6f42794236f3aca8"
abi: OrmpEndpoint
startBlock: 35033761
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- AppConfigUpdated
- ClearFailedMessage
- OrmpEndpointMessageAccepted
- OrmpEndpointMessageDispatched
- RetryFailedMessage
- SetDefaultConfig
abis:
- name: OrmpEndpoint
file: ./abis/OrmpEndpoint.json
eventHandlers:
- event: AppConfigUpdated(indexed address,address,address)
handler: handleAppConfigUpdated
- event: ClearFailedMessage(indexed bytes32)
handler: handleClearFailedMessage
- event: MessageAccepted(indexed
bytes32,bytes32,(address,uint256,uint256,address,uint256,address,bytes))
handler: handleMessageAccepted
- event: MessageDispatched(indexed bytes32,bool)
handler: handleMessageDispatched
- event: RetryFailedMessage(indexed bytes32,bool)
handler: handleRetryFailedMessage
- event: SetDefaultConfig(address,address)
handler: handleSetDefaultConfig
file: ./src/ormp-endpoint.ts
- kind: ethereum
name: OrmpOracle
network: arbitrum-goerli
Expand Down Expand Up @@ -128,3 +92,39 @@ dataSources:
- event: SetDstPrice(indexed uint256,uint128,uint128)
handler: handleSetDstPrice
file: ./src/ormp-relayer.ts
- kind: ethereum
name: OrmpProtocol
network: arbitrum-goerli
source:
address: "0x00000000fec9f746a2138D9C6f42794236f3aca8"
abi: OrmpProtocol
startBlock: 35033761
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- OrmpProtocolAppConfigUpdated
- OrmpProtocolClearFailedMessage
- MessageAccepted
- MessageDispatched
- OrmpProtocolRetryFailedMessage
- OrmpProtocolSetDefaultConfig
abis:
- name: OrmpProtocol
file: ./abis/OrmpProtocol.json
eventHandlers:
- event: AppConfigUpdated(indexed address,address,address)
handler: handleAppConfigUpdated
- event: ClearFailedMessage(indexed bytes32)
handler: handleClearFailedMessage
- event: MessageAccepted(indexed
bytes32,bytes32,(address,uint256,uint256,address,uint256,address,bytes))
handler: handleMessageAccepted
- event: MessageDispatched(indexed bytes32,bool)
handler: handleMessageDispatched
- event: RetryFailedMessage(indexed bytes32,bool)
handler: handleRetryFailedMessage
- event: SetDefaultConfig(address,address)
handler: handleSetDefaultConfig
file: ./src/ormp-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MessageDispatched,
RetryFailedMessage,
SetDefaultConfig
} from "../generated/OrmpEndpoint/OrmpEndpoint"
} from "../generated/OrmpProtocol/OrmpProtocol"

export function createAppConfigUpdatedEvent(
ua: Address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
afterAll
} from "matchstick-as/assembly/index"
import { Address, Bytes } from "@graphprotocol/graph-ts"
import { AppConfigUpdated } from "../generated/schema"
import { AppConfigUpdated as AppConfigUpdatedEvent } from "../generated/OrmpEndpoint/OrmpEndpoint"
import { handleAppConfigUpdated } from "../src/ormp-endpoint"
import { createAppConfigUpdatedEvent } from "./ormp-endpoint-utils"
import { OrmpProtocolAppConfigUpdated } from "../generated/schema"
import { AppConfigUpdated as AppConfigUpdatedEvent } from "../generated/OrmpProtocol/OrmpProtocol"
import { handleAppConfigUpdated } from "../src/ormp-protocol"
import { createAppConfigUpdatedEvent } from "./ormp-protocol-utils"

// Tests structure (matchstick-as >=0.5.0)
// https://thegraph.com/docs/en/developer/matchstick/#tests-structure-0-5-0
Expand Down

0 comments on commit 08bb85b

Please sign in to comment.