-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59e6ddf
commit d82e269
Showing
3 changed files
with
101 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from typing import List, Optional | ||
from pydantic import BaseModel, Field | ||
|
||
class IPFSData(BaseModel): | ||
title: Optional[str] = None | ||
discussions: Optional[str] = None | ||
|
||
|
||
class PayloadData(BaseModel): | ||
chain: str | ||
payloads_controller: str = Field(alias='payloadsController') | ||
payload_id: int = Field(alias='payloadId') | ||
|
||
class Config: | ||
allow_population_by_alias = True | ||
|
||
|
||
class ProposalData(BaseModel): | ||
payloads: list[PayloadData] = Field(default_factory=list) | ||
votingPortal: Optional[str] = None | ||
ipfsHash: Optional[str] = None | ||
|
||
|
||
class EventArgs(BaseModel): | ||
creator: Optional[str] = None | ||
accessLevel: Optional[int] = None | ||
ipfsHash: Optional[str] = None | ||
|
||
|
||
class EventData(BaseModel): | ||
transactionHash: Optional[str] = None | ||
args: EventArgs = Field(default_factory=EventArgs) | ||
|
||
|
||
class BGDProposalData(BaseModel): | ||
""" | ||
Represents the entire JSON structure returned by the BGD cache | ||
for a given proposal. | ||
""" | ||
ipfs: Optional[IPFSData] = None | ||
proposal: Optional[ProposalData] = None | ||
events: List[EventData] = Field(default_factory=list) | ||
|
||
|
||
class PayloadAddresses(BaseModel): | ||
chain: str | ||
addresses: List[str] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters