Skip to content

Commit

Permalink
add timestamp to verifiable model
Browse files Browse the repository at this point in the history
  • Loading branch information
Archento committed Oct 21, 2024
1 parent 01fdbe6 commit 0b78739
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/src/uagents/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import hashlib
import json
import logging
import time
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Union

Expand All @@ -26,8 +27,10 @@
class VerifiableModel(BaseModel):
agent_address: str
signature: Optional[str] = None
timestamp: Optional[int] = None

def sign(self, identity: Identity):
self.timestamp = int(time.time())
digest = self._build_digest()
self.signature = identity.sign_digest(digest)

Expand Down

0 comments on commit 0b78739

Please sign in to comment.