|
1 | 1 | import { BigInt } from "@graphprotocol/graph-ts"; |
2 | | -import { KlerosCore__getRoundInfoResultValue0Struct } from "../../generated/KlerosCore/KlerosCore"; |
| 2 | +import { KlerosCore__getRoundInfoResult } from "../../generated/KlerosCore/KlerosCore"; |
3 | 3 | import { Round } from "../../generated/schema"; |
4 | 4 |
|
5 | 5 | export function createRoundFromRoundInfo( |
6 | 6 | disputeID: BigInt, |
7 | 7 | roundIndex: BigInt, |
8 | | - roundInfo: KlerosCore__getRoundInfoResultValue0Struct |
| 8 | + roundInfo: KlerosCore__getRoundInfoResult |
9 | 9 | ): void { |
10 | 10 | const roundID = `${disputeID.toString()}-${roundIndex.toString()}`; |
11 | 11 | const round = new Round(roundID); |
12 | | - const feeToken = roundInfo.feeToken; |
13 | | - round.disputeKit = roundInfo.disputeKitID.toString(); |
14 | | - round.tokensAtStakePerJuror = roundInfo.pnkAtStakePerJuror; |
15 | | - round.totalFeesForJurors = roundInfo.totalFeesForJurors; |
16 | | - round.nbVotes = roundInfo.nbVotes; |
17 | | - round.repartitions = roundInfo.repartitions; |
18 | | - round.penalties = roundInfo.pnkPenalties; |
| 12 | + const feeToken = roundInfo.getFeeToken().toHexString(); |
| 13 | + round.feeToken = feeToken === "0x0000000000000000000000000000000000000000" ? null : feeToken; |
| 14 | + round.disputeKit = roundInfo.getDisputeKitID().toString(); |
| 15 | + round.tokensAtStakePerJuror = roundInfo.getPnkAtStakePerJuror(); |
| 16 | + round.totalFeesForJurors = roundInfo.getTotalFeesForJurors(); |
| 17 | + round.nbVotes = roundInfo.getNbVotes(); |
| 18 | + round.repartitions = roundInfo.getRepartitions(); |
| 19 | + round.penalties = roundInfo.getPnkPenalties(); |
19 | 20 | round.dispute = disputeID.toString(); |
20 | | - round.feeToken = |
21 | | - feeToken.toHexString() === "0x0000000000000000000000000000000000000000" ? null : feeToken.toHexString(); |
22 | 21 | round.save(); |
23 | 22 | } |
0 commit comments