Skip to content
Merged
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
6 changes: 5 additions & 1 deletion aleph_message/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
logger = logging.getLogger(__name__)


MAX_CHANNEL_LENGTH = 128


__all__ = [
"AggregateContent",
"AggregateMessage",
Expand Down Expand Up @@ -65,7 +68,7 @@ class ChainRef(BaseModel):
"""Some POST messages have a 'ref' field referencing other content"""

chain: Chain
channel: Optional[str] = None
channel: Optional[str] = Field(default=None, max_length=MAX_CHANNEL_LENGTH)
item_content: str
item_hash: ItemHash
item_type: ItemType
Expand Down Expand Up @@ -194,6 +197,7 @@ class BaseMessage(BaseModel):
type: MessageType = Field(description="Type of message (POST, AGGREGATE or STORE)")
channel: Optional[str] = Field(
default=None,
max_length=MAX_CHANNEL_LENGTH,
description="Channel of the message, one application ideally has one channel",
)
confirmations: Optional[List[MessageConfirmation]] = Field(
Expand Down
Loading