(canister_id: Principal, method_name: String, arg: Vec<u8>, mut total_calls: u64)
| 10 | |
| 11 | #[update] |
| 12 | async fn call(canister_id: Principal, method_name: String, arg: Vec<u8>, mut total_calls: u64) { |
| 13 | while total_calls != 0 { |
| 14 | let current_batch = std::cmp::min(total_calls, 500); |
| 15 | total_calls -= current_batch; |
| 16 | let mut futs = vec![]; |
| 17 | for _ in 0..current_batch { |
| 18 | futs.push(call_raw(canister_id, &method_name, arg.clone(), 0)); |
| 19 | } |
| 20 | let res = join_all(futs).await; |
| 21 | for r in res { |
| 22 | r.unwrap(); |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | #[derive(CandidType, Deserialize)] |
| 28 | pub enum ValidationResponse { |