@@ -16,10 +16,10 @@ import {
1616 LRound ,
1717 LRegistry ,
1818 MetaEvidence ,
19- Arbitrator ,
2019 LContribution ,
2120 EvidenceGroup ,
2221 Evidence ,
22+ LArbitrator ,
2323} from '../generated/schema' ;
2424import {
2525 AppealPossible ,
@@ -541,12 +541,9 @@ export function handleContribution(event: Contribution): void {
541541 let roundInfo = tcr . getRoundInfo (
542542 event . params . _itemID ,
543543 event . params . _requestID ,
544- event . params . _roundID . minus ( BigInt . fromI32 ( 1 ) ) ,
544+ event . params . _roundID ,
545545 ) ;
546546
547- // we cannot get round.appealed from this roundInfo because
548- // of a smart contract bug.
549- // can only be set on AppealDecision.
550547 round . amountPaidRequester = roundInfo . value1 [ REQUESTER_CODE ] ;
551548 round . amountPaidChallenger = roundInfo . value1 [ CHALLENGER_CODE ] ;
552549 round . hasPaidRequester = roundInfo . value2 [ REQUESTER_CODE ] ;
@@ -560,20 +557,6 @@ export function handleContribution(event: Contribution): void {
560557 round . lastFundedChallenger = event . block . timestamp ;
561558 }
562559
563- let requestInfo = tcr . getRequestInfo (
564- event . params . _itemID ,
565- event . params . _requestID ,
566- ) ;
567- if ( round . appealed ) {
568- // ERROR: NOT a boolean
569- // requestInfo.value5 is requestInfo.numberOfRounds.
570- let newRoundID =
571- requestID + '-' + requestInfo . value5 . minus ( BigInt . fromI32 ( 1 ) ) . toString ( ) ;
572- let newRound = buildNewRound ( newRoundID , request . id , event . block . timestamp ) ;
573- newRound . save ( ) ;
574- request . numberOfRounds = requestInfo . value5 ;
575- }
576-
577560 let contributionID = roundID + '-' + round . numberOfContributions . toString ( ) ;
578561 let contribution = new LContribution ( contributionID ) ;
579562 contribution . round = round . id ;
@@ -587,7 +570,6 @@ export function handleContribution(event: Contribution): void {
587570
588571 contribution . save ( ) ;
589572 round . save ( ) ;
590- request . save ( ) ;
591573}
592574
593575export function handleRequestChallenged ( event : Dispute ) : void {
@@ -741,7 +723,15 @@ export function handleAppealDecision(event: AppealDecision): void {
741723 round . appealedAt = event . block . timestamp ;
742724 round . txHashAppealDecision = event . transaction . hash ;
743725
726+ // create new round
727+ let newRoundID = request . id + '-' + request . numberOfRounds . toString ( ) ;
728+ let newRound = buildNewRound ( newRoundID , request . id , event . block . timestamp ) ;
729+
744730 round . save ( ) ;
731+ newRound . save ( ) ;
732+
733+ request . numberOfRounds = request . numberOfRounds . plus ( BigInt . fromI32 ( 1 ) ) ;
734+ request . save ( ) ;
745735}
746736
747737export function handleStatusUpdated ( event : ItemStatusChange ) : void {
@@ -927,10 +917,10 @@ export function handleMetaEvidence(event: MetaEvidenceEvent): void {
927917 // to start monitoring it for events (if we aren't already).
928918 let tcr = LightGeneralizedTCR . bind ( event . address ) ;
929919 let arbitratorAddr = tcr . arbitrator ( ) ;
930- let arbitrator = Arbitrator . load ( arbitratorAddr . toHexString ( ) ) ;
920+ let arbitrator = LArbitrator . load ( arbitratorAddr . toHexString ( ) ) ;
931921 if ( ! arbitrator ) {
932922 IArbitratorDataSourceTemplate . create ( arbitratorAddr ) ;
933- arbitrator = new Arbitrator ( arbitratorAddr . toHexString ( ) ) ;
923+ arbitrator = new LArbitrator ( arbitratorAddr . toHexString ( ) ) ;
934924 arbitrator . save ( ) ;
935925 }
936926 }
0 commit comments