Skip to content

Commit bafbd14

Browse files
committed
Merge branch 'dev' into feat/shutter-dispute-kit
2 parents aa01874 + 30382a0 commit bafbd14

File tree

5 files changed

+46
-8
lines changed

5 files changed

+46
-8
lines changed

subgraph/core/src/KlerosCore.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,19 @@ export function handleAppealDecision(event: AppealDecision): void {
215215
const disputeID = event.params._disputeID;
216216
const dispute = Dispute.load(disputeID.toString());
217217
if (!dispute) return;
218+
219+
// Load the current (previous) round
220+
const previousRoundID = dispute.currentRound;
221+
const previousRound = Round.load(previousRoundID);
222+
if (previousRound) {
223+
previousRound.isCurrentRound = false;
224+
previousRound.save();
225+
}
226+
218227
const newRoundIndex = dispute.currentRoundIndex.plus(ONE);
219-
const roundID = `${disputeID}-${newRoundIndex.toString()}`;
228+
const newRoundID = `${disputeID}-${newRoundIndex.toString()}`;
220229
dispute.currentRoundIndex = newRoundIndex;
221-
dispute.currentRound = roundID;
230+
dispute.currentRound = newRoundID;
222231
dispute.save();
223232
const roundInfo = contract.getRoundInfo(disputeID, newRoundIndex);
224233

subgraph/core/src/entities/Dispute.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,36 @@ export const updateDisputeRequestData = (event: DisputeCreation): void => {
5757
if (!receipt) return;
5858

5959
const logs = receipt.logs;
60+
const coreDisputeId = event.params._disputeID;
6061

6162
// note that the topic at 0th index is always the event signature
62-
const disputeRequestEventIndex = logs.findIndex((log) => log.topics[0] == DisputeRequestSignature);
63-
const crossChainDisputeEventIndex = logs.findIndex((log) => log.topics[0] == CrossChainDisputeIncomingSignature);
63+
// For DisputeRequestSignature
64+
let disputeRequestEventIndex = -1;
65+
for (let i = 0; i < logs.length; i++) {
66+
let log = logs[i];
67+
if (log.topics.length > 2 && log.topics[0] == DisputeRequestSignature) {
68+
// 3rd indexed argument in event is _arbitratorDisputeId
69+
let decodedId = ethereum.decode("uint256", log.topics[2]);
70+
if (decodedId != null && coreDisputeId.equals(decodedId.toBigInt())) {
71+
disputeRequestEventIndex = i;
72+
break;
73+
}
74+
}
75+
}
76+
77+
// For CrossChainDisputeIncomingSignature
78+
let crossChainDisputeEventIndex = -1;
79+
for (let i = 0; i < logs.length; i++) {
80+
let log = logs[i];
81+
if (log.topics.length > 3 && log.topics[0] == CrossChainDisputeIncomingSignature) {
82+
// 4th indexed argument in event is _arbitratorDisputeId
83+
let decodedId = ethereum.decode("uint256", log.topics[3]);
84+
if (decodedId != null && coreDisputeId.equals(decodedId.toBigInt())) {
85+
crossChainDisputeEventIndex = i;
86+
break;
87+
}
88+
}
89+
}
6490

6591
if (crossChainDisputeEventIndex !== -1) {
6692
const crossChainDisputeEvent = logs[crossChainDisputeEventIndex];

subgraph/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kleros/kleros-v2-subgraph",
3-
"version": "0.16.3",
3+
"version": "0.16.4",
44
"drtVersion": "0.12.2",
55
"license": "MIT",
66
"scripts": {

web/src/components/FileViewer/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ const StyledDocViewer = styled(DocViewer)`
2424
#pdf-controls {
2525
z-index: 3;
2626
}
27+
28+
[class*="--loading"] {
29+
color: ${({ theme }) => theme.secondaryText};
30+
}
2731
`;
2832

2933
/**

web/src/pages/Cases/CaseDetails/Timeline.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,10 @@ const AppealBanner: React.FC = () => {
8383
const { fundedChoices } = useFundingContext();
8484

8585
const text = useMemo(() => {
86-
if (loserSideCountdown)
87-
return `${secondsToDayHourMinute(loserSideCountdown)} left until losing options can be funded`;
86+
if (loserSideCountdown) return `${secondsToDayHourMinute(loserSideCountdown)} remaining to fund losing options`;
8887
// only show if loosing option was funded and winner needs funding, else no action is needed from user
8988
if (winnerSideCountdown && !isUndefined(fundedChoices) && fundedChoices.length > 0)
90-
return `${secondsToDayHourMinute(winnerSideCountdown)} left until winning option can be funded`;
89+
return `${secondsToDayHourMinute(winnerSideCountdown)} remaining to fund winning option`;
9190
return;
9291
}, [loserSideCountdown, winnerSideCountdown, fundedChoices]);
9392

0 commit comments

Comments
 (0)