Skip to content

Commit 805ef37

Browse files
committed
Fix: ClientResponse of aiohttps does not have model_dump_json() method
1 parent ae3172d commit 805ef37

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/aleph/chains/indexer_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ async def _query(self, query: str, model: Type[T]) -> T:
146146

147147
response = await self.http_session.post("/", json={"query": query})
148148
response.raise_for_status()
149-
response_json = await response.model_dump_json()
149+
response_json = await response.json()
150150
return model.model_validate(response_json)
151151

152152
async def fetch_account_state(

src/aleph/chains/nuls2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ async def get_transactions(
248248
"pagination": 500,
249249
},
250250
) as resp:
251-
jres = await resp.model_dump_json()
251+
jres = await resp.json()
252252
for tx in sorted(jres["transactions"], key=itemgetter("height")):
253253
if remark is not None and tx["remark"] != remark:
254254
continue

src/aleph/chains/tezos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def make_graphql_query(
139139
async def get_indexer_status(http_session: aiohttp.ClientSession) -> SyncStatus:
140140
response = await http_session.post("/", json={"query": make_graphql_status_query()})
141141
response.raise_for_status()
142-
response_json = await response.model_dump_json()
142+
response_json = await response.json()
143143

144144
return SyncStatus(response_json["data"]["indexStatus"]["status"])
145145

@@ -160,7 +160,7 @@ async def fetch_messages(
160160

161161
response = await http_session.post("/", json={"query": query})
162162
response.raise_for_status()
163-
response_json = await response.model_dump_json()
163+
response_json = await response.json()
164164

165165
return IndexerResponse[IndexerMessageEvent].model_validate(response_json)
166166

src/aleph/services/ipfs/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async def add_file(self, file_content: bytes):
165165

166166
resp = await session.post(url, data=data)
167167
resp.raise_for_status()
168-
return await resp.model_dump_json()
168+
return await resp.json()
169169

170170
async def sub(self, topic: str):
171171
ipfs_client = self.ipfs_client

0 commit comments

Comments
 (0)