-
Notifications
You must be signed in to change notification settings - Fork 0
/
objects.py
53 lines (40 loc) · 1.51 KB
/
objects.py
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
from typing import List
import marshmallow_dataclass
from dataclasses import field
import marshmallow.fields as mfields
from starkware.starkware_utils.validated_dataclass import ValidatedMarshmallowDataclass
from starkware.starkware_utils.marshmallow_dataclass_fields import additional_metadata
from starkware.cairo.bootloaders.simple_bootloader.objects import TaskSpec, TaskSchema
@marshmallow_dataclass.dataclass(frozen=True)
class NodeClaim(ValidatedMarshmallowDataclass):
a_start: int
b_start: int
n: int
@marshmallow_dataclass.dataclass(frozen=True)
class NodeResult(ValidatedMarshmallowDataclass):
a_start: int
b_start: int
n: int
a_end: int
b_end: int
@marshmallow_dataclass.dataclass(frozen=True)
class ApplicativeResult(ValidatedMarshmallowDataclass):
path_hash: int
node_result: NodeResult
@marshmallow_dataclass.dataclass(frozen=True)
class AggregatorClaim(ValidatedMarshmallowDataclass):
nodes: List[ApplicativeResult]
@marshmallow_dataclass.dataclass(frozen=True)
class AggregatorResult(ValidatedMarshmallowDataclass):
nodes_hash: int
node_result: ApplicativeResult
@marshmallow_dataclass.dataclass(frozen=True)
class ApplicativeBootloaderInput(ValidatedMarshmallowDataclass):
aggregator_task: TaskSpec = field(
metadata=additional_metadata(marshmallow_field=mfields.Nested(TaskSchema))
)
tasks: List[TaskSpec] = field(
metadata=additional_metadata(
marshmallow_field=mfields.List(mfields.Nested(TaskSchema))
)
)