| 947 | } |
| 948 | |
| 949 | pub fn upload_canister_modules(env: &PocketIc, control_panel_id: Principal, controller: Principal) { |
| 950 | // upload upgrader |
| 951 | let upgrader_wasm = get_canister_wasm("upgrader").to_vec(); |
| 952 | let upload_canister_modules_args = UploadCanisterModulesInput { |
| 953 | upgrader_wasm_module: Some(upgrader_wasm.to_owned()), |
| 954 | station_wasm_module: None, |
| 955 | station_wasm_module_extra_chunks: None, |
| 956 | }; |
| 957 | let res: (ApiResult<()>,) = update_candid_as( |
| 958 | env, |
| 959 | control_panel_id, |
| 960 | controller, |
| 961 | "upload_canister_modules", |
| 962 | (upload_canister_modules_args.clone(),), |
| 963 | ) |
| 964 | .unwrap(); |
| 965 | res.0.unwrap(); |
| 966 | |
| 967 | // upload station |
| 968 | |
| 969 | let station_wasm = get_canister_wasm("station"); |
| 970 | let (base_chunk, module_extra_chunks) = |
| 971 | upload_canister_chunks_to_asset_canister(env, station_wasm, 500_000); |
| 972 | let upload_canister_modules_args = UploadCanisterModulesInput { |
| 973 | upgrader_wasm_module: None, |
| 974 | station_wasm_module: Some(base_chunk), |
| 975 | station_wasm_module_extra_chunks: Some(Some(module_extra_chunks)), |
| 976 | }; |
| 977 | let res: (ApiResult<()>,) = update_candid_as( |
| 978 | env, |
| 979 | control_panel_id, |
| 980 | controller, |
| 981 | "upload_canister_modules", |
| 982 | (upload_canister_modules_args.clone(),), |
| 983 | ) |
| 984 | .unwrap(); |
| 985 | res.0.unwrap(); |
| 986 | } |
| 987 | |
| 988 | pub fn bump_time_to_avoid_ratelimit(env: &PocketIc) { |
| 989 | // the rate limiter aggregation window is 300s and resolution is 10s |