|
30 | 30 | TransitionToolContext, |
31 | 31 | TransitionToolInput, |
32 | 32 | TransitionToolOutput, |
33 | | - TransitionToolPost, |
| 33 | + TransitionToolRequest, |
34 | 34 | ) |
35 | 35 |
|
36 | 36 | model_dump_config: Mapping = {"by_alias": True, "exclude_none": True} |
@@ -150,9 +150,9 @@ def to_input(self) -> TransitionToolInput: |
150 | 150 | env=self.env, |
151 | 151 | ) |
152 | 152 |
|
153 | | - def get_post(self) -> TransitionToolPost: |
154 | | - """Convert the data to a TransitionToolContext object.""" |
155 | | - return TransitionToolPost( |
| 153 | + def get_request_data(self) -> TransitionToolRequest: |
| 154 | + """Convert the data to a TransitionToolRequest object.""" |
| 155 | + return TransitionToolRequest( |
156 | 156 | state=TransitionToolContext( |
157 | 157 | fork=self.fork_name, |
158 | 158 | chain_id=self.chain_id, |
@@ -318,29 +318,29 @@ def _evaluate_server( |
318 | 318 | timeout: int, |
319 | 319 | ) -> TransitionToolOutput: |
320 | 320 | """Execute the transition tool sending inputs and outputs via a server.""" |
321 | | - post_data = t8n_data.get_post() |
322 | | - post_json = post_data.model_dump(mode="json", **model_dump_config) |
| 321 | + request_data = t8n_data.get_request_data() |
| 322 | + request_data_json = request_data.model_dump(mode="json", **model_dump_config) |
323 | 323 |
|
324 | 324 | if debug_output_path: |
325 | 325 | request_info = ( |
326 | 326 | f"Server URL: {self.server_url}\n\n" |
327 | | - f"Request Data:\n{json.dumps(post_json, indent=2)}\n" |
| 327 | + f"Request Data:\n{json.dumps(request_data_json, indent=2)}\n" |
328 | 328 | ) |
329 | 329 | dump_files_to_directory( |
330 | 330 | debug_output_path, |
331 | 331 | { |
332 | | - "input/alloc.json": post_data.input.alloc, |
333 | | - "input/env.json": post_data.input.env, |
| 332 | + "input/alloc.json": request_data.input.alloc, |
| 333 | + "input/env.json": request_data.input.env, |
334 | 334 | "input/txs.json": [ |
335 | 335 | tx.model_dump(mode="json", **model_dump_config) |
336 | | - for tx in post_data.input.txs |
| 336 | + for tx in request_data.input.txs |
337 | 337 | ], |
338 | 338 | "request_info.txt": request_info, |
339 | 339 | }, |
340 | 340 | ) |
341 | 341 |
|
342 | 342 | response = self._server_post( |
343 | | - data=post_json, url_args=self._generate_post_args(t8n_data), timeout=timeout |
| 343 | + data=request_data_json, url_args=self._generate_post_args(t8n_data), timeout=timeout |
344 | 344 | ) |
345 | 345 | output: TransitionToolOutput = TransitionToolOutput.model_validate(response.json()) |
346 | 346 |
|
|
0 commit comments