Skip to content

Commit

Permalink
Adding is_correct to model_dump
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfior committed Jul 1, 2024
1 parent f9f5d8a commit 19e5790
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion prediction_market_agent_tooling/markets/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enum import Enum
from typing import TypeAlias

from pydantic import BaseModel
from pydantic import BaseModel, computed_field

from prediction_market_agent_tooling.gtypes import OutcomeStr

Expand Down Expand Up @@ -41,6 +41,7 @@ class ResolvedBet(Bet):
resolved_time: datetime
profit: ProfitAmount

@computed_field
@property
def is_correct(self) -> bool:
return self.outcome == self.market_outcome
Expand Down

0 comments on commit 19e5790

Please sign in to comment.