Skip to content

Commit

Permalink
enforcing sting
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Apr 16, 2024
1 parent 46dbe48 commit 342724a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion mantis/blackbox/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def create_app() -> FastAPI:


@app.get("/simulator/router")
def simulator_router(input: Input[str, int] = Depends()) -> list[SingleInputAssetCvmRoute[str, int]]:
def simulator_router(input: Input[str, str] = Depends()) -> list[SingleInputAssetCvmRoute[str, str]]:
"""_summary_
Given input, find and return route.
"""
Expand Down
15 changes: 3 additions & 12 deletions mantis/simulation/routers/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,6 @@ class Input(
'examples': ['123456'],
}
)
asdsadsad = Field(
example="10",
type='string',
json_schema_extra={
'title': 'Password',
'description': 'Password of the user',
'examples': ['123456'],
}
)
# if max is True, user wants to spent all in to get at least out
# if max is False, user wants to get exact out, but spent as small as possible in
# please fail if bool is False for now
Expand Down Expand Up @@ -396,13 +387,13 @@ class Spawn(BaseModel, Trade[TId, TAmount], Generic[TId, TAmount]):
amount to take with transfer
(delta)
"""
next: list[Union[Exchange, Spawn]]
next: list[Union[Exchange[TId, TAmount], Spawn[TId, TAmount]]]


# @dataclass
class Exchange(BaseModel, Trade[TId, TAmount], Generic[TId, TAmount]):
pool_id: TId
next: list[Union[Exchange, Spawn]]
next: list[Union[Exchange[TId, TAmount], Spawn[TId, TAmount]]]

@model_validator(mode="after")
def after(self: Exchange[TId, TAmount]) -> "Exchange":
Expand All @@ -417,7 +408,7 @@ class SingleInputAssetCvmRoute(BaseModel, Trade[TId, TAmount], Generic[TId, TAmo
always starts with Input asset_id
"""

next: list[Union[Exchange, Spawn]]
next: list[Union[Exchange[TId, TAmount], Spawn[TId, TAmount]]]

# @model_validator(mode="after")
# def model_validator_after(self):
Expand Down

0 comments on commit 342724a

Please sign in to comment.