-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.graphql
131 lines (117 loc) · 2.56 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
enum Period {
EVIDENCE
COMMIT
VOTE
APPEAL
EXECUTED
}
type Subcourt @entity {
id: ID!
staked: BigInt!
stakes: [Stake!]! @derivedFrom(field: "subcourt")
}
type Arbitrable @entity {
id: Bytes!
firstInteractionBlock: BigInt!
firstInteractionTimestamp: BigInt!
nbDisputes: BigInt!
disputes: [Dispute!]! @derivedFrom(field: "arbitrated")
}
type ArbitrableHistory @entity {
id: Bytes!
metaEvidence: String!
disputes: [Dispute!]! @derivedFrom(field: "arbitrableHistory")
}
type Dispute @entity {
id: ID!
ruling: BigInt!
ruled: Boolean!
period: Period!
nbRounds: BigInt!
nbChoices: BigInt!
arbitrated: Arbitrable!
metaEvidenceId: BigInt!
createdAtBlock: BigInt!
lastPeriodChange: BigInt!
arbitrableHistory: ArbitrableHistory
ongoing: [Activity!]! @derivedFrom(field: "dispute")
rounds: [Round!]! @derivedFrom(field: "dispute")
evidenceGroup: EvidenceGroup! @derivedFrom(field: "dispute")
rewards: [Reward!]! @derivedFrom(field: "dispute")
penalties: [Penalty!]! @derivedFrom(field: "dispute")
}
type Round @entity {
id: ID!
index: BigInt!
dispute: Dispute!
subcourt: Subcourt!
votesCastedCount: BigInt!
drawnCount: BigInt!
ongoing: [Activity!]! @derivedFrom(field: "round")
votes: [Vote!]! @derivedFrom(field: "round")
choices: [Choice!]! @derivedFrom(field: "round")
}
type Choice @entity {
id: ID!
round: Round!
index: BigInt!
voteCount: BigInt!
votes: [Vote!]! @derivedFrom(field: "choice")
}
type Vote @entity {
id: ID!
index: BigInt!
juror: Juror!
round: Round!
casted: Boolean!
choice: Choice
}
type EvidenceGroup @entity {
id: Bytes!
dispute: Dispute
length: BigInt!
evidence: [Evidence!]! @derivedFrom(field: "group")
}
type Evidence @entity(immutable: true) {
id: Bytes!
group: EvidenceGroup!
creationTime: BigInt!
URI: String!
sender: Bytes!
}
type Juror @entity {
id: ID!
totalStaked: BigInt!
totalVotesDrawn: BigInt!
nbDisputesAttended: BigInt!
ongoing: [Activity!]! @derivedFrom(field: "juror")
votes: [Vote!]! @derivedFrom(field: "juror")
stakes: [Stake!]! @derivedFrom(field: "juror")
rewards: [Reward!]! @derivedFrom(field: "juror")
penalties: [Penalty!]! @derivedFrom(field: "juror")
}
type Activity @entity {
id: ID!
juror: Juror!
round: Round!
dispute: Dispute!
}
type Stake @entity {
id: ID!
juror: Juror!
subcourt: Subcourt!
amount: BigInt!
}
type Reward @entity {
id: Bytes!
juror: Juror!
dispute: Dispute!
tokens: BigInt!
ETH: BigInt!
}
type Penalty @entity {
id: Bytes!
juror: Juror!
dispute: Dispute!
tokens: BigInt!
}