forked from Soroban-Pulse/SorobanPulse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.py
More file actions
21 lines (18 loc) · 666 Bytes
/
patch.py
File metadata and controls
21 lines (18 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
with open('src/handlers.rs', 'r') as f:
c = f.read()
# 1. Update signature of get_events_by_contract
c = c.replace(
"""pub async fn get_events_by_contract(
State(state): State<AppState>,
Path(contract_id): Path<String>,
Query(params): Query<PaginationParams>,
) -> Result<Json<Value>, AppError> {""",
"""pub async fn get_events_by_contract(
State(state): State<AppState>,
Path(contract_id): Path<String>,
Query(params): Query<PaginationParams>,
headers: axum::http::HeaderMap,
) -> Result<impl axum::response::IntoResponse, AppError> {""")
print("File patched successfully.")
with open('src/handlers.rs', 'w') as f:
f.write(c)