diff --git a/.gitignore b/.gitignore index f8c61c2..498d563 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ _env.ts chain.json chain.ts build +subgraph.yaml diff --git a/thegraph/ormpipe/abis/OrmpOracle.json b/thegraph/ormpipe/abis/OrmpOracle.json index 69e2902..20b4a62 100644 --- a/thegraph/ormpipe/abis/OrmpOracle.json +++ b/thegraph/ormpipe/abis/OrmpOracle.json @@ -1,7 +1,8 @@ [ { "inputs": [ - { "internalType": "address", "name": "endpoint", "type": "address" } + { "internalType": "address", "name": "dao", "type": "address" }, + { "internalType": "address", "name": "ormp", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" @@ -84,7 +85,7 @@ }, { "inputs": [], - "name": "ENDPOINT", + "name": "PROTOCOL", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" diff --git a/thegraph/ormpipe/abis/OrmpRelayer.json b/thegraph/ormpipe/abis/OrmpRelayer.json index 6927b5a..04e703a 100644 --- a/thegraph/ormpipe/abis/OrmpRelayer.json +++ b/thegraph/ormpipe/abis/OrmpRelayer.json @@ -2,7 +2,7 @@ { "inputs": [ { "internalType": "address", "name": "dao", "type": "address" }, - { "internalType": "address", "name": "endpoint", "type": "address" } + { "internalType": "address", "name": "ormp", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" @@ -25,8 +25,14 @@ { "indexed": false, "internalType": "bytes", - "name": "parmas", + "name": "params", "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes32[32]", + "name": "proof", + "type": "bytes32[32]" } ], "name": "Assigned", @@ -103,7 +109,7 @@ }, { "inputs": [], - "name": "ENDPOINT", + "name": "PROTOCOL", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" diff --git a/thegraph/ormpipe/networks.json b/thegraph/ormpipe/networks.json index ff757e7..32709f5 100644 --- a/thegraph/ormpipe/networks.json +++ b/thegraph/ormpipe/networks.json @@ -4,13 +4,27 @@ "address": "0xa681492DBAd5a3999cFCE2d72196d5784dd08D0c" }, "OrmpOracle": { - "address": "0x00000012f877F68a8D2410b683FDC8214f4b5194" + "address": "0x000000003e2E2C9C8DD469E129E02E1666898E76" }, "OrmpRelayer": { - "address": "0x000000fbfBc6954C8CBba3130b5Aee7f3Ea5108e" + "address": "0x000000007e24Da6666c773280804d8021E12e13F" }, "OrmpProtocol": { - "address": "0x00000000fec9f746a2138D9C6f42794236f3aca8" + "address": "0x0000000000BD9dcFDa5C60697039E2b3B28b079b" + } + }, + "pangolin": { + "AirnodeDapi": { + "address": "0x770713580e5c618A4D29D7E8c0d7604276B63832" + }, + "OrmpOracle": { + "address": "0x000000003e2E2C9C8DD469E129E02E1666898E76" + }, + "OrmpRelayer": { + "address": "0x000000007e24Da6666c773280804d8021E12e13F" + }, + "OrmpProtocol": { + "address": "0x0000000000BD9dcFDa5C60697039E2b3B28b079b" } } } diff --git a/thegraph/ormpipe/schema.graphql b/thegraph/ormpipe/schema.graphql index 750cd94..38e915f 100644 --- a/thegraph/ormpipe/schema.graphql +++ b/thegraph/ormpipe/schema.graphql @@ -1,5 +1,7 @@ -type AddBeacon @entity(immutable: true) { +# --- airnode dpi + +type AirnodeDapiAddBeacon @entity(immutable: true) { id: Bytes! beaconId: Bytes! # bytes32 beacon_airnode: Bytes! # address @@ -11,7 +13,7 @@ type AddBeacon @entity(immutable: true) { transactionHash: Bytes! } -type AggregatedMessageRoot @entity(immutable: true) { +type AirnodeDapiAggregatedMessageRoot @entity(immutable: true) { id: Bytes! msgRoot: Bytes! # bytes32 blockNumber: BigInt! @@ -19,7 +21,7 @@ type AggregatedMessageRoot @entity(immutable: true) { transactionHash: Bytes! } -type AirnodeRrpCompleted @entity(immutable: true) { +type AirnodeDapiAirnodeRrpCompleted @entity(immutable: true) { id: Bytes! beaconId: Bytes! # bytes32 requestId: Bytes! # bytes32 @@ -29,7 +31,7 @@ type AirnodeRrpCompleted @entity(immutable: true) { transactionHash: Bytes! } -type AirnodeRrpRequested @entity(immutable: true) { +type AirnodeDapiAirnodeRrpRequested @entity(immutable: true) { id: Bytes! beaconId: Bytes! # bytes32 requestId: Bytes! # bytes32 @@ -38,7 +40,7 @@ type AirnodeRrpRequested @entity(immutable: true) { transactionHash: Bytes! } -type RemoveBeacon @entity(immutable: true) { +type AirnodeDapiRemoveBeacon @entity(immutable: true) { id: Bytes! beaconId: Bytes! # bytes32 blockNumber: BigInt! @@ -46,143 +48,143 @@ type RemoveBeacon @entity(immutable: true) { transactionHash: Bytes! } -## --- +# --- ormp protocol -type OrmpOracleAssigned @entity(immutable: true) { +type OrmpProtocolAppConfigUpdated @entity(immutable: true) { id: Bytes! - msgHash: Bytes! # bytes32 - fee: BigInt! # uint256 + ua: Bytes! # address + oracle: Bytes! # address + relayer: Bytes! # address blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpOracleSetApproved @entity(immutable: true) { +type OrmpProtocolClearFailedMessage @entity(immutable: true) { id: Bytes! - operator: Bytes! # address - approve: Boolean! # bool + msgHash: Bytes! # bytes32 blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpOracleSetDapi @entity(immutable: true) { +type OrmpProtocolMessageAccepted @entity(immutable: true) { id: Bytes! - chainId: BigInt! # uint256 - dapi: Bytes! # address + 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 blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpOracleSetFee @entity(immutable: true) { +type OrmpProtocolMessageDispatched @entity(immutable: true) { id: Bytes! - chainId: BigInt! # uint256 - fee: BigInt! # uint256 + msgHash: Bytes! # bytes32 + dispatchResult: Boolean! # bool blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -## --- - -type OrmpRelayerAssigned @entity(immutable: true) { +type OrmpProtocolRetryFailedMessage @entity(immutable: true) { id: Bytes! msgHash: Bytes! # bytes32 - fee: BigInt! # uint256 - parmas: Bytes! # bytes + dispatchResult: Boolean! # bool blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpRelayerSetApproved @entity(immutable: true) { +type OrmpProtocolSetDefaultConfig @entity(immutable: true) { id: Bytes! - operator: Bytes! # address - approve: Boolean! # bool + oracle: Bytes! # address + relayer: Bytes! # address blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpRelayerSetDstConfig @entity(immutable: true) { +## -- ormp oracle + +type OrmpOracleAssigned @entity(immutable: true) { id: Bytes! - chainId: BigInt! # uint256 - baseGas: BigInt! # uint64 - gasPerByte: BigInt! # uint64 + msgHash: Bytes! # bytes32 + fee: BigInt! # uint256 blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpRelayerSetDstPrice @entity(immutable: true) { +type OrmpOracleSetApproved @entity(immutable: true) { id: Bytes! - chainId: BigInt! # uint256 - dstPriceRatio: BigInt! # uint128 - dstGasPriceInWei: BigInt! # uint128 + operator: Bytes! # address + approve: Boolean! # bool blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -## --- - -type OrmpProtocolAppConfigUpdated @entity(immutable: true) { +type OrmpOracleSetDapi @entity(immutable: true) { id: Bytes! - ua: Bytes! # address - oracle: Bytes! # address - relayer: Bytes! # address + chainId: BigInt! # uint256 + dapi: Bytes! # address blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpProtocolClearFailedMessage @entity(immutable: true) { +type OrmpOracleSetFee @entity(immutable: true) { id: Bytes! - msgHash: Bytes! # bytes32 + chainId: BigInt! # uint256 + fee: BigInt! # uint256 blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpProtocolMessageAccepted @entity(immutable: true) { +## -- ormp relayer +type OrmpRelayerAssigned @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 + fee: BigInt! # uint256 + params: Bytes! # bytes + proof: [Bytes!]! # bytes32[32] blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpProtocolMessageDispatched @entity(immutable: true) { +type OrmpRelayerSetApproved @entity(immutable: true) { id: Bytes! - msgHash: Bytes! # bytes32 - dispatchResult: Boolean! # bool + operator: Bytes! # address + approve: Boolean! # bool blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpProtocolRetryFailedMessage @entity(immutable: true) { +type OrmpRelayerSetDstConfig @entity(immutable: true) { id: Bytes! - msgHash: Bytes! # bytes32 - dispatchResult: Boolean! # bool + chainId: BigInt! # uint256 + baseGas: BigInt! # uint64 + gasPerByte: BigInt! # uint64 blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! } -type OrmpProtocolSetDefaultConfig @entity(immutable: true) { +type OrmpRelayerSetDstPrice @entity(immutable: true) { id: Bytes! - oracle: Bytes! # address - relayer: Bytes! # address + chainId: BigInt! # uint256 + dstPriceRatio: BigInt! # uint128 + dstGasPriceInWei: BigInt! # uint128 blockNumber: BigInt! blockTimestamp: BigInt! transactionHash: Bytes! diff --git a/thegraph/ormpipe/src/airnode-dapi.ts b/thegraph/ormpipe/src/airnode-dapi.ts index 023d6a1..8022c80 100644 --- a/thegraph/ormpipe/src/airnode-dapi.ts +++ b/thegraph/ormpipe/src/airnode-dapi.ts @@ -6,15 +6,15 @@ import { RemoveBeacon as RemoveBeaconEvent } from "../generated/AirnodeDapi/AirnodeDapi" import { - AddBeacon, - AggregatedMessageRoot, - AirnodeRrpCompleted, - AirnodeRrpRequested, - RemoveBeacon + AirnodeDapiAddBeacon, + AirnodeDapiAggregatedMessageRoot, + AirnodeDapiAirnodeRrpCompleted, + AirnodeDapiAirnodeRrpRequested, + AirnodeDapiRemoveBeacon } from "../generated/schema" export function handleAddBeacon(event: AddBeaconEvent): void { - let entity = new AddBeacon( + let entity = new AirnodeDapiAddBeacon( event.transaction.hash.concatI32(event.logIndex.toI32()) ) entity.beaconId = event.params.beaconId @@ -33,7 +33,7 @@ export function handleAddBeacon(event: AddBeaconEvent): void { export function handleAggregatedMessageRoot( event: AggregatedMessageRootEvent ): void { - let entity = new AggregatedMessageRoot( + let entity = new AirnodeDapiAggregatedMessageRoot( event.transaction.hash.concatI32(event.logIndex.toI32()) ) entity.msgRoot = event.params.msgRoot @@ -48,7 +48,7 @@ export function handleAggregatedMessageRoot( export function handleAirnodeRrpCompleted( event: AirnodeRrpCompletedEvent ): void { - let entity = new AirnodeRrpCompleted( + let entity = new AirnodeDapiAirnodeRrpCompleted( event.transaction.hash.concatI32(event.logIndex.toI32()) ) entity.beaconId = event.params.beaconId @@ -65,7 +65,7 @@ export function handleAirnodeRrpCompleted( export function handleAirnodeRrpRequested( event: AirnodeRrpRequestedEvent ): void { - let entity = new AirnodeRrpRequested( + let entity = new AirnodeDapiAirnodeRrpRequested( event.transaction.hash.concatI32(event.logIndex.toI32()) ) entity.beaconId = event.params.beaconId @@ -79,7 +79,7 @@ export function handleAirnodeRrpRequested( } export function handleRemoveBeacon(event: RemoveBeaconEvent): void { - let entity = new RemoveBeacon( + let entity = new AirnodeDapiRemoveBeacon( event.transaction.hash.concatI32(event.logIndex.toI32()) ) entity.beaconId = event.params.beaconId diff --git a/thegraph/ormpipe/src/ormp-oracle.ts b/thegraph/ormpipe/src/ormp-oracle.ts index f924bce..744c053 100644 --- a/thegraph/ormpipe/src/ormp-oracle.ts +++ b/thegraph/ormpipe/src/ormp-oracle.ts @@ -4,7 +4,7 @@ import { SetDapi as SetDapiEvent, SetFee as SetFeeEvent } from "../generated/OrmpOracle/OrmpOracle" -import { OrmpOracleAssigned, OrmpOracleSetApproved, OrmpOracleSetDapi, OrmpOracleSetFee } from "../generated/schema" +import {OrmpOracleAssigned, OrmpOracleSetApproved, OrmpOracleSetDapi, OrmpOracleSetFee} from "../generated/schema" export function handleAssigned(event: AssignedEvent): void { let entity = new OrmpOracleAssigned( diff --git a/thegraph/ormpipe/src/ormp-relayer.ts b/thegraph/ormpipe/src/ormp-relayer.ts index ea9fcc9..b8a710c 100644 --- a/thegraph/ormpipe/src/ormp-relayer.ts +++ b/thegraph/ormpipe/src/ormp-relayer.ts @@ -17,7 +17,8 @@ export function handleAssigned(event: AssignedEvent): void { ) entity.msgHash = event.params.msgHash entity.fee = event.params.fee - entity.parmas = event.params.parmas + entity.params = event.params.params + entity.proof = event.params.proof entity.blockNumber = event.block.number entity.blockTimestamp = event.block.timestamp diff --git a/thegraph/ormpipe/subgraph-arbitrum-goerli.yaml b/thegraph/ormpipe/subgraph-arbitrum-goerli.yaml index edc5012..e48dd02 100644 --- a/thegraph/ormpipe/subgraph-arbitrum-goerli.yaml +++ b/thegraph/ormpipe/subgraph-arbitrum-goerli.yaml @@ -14,11 +14,11 @@ dataSources: apiVersion: 0.0.7 language: wasm/assemblyscript entities: - - AddBeacon - - AggregatedMessageRoot - - AirnodeRrpCompleted - - AirnodeRrpRequested - - RemoveBeacon + - AirnodeDapiAddBeacon + - AirnodeDapiAggregatedMessageRoot + - AirnodeDapiAirnodeRrpCompleted + - AirnodeDapiAirnodeRrpRequested + - AirnodeDapiRemoveBeacon abis: - name: AirnodeDapi file: ./abis/AirnodeDapi.json @@ -34,22 +34,58 @@ dataSources: - event: RemoveBeacon(indexed bytes32) handler: handleRemoveBeacon file: ./src/airnode-dapi.ts + - kind: ethereum + name: OrmpProtocol + network: arbitrum-goerli + source: + address: "0x0000000000BD9dcFDa5C60697039E2b3B28b079b" + abi: OrmpProtocol + startBlock: 37626207 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - OrmpProtocolAppConfigUpdated + - OrmpProtocolClearFailedMessage + - OrmpProtocolMessageAccepted + - OrmpProtocolMessageDispatched + - 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 - kind: ethereum name: OrmpOracle network: arbitrum-goerli source: - address: "0x00000012f877F68a8D2410b683FDC8214f4b5194" + address: "0x000000003e2E2C9C8DD469E129E02E1666898E76" abi: OrmpOracle - startBlock: 35033799 + startBlock: 37626227 mapping: kind: ethereum/events apiVersion: 0.0.7 language: wasm/assemblyscript entities: - - Assigned - - SetApproved - - SetDapi - - SetFee + - OrmpOracleAssigned + - OrmpOracleSetApproved + - OrmpOracleSetDapi + - OrmpOracleSetFee abis: - name: OrmpOracle file: ./abis/OrmpOracle.json @@ -67,9 +103,9 @@ dataSources: name: OrmpRelayer network: arbitrum-goerli source: - address: "0x000000fbfBc6954C8CBba3130b5Aee7f3Ea5108e" + address: "0x000000007e24Da6666c773280804d8021E12e13F" abi: OrmpRelayer - startBlock: 35033836 + startBlock: 37626244 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -77,13 +113,13 @@ dataSources: entities: - OrmpRelayerAssigned - OrmpRelayerSetApproved - - SetDstConfig - - SetDstPrice + - OrmpRelayerSetDstConfig + - OrmpRelayerSetDstPrice abis: - name: OrmpRelayer file: ./abis/OrmpRelayer.json eventHandlers: - - event: Assigned(indexed bytes32,uint256,bytes) + - event: Assigned(indexed bytes32,uint256,bytes,bytes32[32]) handler: handleAssigned - event: SetApproved(address,bool) handler: handleSetApproved @@ -92,39 +128,3 @@ 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 diff --git a/thegraph/ormpipe/subgraph-pangolin.yaml b/thegraph/ormpipe/subgraph-pangolin.yaml index 1f04415..191ffb0 100644 --- a/thegraph/ormpipe/subgraph-pangolin.yaml +++ b/thegraph/ormpipe/subgraph-pangolin.yaml @@ -14,11 +14,11 @@ dataSources: apiVersion: 0.0.7 language: wasm/assemblyscript entities: - - AddBeacon - - AggregatedMessageRoot - - AirnodeRrpCompleted - - AirnodeRrpRequested - - RemoveBeacon + - AirnodeDapiAddBeacon + - AirnodeDapiAggregatedMessageRoot + - AirnodeDapiAirnodeRrpCompleted + - AirnodeDapiAirnodeRrpRequested + - AirnodeDapiRemoveBeacon abis: - name: AirnodeDapi file: ./abis/AirnodeDapi.json @@ -34,22 +34,58 @@ dataSources: - event: RemoveBeacon(indexed bytes32) handler: handleRemoveBeacon file: ./src/airnode-dapi.ts + - kind: ethereum + name: OrmpProtocol + network: pangolin + source: + address: "0x0000000000BD9dcFDa5C60697039E2b3B28b079b" + abi: OrmpProtocol + startBlock: 37626207 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - OrmpProtocolAppConfigUpdated + - OrmpProtocolClearFailedMessage + - OrmpProtocolMessageAccepted + - OrmpProtocolMessageDispatched + - 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 - kind: ethereum name: OrmpOracle network: pangolin source: - address: "0x00000012f877F68a8D2410b683FDC8214f4b5194" + address: "0x000000003e2E2C9C8DD469E129E02E1666898E76" abi: OrmpOracle - startBlock: 1241900 + startBlock: 37626227 mapping: kind: ethereum/events apiVersion: 0.0.7 language: wasm/assemblyscript entities: - - Assigned - - SetApproved - - SetDapi - - SetFee + - OrmpOracleAssigned + - OrmpOracleSetApproved + - OrmpOracleSetDapi + - OrmpOracleSetFee abis: - name: OrmpOracle file: ./abis/OrmpOracle.json @@ -67,9 +103,9 @@ dataSources: name: OrmpRelayer network: pangolin source: - address: "0x000000fbfBc6954C8CBba3130b5Aee7f3Ea5108e" + address: "0x000000007e24Da6666c773280804d8021E12e13F" abi: OrmpRelayer - startBlock: 1241900 + startBlock: 37626244 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -77,13 +113,13 @@ dataSources: entities: - OrmpRelayerAssigned - OrmpRelayerSetApproved - - SetDstConfig - - SetDstPrice + - OrmpRelayerSetDstConfig + - OrmpRelayerSetDstPrice abis: - name: OrmpRelayer file: ./abis/OrmpRelayer.json eventHandlers: - - event: Assigned(indexed bytes32,uint256,bytes) + - event: Assigned(indexed bytes32,uint256,bytes,bytes32[32]) handler: handleAssigned - event: SetApproved(address,bool) handler: handleSetApproved @@ -92,39 +128,3 @@ dataSources: - event: SetDstPrice(indexed uint256,uint128,uint128) handler: handleSetDstPrice file: ./src/ormp-relayer.ts - - kind: ethereum - name: OrmpProtocol - network: pangolin - source: - address: "0x00000000fec9f746a2138D9C6f42794236f3aca8" - abi: OrmpProtocol - startBlock: 1241900 - 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 diff --git a/thegraph/ormpipe/tests/airnode-dapi.test.ts b/thegraph/ormpipe/tests/airnode-dapi.test.ts index c8de2fc..cc5ec05 100644 --- a/thegraph/ormpipe/tests/airnode-dapi.test.ts +++ b/thegraph/ormpipe/tests/airnode-dapi.test.ts @@ -7,7 +7,7 @@ import { afterAll } from "matchstick-as/assembly/index" import { Bytes, Address } from "@graphprotocol/graph-ts" -import { AddBeacon } from "../generated/schema" +import { AirnodeDapiAddBeacon } from "../generated/schema" import { AddBeacon as AddBeaconEvent } from "../generated/AirnodeDapi/AirnodeDapi" import { handleAddBeacon } from "../src/airnode-dapi" import { createAddBeaconEvent } from "./airnode-dapi-utils" diff --git a/thegraph/ormpipe/tests/ormp-relayer-utils.ts b/thegraph/ormpipe/tests/ormp-relayer-utils.ts index 955c328..c188173 100644 --- a/thegraph/ormpipe/tests/ormp-relayer-utils.ts +++ b/thegraph/ormpipe/tests/ormp-relayer-utils.ts @@ -10,7 +10,8 @@ import { export function createAssignedEvent( msgHash: Bytes, fee: BigInt, - parmas: Bytes + params: Bytes, + proof: Array ): Assigned { let assignedEvent = changetype(newMockEvent()) @@ -23,7 +24,10 @@ export function createAssignedEvent( new ethereum.EventParam("fee", ethereum.Value.fromUnsignedBigInt(fee)) ) assignedEvent.parameters.push( - new ethereum.EventParam("parmas", ethereum.Value.fromBytes(parmas)) + new ethereum.EventParam("params", ethereum.Value.fromBytes(params)) + ) + assignedEvent.parameters.push( + new ethereum.EventParam("proof", ethereum.Value.fromFixedBytesArray(proof)) ) return assignedEvent diff --git a/thegraph/ormpipe/tests/ormp-relayer.test.ts b/thegraph/ormpipe/tests/ormp-relayer.test.ts index 8179695..36e1cb1 100644 --- a/thegraph/ormpipe/tests/ormp-relayer.test.ts +++ b/thegraph/ormpipe/tests/ormp-relayer.test.ts @@ -19,8 +19,9 @@ describe("Describe entity assertions", () => { beforeAll(() => { let msgHash = Bytes.fromI32(1234567890) let fee = BigInt.fromI32(234) - let parmas = Bytes.fromI32(1234567890) - let newAssignedEvent = createAssignedEvent(msgHash, fee, parmas) + let params = Bytes.fromI32(1234567890) + let proof = [Bytes.fromI32(1234567890)] + let newAssignedEvent = createAssignedEvent(msgHash, fee, params, proof) handleAssigned(newAssignedEvent) }) @@ -50,9 +51,15 @@ describe("Describe entity assertions", () => { assert.fieldEquals( "Assigned", "0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1", - "parmas", + "params", "1234567890" ) + assert.fieldEquals( + "Assigned", + "0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1", + "proof", + "[1234567890]" + ) // More assert options: // https://thegraph.com/docs/en/developer/matchstick/#asserts