Skip to content

feat: add Draw and Shift #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,020 changes: 736 additions & 284 deletions contracts/kleros.json

Large diffs are not rendered by default.

2,350 changes: 2,156 additions & 194 deletions generated/Kleros/Kleros.ts

Large diffs are not rendered by default.

319 changes: 319 additions & 0 deletions generated/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,325 @@ export class Round extends Entity {
}
}

export class Draw extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}

save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Draw entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Draw must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`
);
store.set("Draw", id.toString(), this);
}
}

static loadInBlock(id: string): Draw | null {
return changetype<Draw | null>(store.get_in_block("Draw", id));
}

static load(id: string): Draw | null {
return changetype<Draw | null>(store.get("Draw", id));
}

get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}

set id(value: string) {
this.set("id", Value.fromString(value));
}

get address(): Bytes {
let value = this.get("address");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}

set address(value: Bytes) {
this.set("address", Value.fromBytes(value));
}

get appeal(): BigInt {
let value = this.get("appeal");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set appeal(value: BigInt) {
this.set("appeal", Value.fromBigInt(value));
}

get disputeID(): BigInt {
let value = this.get("disputeID");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set disputeID(value: BigInt) {
this.set("disputeID", Value.fromBigInt(value));
}

get voteID(): BigInt {
let value = this.get("voteID");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set voteID(value: BigInt) {
this.set("voteID", Value.fromBigInt(value));
}
}

export class TokenAndETHShift extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}

save(): void {
let id = this.get("id");
assert(id != null, "Cannot save TokenAndETHShift entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type TokenAndETHShift must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`
);
store.set("TokenAndETHShift", id.toString(), this);
}
}

static loadInBlock(id: string): TokenAndETHShift | null {
return changetype<TokenAndETHShift | null>(
store.get_in_block("TokenAndETHShift", id)
);
}

static load(id: string): TokenAndETHShift | null {
return changetype<TokenAndETHShift | null>(
store.get("TokenAndETHShift", id)
);
}

get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}

set id(value: string) {
this.set("id", Value.fromString(value));
}

get ETHAmount(): BigInt {
let value = this.get("ETHAmount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set ETHAmount(value: BigInt) {
this.set("ETHAmount", Value.fromBigInt(value));
}

get address(): Bytes {
let value = this.get("address");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}

set address(value: Bytes) {
this.set("address", Value.fromBytes(value));
}

get disputeID(): BigInt {
let value = this.get("disputeID");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set disputeID(value: BigInt) {
this.set("disputeID", Value.fromBigInt(value));
}

get tokenAmount(): BigInt {
let value = this.get("tokenAmount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set tokenAmount(value: BigInt) {
this.set("tokenAmount", Value.fromBigInt(value));
}
}

export class StakeSet extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}

save(): void {
let id = this.get("id");
assert(id != null, "Cannot save StakeSet entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type StakeSet must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`
);
store.set("StakeSet", id.toString(), this);
}
}

static loadInBlock(id: string): StakeSet | null {
return changetype<StakeSet | null>(store.get_in_block("StakeSet", id));
}

static load(id: string): StakeSet | null {
return changetype<StakeSet | null>(store.get("StakeSet", id));
}

get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}

set id(value: string) {
this.set("id", Value.fromString(value));
}

get address(): Bytes {
let value = this.get("address");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}

set address(value: Bytes) {
this.set("address", Value.fromBytes(value));
}

get subcourtID(): BigInt {
let value = this.get("subcourtID");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set subcourtID(value: BigInt) {
this.set("subcourtID", Value.fromBigInt(value));
}

get stake(): BigInt {
let value = this.get("stake");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set stake(value: BigInt) {
this.set("stake", Value.fromBigInt(value));
}

get newTotalStake(): BigInt {
let value = this.get("newTotalStake");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set newTotalStake(value: BigInt) {
this.set("newTotalStake", Value.fromBigInt(value));
}

get timestamp(): BigInt {
let value = this.get("timestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set timestamp(value: BigInt) {
this.set("timestamp", Value.fromBigInt(value));
}

get blocknumber(): BigInt {
let value = this.get("blocknumber");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set blocknumber(value: BigInt) {
this.set("blocknumber", Value.fromBigInt(value));
}

get logIndex(): BigInt {
let value = this.get("logIndex");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}

set logIndex(value: BigInt) {
this.set("logIndex", Value.fromBigInt(value));
}
}

export class EvidenceGroup extends Entity {
constructor(id: Bytes) {
super();
Expand Down
Loading