-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from iExecBlockchainComputing/feature/back-mer…
…ge-1.1.0 Feature/back merge 1.1.0
- Loading branch information
Showing
6 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
// SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH <[email protected]> | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { BigInt } from '@graphprotocol/graph-ts'; | ||
import { Address, BigInt, dataSource } from '@graphprotocol/graph-ts'; | ||
const chainName = dataSource.network(); | ||
|
||
import { | ||
AccurateContribution as AccurateContributionEvent, | ||
|
@@ -127,10 +128,17 @@ export function handleMatchOrders(call: MatchOrdersCall): void { | |
export function handleOrdersMatched(event: OrdersMatchedEvent): void { | ||
let contract = IexecInterfaceTokenContract.bind(event.address); | ||
let viewedDeal = contract.viewDeal(event.params.dealid); | ||
|
||
// The `sponsor` has been introduced on Bellecour for the PoCo v5.5.0 release: | ||
// https://blockscout.bellecour.iex.ec/tx/0x71b904f526a9be218d35748f57d74ef6da20d12c88f94cfa1ec5ae2de187cb98 | ||
// TODO: Use grafting instead, see https://thegraph.com/docs/en/subgraphs/cookbook/grafting/ | ||
const sponsor = | ||
chainName == 'bellecour' && event.block.number < BigInt.fromI32(30277938) | ||
? Address.zero().toHexString() | ||
: viewedDeal.sponsor.toHex(); | ||
fetchAccount(viewedDeal.requester.toHex()).save(); | ||
fetchAccount(viewedDeal.beneficiary.toHex()).save(); | ||
fetchAccount(viewedDeal.callback.toHex()).save(); | ||
fetchAccount(sponsor).save(); | ||
|
||
let deal = fetchDeal(event.params.dealid.toHex()); | ||
deal.app = viewedDeal.app.pointer.toHex(); | ||
|
@@ -154,7 +162,7 @@ export function handleOrdersMatched(event: OrdersMatchedEvent): void { | |
deal.botSize = viewedDeal.botSize; | ||
deal.workerStake = viewedDeal.workerStake; | ||
deal.schedulerRewardRatio = viewedDeal.schedulerRewardRatio; | ||
deal.sponsor = viewedDeal.sponsor.toHex(); | ||
deal.sponsor = sponsor; | ||
deal.apporder = event.params.appHash.toHex(); | ||
deal.datasetorder = event.params.datasetHash.toHex(); | ||
deal.workerpoolorder = event.params.workerpoolHash.toHex(); | ||
|